Skip to content

Commit 092b597

Browse files
committed
hcl: Mark some string quotes in Terraform as noise
1 parent 4d23b68 commit 092b597

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

queries/hcl/highlights.terraform-mode.scm

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929

3030
;; TODO: Highlight `content'.
3131
((block (identifier) @keyword
32-
[(string_lit (template_literal) @variable)])
32+
[(string_lit (quoted_template_start) @noise
33+
(template_literal) @variable
34+
(quoted_template_end) @noise)])
3335
(.eq? @keyword "dynamic"))
3436

3537
;; ((block (identifier) @keyword
@@ -39,25 +41,35 @@
3941
;; (.eq? @keyword "dynamic"))
4042

4143
((block (identifier) @keyword
42-
. [(string_lit (template_literal) @function)
44+
. [(string_lit (quoted_template_start) @noise
45+
(template_literal) @function
46+
(quoted_template_end) @noise)
4347
(identifier) @function])
4448
(.eq? @keyword "output"))
4549

4650
((block (identifier) @keyword
47-
[(string_lit (template_literal) @variable.special)
51+
[(string_lit (quoted_template_start) @noise
52+
(template_literal) @variable.special
53+
(quoted_template_end) @noise)
4854
(identifier) @variable.special])
4955
(.eq? @keyword "variable"))
5056

5157
((block (identifier) @keyword
52-
[(string_lit (template_literal) @type)
58+
[(string_lit (quoted_template_start) @noise
59+
(template_literal) @type
60+
(quoted_template_end) @noise)
5361
(identifier) @type])
5462
(.eq? @keyword "module"))
5563

5664
;; resource "aws_launch_template" "default"
5765
(block (identifier)
58-
[(string_lit (template_literal) @type)
66+
[(string_lit (quoted_template_start) @noise
67+
(template_literal) @type
68+
(quoted_template_end) @noise)
5969
(identifier) @type]
60-
. [(string_lit (template_literal) @function)
70+
. [(string_lit (quoted_template_start) @noise
71+
(template_literal) @function
72+
(quoted_template_end) @noise)
6173
(identifier) @function]
6274
. (block_start))
6375

0 commit comments

Comments
 (0)