Author Topic: how to add a language to codeblocks for syntax highlighting?  (Read 12903 times)

Offline laserbeak43

  • Multiple posting newcomer
  • *
  • Posts: 61
how to add a language to codeblocks for syntax highlighting?
« on: December 21, 2007, 09:04:34 pm »
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.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)

Offline laserbeak43

  • Multiple posting newcomer
  • *
  • Posts: 61

Offline laserbeak43

  • Multiple posting newcomer
  • *
  • Posts: 61
Re: how to add a language to codeblocks for syntax highlighting?
« Reply #3 on: December 21, 2007, 11:37:40 pm »
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.
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?

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 836
Re: how to add a language to codeblocks for syntax highlighting?
« Reply #4 on: December 22, 2007, 12:40:52 am »
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
« Last Edit: December 22, 2007, 12:43:34 am by byo »

Offline EnterTheNameHere

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: how to add a language to codeblocks for syntax highlighting?
« Reply #5 on: December 22, 2007, 05:47:27 am »
byo:
That would be a really great thing. Even killer feature combined with codecompletion( hmm, what about Code::Completion?((: )
I wish you good luck and have a lot of energy and verve to continue( sorry for my english )

Sorry for OT

Offline laserbeak43

  • Multiple posting newcomer
  • *
  • Posts: 61
Re: how to add a language to codeblocks for syntax highlighting?
« Reply #6 on: December 23, 2007, 05:10:17 am »
yeah i hope that gets done :)
could i talk to the guys at scintilla about adding the language to lexxer?