-
Notifications
You must be signed in to change notification settings - Fork 15
Incorrect indentation / fontification after metadata forms #61
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
Comments
Likely the metadata is not considered in the existing TS queries. I'll take a look when I can. |
(The Paredit navigation issue is probably related to #62, and not directly to this) |
This should be fixed by #66 |
Regarding indentation, I can fix that, but I'm not sure if it will be correct. The value with metadata is a single node, it looks like this in the syntax tree:
And it seems logical to me that metadata and value are aligned vertically (there is a rule defined in the code specifically for that). (def x
[a b [c ^:foo
d
e]]) Are there any guidelines about this indentation? |
That might be more logical, but other formatters like cljfmt / zprint / standard-clojure-style don't behave this way, so it's probably better to follow the status quo. This situation turns out to be fairly common once you consider type hints and metadata on |
Thanks for the examples @yuhan0. I've also found some issues with syntax highlighting related to metadata presence. I'll create a PR with all fixes soon. |
…tadata - Collection elements (except of lists) are properly indented. - Body of special forms when the entire form has metadata is properly indented. - Additionally fix syntax highlighting of special forms when the entire form has metadata.
…tadata - Collection elements (except of lists) are properly indented. - Body of special forms when the entire form has metadata is properly indented. - Additionally fix syntax highlighting of special forms when the entire form has metadata.
…tadata - Collection elements (except of lists) are properly indented. - Body of special forms when the entire form has metadata is properly indented. - Additionally fix syntax highlighting of special forms when the entire form has metadata.
…tadata - Collection elements (except of lists) are properly indented. - Body of special forms when the entire form has metadata is properly indented. - Additionally fix syntax highlighting of special forms when the entire form has metadata.
- Collection elements (except of lists) are properly indented. - Body of special forms when the entire form has metadata is properly indented. - Additionally fix syntax highlighting of special forms when the entire form has metadata.
Expected:
Metadata forms
^:foo
/^{:foo 123}
should not affect indentation of the following formsActual:
Some font-locking of the following form also appears to be affected:
Typing a closing delimiter with Paredit (
paredit-close-curly
) can also cause the point to jump to the wrong position:The text was updated successfully, but these errors were encountered: