Feature Request - Change Highlighter Implementation

Jeff
2013-01-07
2013-01-12
  • Jeff

    Jeff - 2013-01-07

    I don't have access to post to the Feature Requests page, just this Discussion page. So if you move this feature request to the Feature Requests page, I won't be able to post a reply to any of your replies.

    I read through the User's Guide but didn't find an explanation for the Options>Highlighter feature. I don't understand its purpose since any Save operation (and possibly other operations) will reset a highlighter choice back to its default setting for that file type.

    I would like to suggest a different use for the Options>Highlighter menu that would be more useful and more intuitive.

    First, I think 'Multi' should be removed and replaced with 'HTML'. Next, the menu choices should be AND instead of OR like the View menu choices. For example, the default Highlighter menu for an html file would look like:

    X HTML
    X PHP
        Smarty
    X Cascading style sheets
        XML
    X Javascript
        Python
        SQL
    ...

    The "X" indicates that the menu choice is active, or selected.

    The Highlighter settings for a particular file type should be the same for all open files of that type. The default highlighter settings for a php file are the same as the html file settings shown above. If I have a php file open and I change the Highlighter menu to this:
     X HTML
    X PHP
        Smarty
        Cascading style sheets
        XML
    X Javascript
        Python
        SQL
    ...

    then all open php files should change to this new highlighter setting.

    Also, these active settings shouldn't change or return to their default settings when I close the IDE, in the same way that the View settings don't change when I close the IDE. If I disable View>File Toolbar and then close and restart the IDE, the View>File Toolbar is still disabled.

    The Options>General Options>File Extensions page is a good resource for managing file extensions for the highlighter and mapping a file extension to one of the Options>Highlighter menu choices.

    'Multi' should be removed since its purpose has been eliminated on the Options>Highlighter menu. The remaining items should match exactly to their Options>Highlighter menu name. For example, for css the Options>Highlighter name is 'Cascading style sheets' but its name in Options>General Options>File Extensions is 'CSS'. They should both be 'CSS' or they should both be 'Cascading style sheets'. Same for js - they should both be 'JavaScript'. This will eliminate any confusion on the part of the user.

    The Options>General Options>File Extensions page shouldn't be used for setting the default Options>Highlighter settings. The Options>Highlighter settings should be set to default settings when Dev-PHP is first installed, again like the View menu settings are, and once changed by the user, they remain changed. If you think a user is going to mess it up too bad, you could add a button on the Options>General Options>File Extensions page that says 'Reset Highlighter file settings back to their default setting' or something like that.

    I'll admit that I don't know what INI, Unix Shell, and AutoHotkey are used for. I could see php.ini for the INI extension, but I don't know what the other two are used for. The 'No Highlighter' choice should be used to turn off the Highlighter for all file types while preserving the active settings so that, once it is deselected, the Highlighter active settings for each file type are restored to what the user last set them to.

    -Jeff

     
    Last edit: Pierre Fauconnier 2013-01-08
    • Pierre Fauconnier

      I don't have access to post to the Feature Requests page

      *Fixed*

      I read through the User's Guide

      You're right. The chapter at Configuration#File_extensions should be improved.

      First, I think 'Multi' should be removed and replaced with 'HTML'.

      I understand what you mean. You're speaking about functional syntax highlighting.

      But here, "Multi" means technically a syntax highlighter (a technical object whose name is SynWeb) which includes syntax highlighted for several items: for PHP and HTML and CSS and JS. Just below the caption "Multi", the "PHP" caption means yet another highlighter, with much less features, and very different from "Multi" (for example, this highlighter has no recognition method for code folding ;)

      The relations are: File -> Extension -> Highlighter -> Styles.
      . A highlighter is affected by default to a file via the extension of that file. The default affectation is defined via the parameters "Options/General Options/General/File Extensions".
      . The highlighters are:"Multi", "PHP", "CSS", "ECMA Script", "HTML", "SQL", "XML", "Smarty", "Python", "AHK".
      . The styles of the current highlighter (i.e. the highlighter of the current file) can be changed via "Options/General Options/General/Syntax highlighting".

      I believe there are two major issues: vocabulary and implicit scheme - Isn't it?

      They should both be 'CSS' or they should both be 'Cascading style sheets'. Same for js

      You're right. Though JS is actually ECMA Script :)

      The Options>General Options>File Extensions page shouldn't be used for setting the default Options>Highlighter settings.

      Functional vs technical (see above). I disagree, due to technical reasons. Furthermore, the rules for these changes must be more specific.
      Or do we assume "One extension -> One highlighter"?
      Of course! This could even be more "POLA": instead of the current rule (code centric) "One highlighter -> Many extensions", use an array of "One extension -> One highlighter", sorted by extensions?

      I don't know what INI, Unix Shell, and AutoHotkey are used for.

      . As you expected INI is used for configuration files like php.ini
      . Unix Shell Scripts are script languages for *Nix machines (.sh, .csh, .ksh, .bash, … )
      . AutoHotKey is another scripting language for ms-windows see here

      The 'No Highlighter' choice should be used to turn off the Highlighter for all file types while preserving the active settings so that, once it is deselected, the Highlighter active settings for each file type are restored to what the user last set them to.

      For the moment we work on a file-by-file basis:
      . "For the current file, and only the current file, I must be able to change its default highlighter, temporarily"
      . "For a given file, its default highlighter is depending on the file extension (joker chars accepted in extension)".

      If I'm working on a .bash file having some SQL commands in it, I can change its highlighter in order to best see the SQL commands. At no moment this means that the highlighter for all ".bash-files" has to be changed to ".sql" - (same for ".js" and ".html" ;)

      I'll add that changing the highlighter on the fly means parse this file one more time. Doing that on dozens of files at a time, is undoubtedly time consuming. BUT, we could add a new parameter in general options, allowing this ; what caption should we write in front of the corresponding check box?

      -- Pierre

       
  • Jeff

    Jeff - 2013-01-09

    Hi Pierre,

    Thank you for your well thought-out response.

    I believe the real issue here is that you and I approach Dev-PHP from two different angles. I look at the IDE from the viewpoint of a website designer. You look at it as a coder. I was unaware of SynWeb and AutoHotKey and understanding those made it clear to me how you view it.

    Or, to put it another way, I thought I was driving around in a Volkswagen and I just realized that I was sitting in a Porsche.

    For my purposes, a Volkswagen is all I need and Dev-PHP works very well for me. It has many features that I'll probably never use and some features, like the highlighter, that will never work they way I would want them to. But I can live with that.

    Consider this feature request closed - but kept in mind if you ever release Dev-PHP-Lite. :^)

    -Jeff

     
    Last edit: Pierre Fauconnier 2013-01-09
    • Pierre Fauconnier

      Hi Jeff,

      Volkswagen und Porsche :)

      Well, our discussion highlighted the need to review the "Options" window, and the documentation too. It will be done.

      Last but not least, about our "Dev-PHP for Dummies", I still have a question:

      BUT, we could add a new parameter in general options, allowing this ; what caption should we write in front of the corresponding check box?

       
      • Pierre Fauconnier

        Here is my request for comments (RFC ;) about the new "Options" form.

        New order in the tree-structure: "File extension" and "Syntax highlighting" are now the last items in the sequence. (a recall to the order relation of these items "File -> Extension -> Highlighter -> Styles")

        New captions:
        "Each file extension is linked to a code highlighter.", "File extension", "Code highlighter"

        New grid:
        in order to define wished file extensions and their highlighter. New combo displaying the list of 14 supported highlighters.

        For the moment, I can't say if the previous settings will be taken into account, or not. The list of 14 default extensions is: 'htm*', 'css*', 'js', 'phpgtk', 'xml', 'tpl', 'wml', 'inc', 'php3', '*sh', 'sql', 'ini', 'py', 'ahk'.

        Comments, please?

         
        Last edit: Pierre Fauconnier 2013-01-12

Log in to post a comment.