File tree Expand file tree Collapse file tree 7 files changed +101
-1
lines changed
web/src/routes/docs/integrations/language-server Expand file tree Collapse file tree 7 files changed +101
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ tree-sitter-swift = "0.7.1"
35
35
tree-sitter-toml-ng = " 0.7.0"
36
36
tree-sitter-typescript = " 0.23.2"
37
37
harper-tree-sitter-dart = " 0.0.5"
38
+ tree-sitter-clojure = " 0.1.0"
38
39
39
40
[dev-dependencies ]
40
41
paste = " 1.0.15"
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ impl CommentParser {
46
46
"toml" => tree_sitter_toml_ng:: LANGUAGE ,
47
47
"typescriptreact" => tree_sitter_typescript:: LANGUAGE_TSX ,
48
48
"typescript" => tree_sitter_typescript:: LANGUAGE_TYPESCRIPT ,
49
+ "clojure" => tree_sitter_clojure:: LANGUAGE ,
49
50
_ => return None ,
50
51
} ;
51
52
@@ -105,6 +106,7 @@ impl CommentParser {
105
106
"toml" => "toml" ,
106
107
"ts" => "typescript" ,
107
108
"tsx" => "typescriptreact" ,
109
+ "clj" | "cljs" | "cljc" | "bb" => "clojure" ,
108
110
_ => return None ,
109
111
} )
110
112
}
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ create_test!(ignore_shebang_3.sh, 0);
58
58
create_test ! ( ignore_shebang_4. sh, 1 ) ;
59
59
create_test ! ( common. mill, 1 ) ;
60
60
create_test ! ( basic_kotlin. kt, 0 ) ;
61
+ create_test ! ( basic. clj, 12 ) ;
61
62
62
63
// Checks that some comments are masked out
63
64
create_test ! ( ignore_comments. rs, 1 ) ;
Original file line number Diff line number Diff line change
1
+ (ns clean
2
+ " It is actually possible to document a ns.
3
+ It's a nice place to describe the purpose of the namespace and maybe even
4
+ the overall conventions used. Note how _not_ indenting the docstring makes
5
+ it easier for tooling to display it correctly." )
6
+
7
+ ; ;;; Section Comment/Heading
8
+
9
+ ; ;; Foo...
10
+ ; ;; Bar...
11
+ ; ;; Baz...
12
+
13
+ ; ; good
14
+ (defn foo
15
+ " This funtion doesn't do much."
16
+ []
17
+ nil )
18
+
19
+ ; ; bad
20
+ (defn bar
21
+ ^{:doc " This function doesn't do much." }
22
+ []
23
+ nil )
24
+
25
+ ; ; good
26
+ (defn qzuf-number
27
+ " Computes the [Qzuf number](https://wikipedia.org/qzuf) of the `coll`.
28
+ Supported options in `opts`:
29
+
30
+ | key | description |
31
+ | --------------|-------------|
32
+ | `:finite-uni?`| Assume finite universe; default: `false`
33
+ | `:complex?` | If OK to return a [complex number](https://en.wikipedia.org/wiki/Complex_number); default: `false`
34
+ | `:timeout` | Throw an exception if the computation doesn't finish within `:timeout` milliseconds; default: `nil`
35
+
36
+ Example:
37
+ ```clojure
38
+ (when (neg? (qzuf-number [1 2 3] {:finite-uni? true}))
39
+ (throw (RuntimeException. \" Error in the Universe!\" )))
40
+ ```"
41
+ [coll opts]
42
+ nil )
43
+
44
+ (defprotocol MyProtocol
45
+ " MyProtocol docstring"
46
+ (foo [this x y z]
47
+ " foo docstring" )
48
+ (bar [this]
49
+ " bar docstring" ))
50
+
51
+ ; ; good
52
+ (defn some-fun
53
+ []
54
+ ; ; FIXME: This has crashed occasionally since v1.2.3. It may
55
+ ; ; be related to the BarBazUtil upgrade. (xz 13-1-31)
56
+ #_ (baz ))
57
+
58
+ ; ;;; Frob Grovel
59
+
60
+ ; ;; This section of code has some important implications:
61
+ ; ;; 1. Foo.
62
+ ; ;; 2. Bar.
63
+ ; ;; 3. Baz.
64
+
65
+ (defn fnord [zarquon]
66
+ ; ; If zob, then veeblefitz.
67
+ (quux zot
68
+ mumble ; Zibblefrotz.
69
+ frotz))
70
+
71
+ (defn foo [x]
72
+ x ; I'm a line/code fragment comment.
73
+ )
74
+
75
+ ; ;; I'm a top-level comment.
76
+ ; ;; I live outside any definition.
77
+
78
+ (defn foo [])
79
+
80
+ (def ^{:deprecated " 0.5" } foo
81
+ " Use `bar` instead."
82
+ 42 )
Original file line number Diff line number Diff line change 53
53
" onLanguage:toml" ,
54
54
" onLanguage:typescript" ,
55
55
" onLanguage:typescriptreact" ,
56
- " onLanguage:typst"
56
+ " onLanguage:typst" ,
57
+ " onLanguage:clojure"
57
58
],
58
59
"main" : " ./build/extension.js" ,
59
60
"contributes" : {
Original file line number Diff line number Diff line change @@ -289,6 +289,7 @@ These configs are under the `markdown` key:
289
289
| TypeScript React | ` typescriptreact ` | ✅ |
290
290
| Typst | ` typst ` | |
291
291
| Kotlin | ` kotlin ` | ✅ |
292
+ | Clojure | ` clojure ` | ✅ |
292
293
293
294
Want your language added?
294
295
Let us know by [ commenting on this issue] ( https://github.com/Automattic/harper/issues/79 ) .
You can’t perform that action at this time.
0 commit comments