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
CIDER is not font-locking required vars #1985
Comments
That's odd. I don't recall any changes to this code after @Malabarba wrote it originally. But your assumption sounds correctly - likely a regexp issue. |
@dpsutton Any update here? |
The best that I can find here is that this is a bug in emacs font locking with the |
I played around with this today, because I really want it to work. It seems to be caused by clojure-mode, which font locks the namespace part. https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L840
If I comment that out, it starts working. But I don't know where to go from here to produce a good solution. I hardly know anything about font locking. By the way, things defined with |
Fixing this is kind of annoying, I think. The problem stems from the fact that the font locking is essentially complex. Clojure-mode has a long list of things that it checks for, and the order matters. We want to essentially remove one (or perhaps even two, because there is a rule that says anything starting with 'def', 'with' or 'let' should be colored as macros) element from clojure-mode's As far as I can see, there are a couple of solutions, none of which is great.
If I had to decide I would chose 1. But maybe someone has a better idea? |
One pretty good idea would perhaps be to add an option in clojure-mode to disable those rules that interact badly with CIDER's dynamic font locking. What do you guys think? |
I think it might be easiest to just modify the There might be some better solution as well, but I don't have time to look into this myself. I wrote this ns font-locking code way before CIDER had this feature and because many people use Clojure mode without CIDER I don't think it's a good idea to just remove it. |
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. |
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. |
Expected behavior
CIDER font locks vars and functions from the current namespace and clojure.core functions and vars. It should also font-lock imported vars from your own namespace. But it does not.
Actual behavior
It fails to font-lock functions required from other namespaces.
Note that
(i/bar x)
is not font-locked.This behavior is controlled by
cider--dynamic-font-lock-keywords
Steps to reproduce the problem
Minimum example is found at https://github.com/dpsutton/font-lock-bug
But make your namespace as small as possible and import a namespace with only a single function in it. I also changed this so it wasn't adding clojure.core, just for making the regex easier to watch. This function is in
cider-refresh-dynamic-font-lock
incider-mode.el
. and just pass in'()
instead of the core namespace.Environment & Version information
CIDER version information
latest snapshot
Lein/Boot version
a good lein
Emacs version
tip of master
Operating system
fedora 25
The text was updated successfully, but these errors were encountered: