Skip to content

Commit 9af0a6b

Browse files
committed
Use nested markdown grammar for highlighting docstrings
This uses the "inline" version of the markdown grammar. https://github.com/MDeiml/tree-sitter-markdown see issue #18
1 parent 881756c commit 9af0a6b

File tree

4 files changed

+260
-195
lines changed

4 files changed

+260
-195
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- (See treesit-font-lock-level documentation for more information.)
99
- Highlight docstrings in interface, protocol, and variable definitions
1010
- Add support for semantic indentation (now the default)
11+
- Highlight "\`quoted-symbols\` in docs strings like this."
12+
- This feature uses a nested markdown parser.
13+
If the parser is not available this feature should be silently disabled.
1114

1215
## 0.1.5
1316

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ git clone https://github.com/clojure-emacs/clojure-ts-mode.git
106106

107107
Once installed, evaluate clojure-ts-mode.el and you should be ready to go.
108108

109-
### Install libtree-sitter-clojure shared library
109+
### Install tree-sitter grammars
110+
111+
The compile tree-sitter clojure shared library must be available to Emacs.
112+
Additionally, the tree-sitter [markdown_inline](https://github.com/MDeiml/tree-sitter-markdown) shared library will also be used for docstrings if available.
110113

111-
The tree-sitter clojure shared library must be available to Emacs.
112114
If you have `git` and a C compiler (`cc`) available on your system's `PATH`, **then these steps should not be necessary**.
113-
clojure-ts-mode will install the grammar when you first open a Clojure file.
115+
clojure-ts-mode will install the grammars when you first open a Clojure file and
116+
`clojure-ts-ensure-grammars` is set to `t` (the default).
114117

115118
If clojure-ts-mode fails to automatically install the grammar, you have the option to install it manually.
116119

@@ -120,7 +123,9 @@ Some distributions may package the tree-sitter-clojure grammar in their package
120123
If yours does you may be able to install tree-sitter-clojure with your system package manager.
121124

122125
If the version packaged by your OS is out of date, you may see errors in the `*Messages*` buffer or your clojure buffers will not have any syntax highlighting.
123-
If this happens you should install the grammar manually with `M-x treesit-install-language-grammar <RET> clojure`.
126+
127+
If this happens you should install the grammar manually with `M-x treesit-install-language-grammar <RET> clojure` and follow the prompts.
128+
Recommended values for these prompts can be seen in `clojure-ts-grammar-recipes`.
124129

125130
#### Compile From Source
126131

0 commit comments

Comments
 (0)