Syntax highlighting

BlitzMax Forums/BlitzMax Beginners Area/Syntax highlighting

Yahfree(Posted 2008) [#1]
Hey, I've noticed some inconsistant syntax highlighting, and I have a couple questions:

1. In my MaxIDE, things like TSound are highlighted, while some aren't, for example, TImage.
2. In one of Brucey's modules, wxmod, some of the wxtypes are highlighted while others aren't, and I haven't seen any highlighted functions. If you create a module, do types, functions ect. get automaticly highlighted? Or is there something you have to do?
3. Is this inconsistant highlighting due to a bug in my blitzmax installation? Or is it purely a IDE bug, if so, is there any cure?


The reason why I ask is because seeing functions, types, ect highlighted and correctly capitalised automaticly helps with the overall visibility of the code, and Blitz3D had automatic syntax highlighting for its userlib system. So I'd assume there'd be something similar for Max and it's mods.

Thanks in advance!


Brucey(Posted 2008) [#2]
To be highlighted by MaxIDE the types/functions need to have

Rem
bbdoc: ...
End Rem

above the line defining the type/function.
Then, after a documentation rebuild, those types/functions should show up with the syntax colouring.

Usually also, the module definition itself needs the same bbdoc comment for the rest of that module to be included.


tonyg(Posted 2008) [#3]
Does this help?


Yahfree(Posted 2008) [#4]
Hey brucey, I've noticed that none of the functions in Wxmax (that i've used) have syntax highlighting, though some types do...

Any reason why?

Also, all the functions i can see in MiniB3D have syntax highlighting, why the difference?


Brucey(Posted 2008) [#5]
There aren't many functions in wxMax.

If you mean methods inside of types, those aren't highlighted. I'm guessing, because the MaxIDE doesn't lexer doesn't understand Types/methods/fields/functions - insofar as determining that method A belongs to type B...

The functions that are in wxMax, which aren't in types, all highlight okay this side.


Matthew Smith(Posted 2008) [#6]
The 'command' list which is used for syntax highlighting and help integration is all basic on what Brucey identified above - the bbDoc tag.

One of the great strengths but also weaknesses of the system. Makes it very flexible, but the mod dev needs to document everything.


Yahfree(Posted 2008) [#7]
Yeah, thanks guys, I've successfuly gotten functions and types to highlight.

What about module names? I've documented right before I delare "Module ...." still doesnt highlight (I know brucey does this with alot of his wx mods)


plash(Posted 2008) [#8]
If your using BLIde you probably have to recache. (in maxide I don't think modules names highlight)


grable(Posted 2008) [#9]
What about module names? I've documented right before I delare "Module ...." still doesnt highlight (I know brucey does this with alot of his wx mods)

I dont know of a direct way, but you can fake it by highlighting the individual keywords.
Rem
bbdoc: Blitz Research modules
keyword: BRL

bbdoc: BlitzMax runtime
keyword: Blitz
EndRem



ziggy(Posted 2008) [#10]
On BLIde you can activate the 'complete modules hilighting' option and you'll get all the public identifiers on a module hilighted properly without any performance cost, and without the need of rebuild anything or change any module source code. This can be done becouse the BLIde parser is... mmm... FAST!!!


Eric(Posted 2009) [#11]
Sorry to bring up this old thread but is there a way to add syntax highlighting to a module that has no docs? Maybe a Module that is nothing but documents?

Thanks,
Eric