-
-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highlight occurrences of symbols and alias usages #1461
Comments
@Malabarba Sounds like something that'd be a nice addition for |
Shouldn't be hard at all. We could implement this (and a number of other useful feedback) with an idle-timer. |
I'm not even sure if we need cider for this. Could possibly go into clojure-mode. |
We can't use |
Do you mean for |
Anyway, I think this would go better in cider too. |
hi-lock-mode works fine for straight-up symbol hilights – so potentially no need to re-invent anything there. It's really the alias case I'm after :-) |
|
I wonder how to be best approach this - perhaps we should just look for symbols that are the same in the buffer and try to resolve them to see if they are a match or not. This will be simple, but it probably won't be very efficient. |
My first thought is "what do we want to highlight?".
|
Agreed. Although for vars it makes some sense to highlight them in the entire namespace. Guess this can be configurable.
Exactly - normally this would happen automatically, but we can add some command about sticky highlighting. The stuff with teaching the users is easy - if we do it by the 11th I'll include it my next CIDER presentation. :-) We can use our metadata handling functionality to easily highlight some vars, but I'm so sure what we can do about the locals. |
Yeah, we can pretty reliably highlight vars thanks to the state tracker. But we can highlight locals semi reliably too, thanks to the code we already have that prevents dynamic font locking of locals. |
Sounds like a plan to me. Would you volunteer to tackle this? :-) |
I'll keep it in mind, but I don't think I'll have time for it before the 11th. :-( |
No problem. I might do a lightning talk at ClojureD a couple of weeks later. ;-) |
@Malabarba any chance you can take a stab at this in the foreseeable future? |
I still think it would be nice to have, and I've decided to get back to OSS this week, but this specific issue is not my topmost priority so it may take me a while. :) |
OK. It's definitely not urgent. It'd be nice to see more of you in the realm of CIDER. :-) I haven't been doing much OSS work myself lately. Had some pretty quiet months since April, hopefully I'll be able to do more OSS work until the end of the year. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding! |
This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it. |
For anyone who finds they way here, like I did, I'll save you a little time and link to a package that does this the "dumb" way. |
When I place my cursor on a def'd var or a local symbol, I use https://www.gnu.org/software/emacs/manual/html_node/emacs/Highlight-Interactively.html with a custom
idle-highlight
face colour to colourise the background of all the occurrences of that symbol.It would be great if CIDER could support this natively, and also support the highlighting of all the places where a required alias is used.
For example I point at
str
in[clojure.string :as str]
, and it highlights all the occurrences ofstr/<something>
in the file.The text was updated successfully, but these errors were encountered: