Selective Highlighting with your language def file

SyntaxEditor for Windows Forms Forum

Posted 13 years ago by Jerry
Version: 3.1.0213
Avatar
I am highlighting variables when they define a variable in the code. I do this by dynamically changing the loaded language def file. Problem: Global variables need to be highlight through out the code. This works great with this approach, but for variables defined in a given function they also are highlighted through out all the code. They should only be highlighted in that function. Is there a way to do this?

Thanks

Jerry

Dim A

A=A + 1 'A should be highlighted through out the code

B=B+1 'B will show highlighted with the current way I am highlighting it

Function Test
Dim B  'B should only be highlighted in Function Test
B=B+A
end Function

Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jerry,

Microsoft somehow does that sort of thing in Visual Studio with how Types are highlighted in cyan. The only way we can think about doing it is to somehow merge the semantic parse results with the lexical parser. So maybe in your semantic parser, set a custom HighlightingStyle to the tokens in those functions when a variable name is found. In v3.1, Token.CustomHighlightingStyle I believe is what lets you do that.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 9 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.