Adding new syntax files

Help
fm
2010-05-08
2013-05-28
  • fm
    fm
    2010-05-08

    How do you add new syntax/code completion/highlighting files to juffed?

     
  • Mezomish
    Mezomish
    2010-05-17

    1. New syntaxes can be added by implementing special "lexer classes" (in terms of QScintilla). Each syntax highlighting/code indentiation/code folding is treated by a corresponding lexer class (this is how it's designed in QScintilla and the original Scintilla).

    2. As for code completion - this is just a list of pre-defined words for each language that you can find in "apis" subdirectory.

    3. Highlighting files are quite simple XML files located under "${USER_DIRECTORY}/.config/juff/hlschemes/". This is my own implementation that "covers" standard QScintilla highlighting settings in order to make it more simple.
    The disadvantage of this approach is that I need to cover all available syntaxes explicitly. For example, if you add tcl.xml with corresponding colors to "hlschemes" directory it will not work right away: I need to add some adjusting code. It's not complicated at all, it just needs to be added.

    Which languages you are interested in? I'm asking because I'm planning to add some new lexers soon and I'll be glad to add the ones you need.

     
  • Mezomish
    Mezomish
    2010-08-13

    I couldn't see any syntax differences from C. Is there any? Or it can be viewed with the same highlighter as C/C++ has?
    Try to select C/C++ highlighting manually - is it good enough? If it is, I can simply add corresponding file extensions (what are they? *.nbc/*.nxc/something else?) to C/C++ lexer and it will be used for them automatically.