Skip to content

Commit dcc2b32

Browse files
Update to new zed API
1 parent ccc01cf commit dcc2b32

9 files changed

Lines changed: 577 additions & 115 deletions

File tree

Cargo.lock

Lines changed: 512 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ license = "MIT"
99
crate-type = ["cdylib"]
1010

1111
[dependencies]
12-
zed_extension_api = "0.1.0"
12+
zed_extension_api = "0.7.0"

extension.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
id = "cfml"
22
name = "CFML"
33
description = "CFML support."
4-
version = "0.2.0"
5-
schema_version = 1
4+
version = "0.2.1"
5+
schema_version = 2
66
authors = ["Gareth Edwards <ghedwards@gmail.com>"]
77
repository = "https://github.com/cfmleditor/zed-cfml"
88

99
[grammars.cfhtml]
1010
repository = "https://github.com/cfmleditor/tree-sitter-cfml"
11-
rev = "66bb2ba2bda0c1c006d75221824a338550222e2c"
11+
rev = "ea862a679d64be7c9c421d8e0c7d2e93fc83f67a"
1212
path = "./cfhtml"
1313

1414
[grammars.cfml]
1515
repository = "https://github.com/cfmleditor/tree-sitter-cfml"
16-
rev = "66bb2ba2bda0c1c006d75221824a338550222e2c"
16+
rev = "ea862a679d64be7c9c421d8e0c7d2e93fc83f67a"
1717
path = "./cfml"
1818

1919
[grammars.cfscript]
2020
repository = "https://github.com/cfmleditor/tree-sitter-cfml"
21-
rev = "66bb2ba2bda0c1c006d75221824a338550222e2c"
21+
rev = "ea862a679d64be7c9c421d8e0c7d2e93fc83f67a"
2222
path = "./cfscript"
2323

2424
[grammars.cfquery]
2525
repository = "https://github.com/cfmleditor/tree-sitter-cfml"
26-
rev = "66bb2ba2bda0c1c006d75221824a338550222e2c"
26+
rev = "ea862a679d64be7c9c421d8e0c7d2e93fc83f67a"
2727
path = "./cfquery"

extension.wasm

234 KB
Binary file not shown.

languages/cfhtml/highlights.scm

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
; Document and structure (from Lucee-style rules)
2-
(program) @document
3-
(doctype) @doctype
1+
(doctype) @constant
42
(entity) @constant
5-
(html_text) @text
63

7-
(erroneous_end_tag_name) @tag.error
8-
(erroneous_cf_end_tag_name) @tag.error
4+
(erroneous_end_tag_name) @tag
5+
(erroneous_cf_end_tag_name) @tag
96
(attribute_name) @attribute
107
(cf_attribute_name) @attribute
118
(attribute_value) @string
12-
(raw_text) @embedded
139
(start_tag) @tag
1410
(end_tag) @tag
1511
(self_closing_tag) @tag
@@ -35,7 +31,7 @@
3531
(identifier) @variable
3632

3733
; CFML scopes (variables, session, etc.)
38-
(cf_scope_identifier) @namespace
34+
(cf_scope_identifier) @variable.special
3935

4036
; Properties
4137
;-----------
@@ -48,7 +44,7 @@
4844
;--------------------------------
4945

5046
(function_expression
51-
name: (identifier) @function) @definition.function
47+
name: (identifier) @function)
5248

5349
(function_declaration
5450
name: (identifier) @function)
@@ -77,7 +73,7 @@
7773
key: (property_identifier) @function.method
7874
value: (arrow_function))
7975

80-
(array) @expression
76+
(array) @variable
8177

8278
(cf_set_tag) @tag
8379

@@ -111,23 +107,23 @@
111107
;--------------------------
112108

113109
(call_expression
114-
function: (identifier) @function.call)
110+
function: (identifier) @function)
115111

116112
(call_expression
117113
function: (member_expression
118114
property: [
119115
(property_identifier)
120116
(private_property_identifier)
121-
] @function.method.call))
117+
] @function.method))
122118

123119
; Literals
124120
;---------
125121

