- Notifications
You must be signed in to change notification settings - Fork18
Fix semantic indentation of quoted functions#49
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
clojure-ts-mode.el Outdated
| "Return non-nil if NODE is a Clojure keyword." | ||
| (string-equal"kwd_lit" (treesit-node-type node))) | ||
| (defunclojure-ts--quoted-var-node-p (node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think the right terminology here isvar-quoted-node. That's because you can also have the standard quoting with'.
clojure-ts-mode.el Outdated
| (string-equal"kwd_lit" (treesit-node-type node))) | ||
| (defunclojure-ts--quoted-var-node-p (node) | ||
| "Return non-nil if NODE is a Clojure quoted." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Clojure -> var-quoted
| (clojure.core/filter even? | ||
| (range110)) | ||
| (#'filter even? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I the indentation OK if it was just'filter? Also it might be good to change the example to make more sense in the context of quoting being used.
rschmuklerJul 26, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I am not sure how'filter should indent. Specifically, the reason I think a quotedvar should indent like this, is because it implements'IFn (ie. it can be called) while a symbol doesn't. Let me know if you agree with this. On the others, happy to change the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yeah, I'm OK with this.
rschmukler commentedJul 26, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@bbatsov Upon thinking about this further, I think that the proper name should actually be
I think calling it anything else will be a bit confusing since it is technically a variable... ie: (type #'filter);; => clojure.lang.Variable I have updated the PR with these changes, but I am also happy to change it to whatever you want. Let me know! |
rschmukler commentedJul 31, 2024
@bbatsov just pinging you on this. No rush, just a reminder :) |
bbatsov commentedOct 26, 2024
@rschmukler Sorry about me dropping the ball on this earlier. You'll need to rebase on |
rschmukler commentedNov 3, 2024
@bbatsov rebased and ready to go 👍 |
bbatsov commentedNov 3, 2024
Can you please address the small lint error that's causing the lint check to fail? Also - now that we have some unit tests (see#57), you might want to add one covering your change. |
rschmukler commentedNov 3, 2024
@bbatsov the PR is updated with listing passing. I tried to make the tests run and added (what I thought was an appropriate case to However when I run |
bbatsov commentedNov 3, 2024
Those are the actual tests that we currently runhttps://github.com/clojure-emacs/clojure-ts-mode/blob/main/test/clojure-ts-mode-indentation-test.el The ones in the other folder need to be ported to the new test suite. |
rschmukler commentedNov 3, 2024
Got it! Thanks for the explanation and sorry for missing that. Updated the test suite to include a unit test for this. |
bbatsov commentedNov 3, 2024
Hmm, seems that on Emacs snapshot there's a load error for the test file. |
Fixes an error where quoted functions would not align correctly withsemantic indentation.Adds an example test and updates the changelog
rschmukler commentedNov 4, 2024
Sorry about that, should be good now |
3ca382c intoclojure-emacs:mainUh oh!
There was an error while loading.Please reload this page.
bbatsov commentedNov 4, 2024
Thanks! |
Fixes an error where quoted functions would not align correctly with semantic indentation. Adds an example to the test sample.
Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):
M-x checkdocand fixed any warnings in the code you've written.Thanks!