Skip to content

Switch to experimental Clojure grammar #99

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

Merged
merged 5 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
- [#96](https://github.com/clojure-emacs/clojure-ts-mode/pull/96): Highlight function name properly in `extend-protocol` form.
- [#96](https://github.com/clojure-emacs/clojure-ts-mode/pull/96): Add support for extend-protocol forms to `clojure-ts-add-arity` refactoring
command.
- [#99](https://github.com/clojure-emacs/clojure-ts-mode/pull/99): Improve navigation by s-expression by switching to an experimental
Clojure grammar.
- [#99](https://github.com/clojure-emacs/clojure-ts-mode/pull/99): More consistent docstrings highlighting and `fill-paragraph` behavior.
- [#99](https://github.com/clojure-emacs/clojure-ts-mode/pull/99): Fix bug in `clojure-ts-align` when nested form has extra spaces.
- [#99](https://github.com/clojure-emacs/clojure-ts-mode/pull/99): Fix bug in `clojure-ts-unwind` when there is only one expression after
threading symbol.

## 0.4.0 (2025-05-15)

Expand Down
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,15 @@ Once installed, evaluate `clojure-ts-mode.el` and you should be ready to go.
> `clojure-ts-mode` install the required grammars automatically, so for most
> people no manual actions will be required.

`clojure-ts-mode` makes use of two Tree-sitter grammars to work properly:
`clojure-ts-mode` makes use of the following Tree-sitter grammars:

- The Clojure grammar, mentioned earlier
- [markdown-inline](https://github.com/MDeiml/tree-sitter-markdown), which
will be used for docstrings if available and if `clojure-ts-use-markdown-inline` is enabled.
- The [experimental](https://github.com/sogaiu/tree-sitter-clojure/tree/unstable-20250526) version Clojure grammar. This version includes a few
improvements, which potentially will be promoted to a stable release (See [the
discussion](https://github.com/sogaiu/tree-sitter-clojure/issues/65)). This grammar is required for proper work of `clojure-ts-mode`.
- [markdown-inline](https://github.com/MDeiml/tree-sitter-markdown), which will be used for docstrings if available and if
`clojure-ts-use-markdown-inline` is enabled.
- [tree-sitter-regex](https://github.com/tree-sitter/tree-sitter-regex/releases/tag/v0.24.3), which will be used for regex literals if available and if
`clojure-ts-use-regex-parser` is not `nil`.

If you have `git` and a C compiler (`cc`) available on your system's `PATH`,
`clojure-ts-mode` will install the
Expand All @@ -136,8 +140,14 @@ set to `t` (the default).

If `clojure-ts-mode` fails to automatically install the grammar, you have the
option to install it manually, Please, refer to the installation instructions of
each required grammar and make sure you're install the versions expected. (see
`clojure-ts-grammar-recipes` for details)
each required grammar and make sure you're install the versions expected (see
`clojure-ts-grammar-recipes` for details).

If `clojure-ts-ensure-grammars` is enabled, `clojure-ts-mode` will try to upgrade
the Clojure grammar if it's outdated. This might happen, when you activate
`clojure-ts-mode` for the first time after package update. If grammar was
previously installed, you might need to restart Emacs, because it has to reload
the grammar binary.

### Upgrading Tree-sitter grammars

Expand Down
Loading
Loading