Open f1nalspace opened 5 years ago
You ever get this working? I'm also curious to see how your GetCommentMatches() works.
You ever get this working? I'm also curious to see how your GetCommentMatches() works.
Initially i was using pure regex to detect the comments blocks, which may contain doxygen commands.
But now i am fully switched to a 100% custom lexing & parsing of C/C++/Doxygen/Html - which means i just use "Container" for everything and never use any integrating lexers nor styles.
Regarding your actual question, detecting the comment matches are easy - you need to find all comment blocks, on every change and save the regions in a list or something. GetCommentMatches() iterates from all blocks and does simple start/length lookup to search for intersections. Thats it.
I am trying to use multiple lexers inside StyleNeeded, but as soon as i use the second lexer the styles gets overriden from the previous one.
What i basically want is to call Cpp lexer, then call Html lexer for specific ranges, then do a custom lexer and lastly do Cpp lexer again for special ranges. Its the same process like doing PHP with HTML - but with more layers. Unfortunatly the Styles[] array seems to be persistent and the indices for each language always start at zero (Default) as well, meaning that Style.Cpp.Default is the same as Style.Html.Default.
Is there a way around that? Can i add a style offset of some sort - so it gets unique for each language?
Currently i have this, which only works for one lexer and one custom lexer :-(
I dont want to write the lexers myself, because each lexer by itself works beutifully.