I think it would be a small but very nice enhancement. I have no idea how hard it might to implement using the current syntax highlighters.
It be a lot of work....
It's one think if you only look at the current unit. And maybe even ignore scope. So you
"just" have to look up the previous instance of the identifier (and parse it's context and value).
Of course even then, that would already be a "mini codetools" (and then why re-invent the wheel, there is a big codetools already).
No scope:
const foo=1
procedure bar; const foo='a'; begin end;
procedure abc; begin write(foo); end; // to find the number it needs scope
- and in a method of a class, it could be a const defined in the class
- it could be in an include
- it could be in an ifdef
- it could be in a different unit
- ...
But even in the one unit, no scope it does not fit the idea of the current highlighter.
The highlighter must be able to perform minimum work to update on every keystroke. And searching for definitions like the above on every key stroke is not a good idea.
Something like this must update on idle, and apply on top of highlighting. And that is why it is a lot of work. It needs to be written from scratch (SynEdit has the Markup concept as a place to plug it in, but the actual lookup and applying needs to be done...)
And if it uses codetools, even on idle, it would be good (but not mandatory) if it could run in a thread. Otherwise if it starts the users next key stroke could be processed with some noticeable lag. Though probably ok without threading.... Just icing of the cake.
Also dependency on codetools (or some similar tool) means, that it probably only works for (mostly) error free code. Code below the current edit may not show correct colors. (because if e.g. begin/end are not matching up then codetools will give up / and there are probably reasons for that making it complex to change)