126-
((identifier) @variable.builtin
127-
(#eq? @variable.builtin "self"))
122+
((identifier) @variable.special
123+
(#eq? @variable.special "self"))
128124

129-
(this) @variable.builtin
130-
(super) @variable.builtin
125+
(this) @variable.special
126+
(super) @variable.special
131127

132128
(cf_var) @keyword
133129

@@ -139,29 +135,26 @@
139135
[
140136
(null)
141137
(undefined)
142-
] @constant.builtin
138+
] @constant.special
143139

144140
[
145141
(comment)
146142
(cf_comment)
147-
] @comment @spell
148-
149-
((comment) @comment.documentation
150-
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
143+
] @comment
151144

152-
((string_fragment) @keyword.directive
153-
(#eq? @keyword.directive "use strict"))
145+
((comment) @comment.doc
146+
(#lua-match? @comment.doc "^/[*][*][^*].*[*]/$"))
154147

155148
(hash_single) @keyword
156149
(string) @string
157150
(text) @string
158151
(hash_empty) @punctuation.special
159152

160-
(regex_pattern) @string.regexp
161-
(regex_flags) @character.special
153+
(regex_pattern) @string.regex
154+
(regex_flags) @string.special
162155

163156
(regex
164-
"/" @punctuation.bracket) ; Regex delimiters
157+
"/" @punctuation.bracket)
165158

166159
(number) @number
167160

@@ -191,10 +184,10 @@
191184
[
192185
"?"
193186
":"
194-
] @keyword.conditional.ternary)
187+
] @operator)
195188

196189
(elvis_expression
197-
"?:" @keyword.conditional.ternary)
190+
"?:" @operator)
198191

199192
[
200193
"-"

languages/cfml/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ grammar = "cfml"
33
path_suffixes = []
44
first_line_pattern = "^\\s*(<cfcomponent|<cfinterface|<!---)"
55
autoclose_before = ";:.,=}])>"
6+
line_comments = ["// "]
67
block_comment = ["<!--- ", " --->"]
78
brackets = [
89
{ start = "{", end = "}", close = true, newline = true },

languages/cfml/highlights.scm

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
; Document and structure (from Lucee-style rules)
2-
(program) @document
3-
(doctype) @doctype
1+
(doctype) @constant
42
(entity) @constant
5-
(html_text) @text
63

7-
(erroneous_end_tag_name) @tag.error
8-
(erroneous_cf_end_tag_name) @tag.error
4+
(erroneous_end_tag_name) @tag
5+
(erroneous_cf_end_tag_name) @tag
96
(attribute_name) @attribute
107
(cf_attribute_name) @attribute
118
(attribute_value) @string
12-
(raw_text) @embedded
139
(start_tag) @tag
1410
(end_tag) @tag
1511
(self_closing_tag) @tag
@@ -35,7 +31,7 @@
3531
(identifier) @variable
3632

3733
; CFML scopes (variables, session, etc.)
38-
(cf_scope_identifier) @namespace
34+
(cf_scope_identifier) @variable.special
3935

4036
; Properties
4137
;-----------
@@ -48,16 +44,16 @@
4844
;--------------------------------
4945

5046
(function_expression
51-
name: (identifier) @function) @definition.function
47+
name: (identifier) @function)
5248

5349
(function_declaration
5450
name: (identifier) @function)
5551

5652
(function_declaration
57-
(access_type) @access_type)
53+
(access_type) @keyword)
5854

5955
(function_declaration
60-
(return_type) @return_type)
56+
(return_type) @type)
6157

6258
(method_definition
6359
name: [
@@ -77,7 +73,7 @@
7773
key: (property_identifier) @function.method
7874
value: (arrow_function))
7975

80-
(array) @expression
76+
(array) @variable
8177

8278
(cf_set_tag) @tag
8379

@@ -111,22 +107,22 @@
111107
;--------------------------
112108

113109
(call_expression
114-
function: (identifier) @function.call)
110+
function: (identifier) @function)
115111

116112
(call_expression
117113
function: (member_expression
118114
property: [
119115
(property_identifier)
120116
(private_property_identifier)
121-
] @function.method.call))
117+
] @function.method))
122118

