I would like to highlight an object as a keyword but also allow for a method call to be appended to the end of the keyword (using the dot notation). I got this to work for my Java documents, but I don't know how I did it.
eg. The keyword "System" to remains highlighted in:
System.out.println("Hello world");
I want to know how I got this to work before (in Java) so I can apply it to my other documents (VB).
Syntax highlighting an object in a method call
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Re: Syntax highlighting an object in a method call
I got around this problem (for ASP objects) by adding new keywords to the snytax file. In your case you would need
System
System.exit
System.out
System.out.err
System.out.println
You may need to allow for the period in your keywords, but I've found this can work.
However, I would like to add support for syntax highlighting for methods in all class instances - I thought I could do this by adding a period in front of the key words I want to be highlighted as methods, however this does not work.
.Add
.Close
.Delete
The idea being that ".close" in this line would be hightlighted (asp)
myfile.Close
The best I can do is to remove the period from the keyword, but that leaves them uncolored. Any ideas?
System
System.exit
System.out
System.out.err
System.out.println
You may need to allow for the period in your keywords, but I've found this can work.
However, I would like to add support for syntax highlighting for methods in all class instances - I thought I could do this by adding a period in front of the key words I want to be highlighted as methods, however this does not work.
.Add
.Close
.Delete
The idea being that ".close" in this line would be hightlighted (asp)
myfile.Close
The best I can do is to remove the period from the keyword, but that leaves them uncolored. Any ideas?