Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
how to add a language to codeblocks for syntax highlighting?
laserbeak43:
hi, i would like to add a language and its assembler to codeblocks with syntax highlighting etc. how do i start adding a syntax highlighting "script"(is that the right term)?
the only thing i can find in the codeblocks IDE itself is a scheme or theme. but i can't add a particular language to the list.
JGM:
Always search in the wiki! :)
http://wiki.codeblocks.org/index.php?title=Creating_a_custom_lexer_for_Code::Blocks_editor
laserbeak43:
--- Quote from: JGM on December 21, 2007, 10:18:10 pm ---Always search in the wiki! :)
http://wiki.codeblocks.org/index.php?title=Creating_a_custom_lexer_for_Code::Blocks_editor
--- End quote ---
oops :) will do next time :)
laserbeak43:
--- Quote ---index corresponds with the wxSCI_LEX_* constants, found in sdk/wxscintilla/include/wx/wxscintilla.h. In this example, if you look in sdk/wxscintilla/include/wx/wxscintilla.h, you'll see that index 3 matches wxSCI_LEX_CPP. That is the lexer id for C/C++ syntax highlighting.
If we were building a lexer configuration for let's say, XML (random choice) we would look up the constant wxSCI_LEX_XML which is defined to be number 5. So index=5. Simple.
--- End quote ---
I'm trying to create syntax highlighting for NESASM.
if i it weren't in the wxscintilla.h does this mean that i couldn't create an entry and i'd be screwed?
byo:
Currently: yes.
It's possible to add other custom lexers but that would require minor changes in wxscintilla source (adding dllexport for some classes), so currently it can not be done.
I work on some solution that would allow generating lexer for any language through custom C::B plugin (I was to tired of wxSmith so needed to code something different ;) ) - that would give you ability to colourise the source just as you want by writing your own plugin, but for now it's just my personal experimental code so I don't know even if it will ever be included in the main sources (it requires some changes in sdk and wxScintilla).
Regards
BYO
Navigation
[0] Message Index
[#] Next page
Go to full version