Skip to content
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 clojure.test macros #25

Open
Invertisment opened this issue Aug 6, 2022 · 7 comments
Open

Highlight clojure.test macros #25

Invertisment opened this issue Aug 6, 2022 · 7 comments
Labels
highlighting Affects syntax highlighting

Comments

@Invertisment
Copy link
Contributor

I import them frequently and probably everyone does. It would probably be a good idea.

I think this should work but I don't know why it doesn't work (also you use a generator and probably don't even need this):

syntax keyword clojureTestMacro deftest is
highlight link clojureTestMacro clojureMacro
@axvr
Copy link
Member

axvr commented Aug 8, 2022

I believe highlighting of clojure.test was intentionally left out in vim-clojure-static, but I can't remember the reason for it. Although I do agree that it would make sense to add it. I'll think about if/how to do it...

@Invertisment
Copy link
Contributor Author

I actually think that functions shouldn't be highlighted at all. This way they would be consistent. So I don't really understand why would one want to highlight the stdlib. I haven't seen this for Java or JS. Probably it would be better to highlight the first symbol of an unquoted list instead. But you already do highlight symbols.
Also I'm not sure why would one highlight stdlib macros too.

@axvr
Copy link
Member

axvr commented Aug 8, 2022

That is something I've been considering too. I definitely agree (+ it would make the code much simpler) but I'm just not sure what the majority of users prefer...

Perhaps if there were config option to turn on/off special highlighting of clojure.core functions?

@SevereOverfl0w
Copy link
Member

The reason to highlight differently is because it lets us identify which calls are macros (equivalent to java's built-ins) and which are functions.

Clojure makes them syntactically identical other languages do not.

@Invertisment
Copy link
Contributor Author

Invertisment commented Aug 8, 2022

It's fine if we can detect the macro, then we can highlight it. But this plugin doesn't detect macros -- instead it has a hardcoded list of keywords that I can redefine to be whatever I want.
I think that CIDER doesn't do that too. It does highlight the deftest when I start the REPL but it doesn't highlight -> and or 🤔

@Invertisment
Copy link
Contributor Author

Is it possible to highlight macros according to a value of a global variable that would be changed by a third party plugin? 🤔

@SevereOverfl0w
Copy link
Member

I believe there are plugins which do exactly that, https://github.com/guns/vim-clojure-highlight and its various forks.

@axvr axvr added the highlighting Affects syntax highlighting label Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
highlighting Affects syntax highlighting
Projects
None yet
Development

No branches or pull requests

3 participants