-
Notifications
You must be signed in to change notification settings - Fork 6
Keyword and Symbol prefix matching #27
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
Conversation
Excellent! Thanks for this. I will take a look at it (and test it) in the next few days and hopefully we can get it merged soon.
(Also the syntax tests are failing, but as they are still quite complicated, I'm happy to fix them for you once I test it myself and confirm that this PR is good and won't require additional changes.)
I didn't know about syntax tests, oops :D Probably it's described in the README but I didn't read most of it.
And I also didn't add the namespace matching for Clojure's symbols so probably that may need to be added too.
I fixed tests.
This PR is related to #24
aae8a4d
to
680cb69
Compare
(削除) I tried to use my fork to preview the colors for myself and for some reason I can't set the color for clojureKeywordNs
. Is it that the default somehow interferes? (削除ここまで)
Edit: Found that I used a theme package that had old themes
I found that I had messed up the tests so I fixed them by editing the test macro.
I made it so that I could use that macro to do equality checks, not only the "collection-contains" checks as it was used before.
And one more problem that I face is that I can't greedily match :
without introducing two keyword syntax regions. I don't know how to fix this. See tests and look for :clojureKeywordNsColon :clojureKeywordNsColon
.
It also decides to split the keyword into many parts and that's also bad. Not greedy enough.
ba2e122
to
11c5478
Compare
Not sure why but the variant that I use breaks the parens when I change colorschemes:
image
Probably that could mean that namespace regex should include parens as keyword/symbol regex does.
Well it doesn't work this way from the start and since I don't change the colorschemes it doesn't come up anymore. Weird. Probably artifact of changing the colors.
Recent fixes allow for this matching (when (
is starting but the keyword is touching it (the cursor is on the w
in :keyw
)):
image
I also think that it would be a good thing to refactor custom testing macros (at least in keyword and symbol matching) into clojure.test/are
so that there wouldn't be a need to define every match expression as a variable.
Something's glitched on GitHub's PR checks, it won't run the CI again :( so I can't merge through the UI.
I'll merge it manually.
Merged. Thank you for working on this! Also see: #24 (comment)
Uh oh!
There was an error while loading. Please reload this page.
This adds prefix matching to the keywords and symbols but not to namespaced functions (I may add this later, not sure how yet)
The default highlighting is not too obtrusive (it's possible to match symbol's and keyword's namespace but they're left to be the same as the item itself (symbol is white-on-white in this colorscheme as it's regarded to as Normal already)):
image