Bulit in support for highlighting variables?

Post a reply

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: Bulit in support for highlighting variables?

Re: Bulit in support for highlighting variables?

Post by omadawn » Sun Aug 19, 2012 7:54 pm

Ok, I implemented a document listener to do some updates on my nav tree and it was actually pretty simple. Guess I was nervous for nothing. I probably looked at that when I was first figuring out the swing stuff and just didn't want to have to override yet another swing method. TY again.

Re: Bulit in support for highlighting variables?

Post by omadawn » Sat Aug 18, 2012 12:07 am

I was hoping that RSTA would have some easier function that would solve my problem like it seems to for nearly everything else that I'm doing. ^_^ I was hoping to not have to resort to a documentListener I briefly looked at implementing one of those and it didn't seem as simple as most of what I've been able to do w/ RSTA.

TY.

Re: Bulit in support for highlighting variables?

Post by robert » Fri Aug 10, 2012 12:40 pm

Swing has javax.swing.text.DocumentListener which allows you to get notified when the Document of a text component is modified. That's probably what you'd want to use.

Re: Bulit in support for highlighting variables?

Post by omadawn » Tue Aug 07, 2012 9:24 pm

I went through the javadocs looking but hadn't seen anything so I didn't think so. I was just hoping. I figured if it existed it would be language specific and was hoping there was a '.setHighlightUserVariables(boolean)' method on the built in syntax schemes or something I could enable. ^_^

Since it's TCL based and TCL does us the courtesy of using set in front of the creation of variables I suppose I could extend the tokenMaker (Now that I know how. Thank you again) and implement this myself.

Do you have any reasonably straight forward recommendations for how I'd trigger that? IE based on a 'text changed' event or is there some more appropriate event that I should go off in order to avoid seriously bogging down my code?

Re: Bulit in support for highlighting variables?

Post by robert » Mon Aug 06, 2012 3:35 am

Unfortunately, there's no built-in support for this. Such a feature really requires semantic knowledge of the language being highlighted, and thus is very language-specific.

Bulit in support for highlighting variables?

Post by omadawn » Sat Aug 04, 2012 2:56 am

Is there built in support for highlighting variables in languages which do not use any special designator like $? Languages like Java and TCL.

I've seen some comments on how to generate a completion provider if you want autocompletion for variables you've declared but didn't see anything on simply highlighting them.

Thanks

Top