123119
; Literals
124120
;---------
125-
((identifier) @variable.builtin
126-
(#eq? @variable.builtin "self"))
121+
((identifier) @variable.special
122+
(#eq? @variable.special "self"))
127123

128-
(this) @variable.builtin
129-
(super) @variable.builtin
124+
(this) @variable.special
125+
(super) @variable.special
130126

131127
(cf_var) @keyword
132128

@@ -138,28 +134,25 @@
138134
[
139135
(null)
140136
(undefined)
141-
] @constant.builtin
137+
] @constant.special
142138

143139
[
144140
(comment)
145141
(cf_comment)
146-
] @comment @spell
147-
148-
((comment) @comment.documentation
149-
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
142+
] @comment
150143

151-
((string_fragment) @keyword.directive
152-
(#eq? @keyword.directive "use strict"))
144+
((comment) @comment.doc
145+
(#lua-match? @comment.doc "^/[*][*][^*].*[*]/$"))
153146

154147
(string) @string
155148
(text) @string
156149
(hash_empty) @punctuation.special
157150

158-
(regex_pattern) @string.regexp
159-
(regex_flags) @character.special
151+
(regex_pattern) @string.regex
152+
(regex_flags) @string.special
160153

161154
(regex
162-
"/" @punctuation.bracket) ; Regex delimiters
155+
"/" @punctuation.bracket)
163156

164157
(number) @number
165158

@@ -189,10 +182,10 @@
189182
[
190183
"?"
191184
":"
192-
] @keyword.conditional.ternary)
185+
] @operator)
193186

194187
(elvis_expression
195-
"?:" @keyword.conditional.ternary)
188+
"?:" @operator)
196189

197190
[
198191
"-"

languages/cfquery/highlights.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"[" @punctuation.bracket
1515
(identifier) @variable
1616
"]" @punctuation.bracket)
17-
(cfquery_boolean_literal) @constant.builtin
17+
(cfquery_boolean_literal) @constant.special
1818
(comment) @comment
1919
(cf_comment) @comment
2020

2121
; Parameters and CF hash interpolation inside SQL
22-
(parameter) @variable.parameter
22+
(parameter) @variable.special
2323
(hash_param
2424
"#" @punctuation.special
2525
(cf_identifier_path) @variable

languages/cfscript/highlights.scm

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
(identifier) @variable
55

66
; CFML scopes (variables, session, etc.)
7-
(cf_scope_identifier) @namespace
7+
(cf_scope_identifier) @variable.special
88

99
; Properties
1010
;-----------
@@ -66,22 +66,22 @@
6666
] @constant
6767
(#match? @constant "^[A-Z_][A-Z\\d_]+$"))
6868

69-
((identifier) @variable.builtin
70-
(#match? @variable.builtin "^(arguments|module|console|window|document)$"))
69+
((identifier) @variable.special
70+
(#match? @variable.special "^(arguments|module|console|window|document)$"))
7171

7272
; Literals
7373
;---------
7474

75-
(this) @variable.builtin
76-
(super) @variable.builtin
77-
(undefined) @constant.builtin
75+
(this) @variable.special
76+
(super) @variable.special
77+
(undefined) @constant.special
7878

7979
[
8080
(true)
8181
(false)
8282
(null)
8383
(undefined)
84-
] @constant.builtin
84+
] @constant.special
8585

8686
(comment) @comment
8787

@@ -94,7 +94,7 @@
9494
"#" @punctuation.special)
9595
(hash_empty) @punctuation.special
9696

97-
(regex) @string.special
97+
(regex) @string.regex
9898
(number) @number
9999

100100
; Tokens
@@ -112,10 +112,10 @@
112112
[
113113
"?"
114114
":"
115-
] @keyword.conditional.ternary)
115+
] @operator)
116116

117117
(elvis_expression
118-
"?:" @keyword.conditional.ternary)
118+
"?:" @operator)
119119

120120
[
121121
"-"
@@ -171,7 +171,7 @@
171171

172172
(template_substitution
173173
"${" @punctuation.special
174-
"}" @punctuation.special) @embedded
174+
"}" @punctuation.special)
175175

176176
[
177177
"as"

0 commit comments

Comments
 (0)