-
-
Notifications
You must be signed in to change notification settings - Fork 830
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
Makefile
highlighting some values and arguments as text
#6639
Comments
How would you expect them to be highlighted? |
@clason I am not sure, inside the define call it could treat them as
(command) ; [31:3 - 20]
name: (command_name) ; [31:3 - 8]
(word) ; [31:3 - 8]
argument: (word) ; [31:10 - 20]
(command) ; [32:4 - 24]
name: (command_name) ; [32:4 - 24]
(command_substitution) ; [32:4 - 24]
(command) ; [32:6 - 23]
name: (command_name) ; [32:6 - 9]
(word) ; [32:6 - 9]
argument: (concatenation) ; [32:11 - 16]
(simple_expansion) ; [32:11 - 12]
(special_variable_name) ; [32:12 - 12]
(word) ; [32:13 - 16]
argument: (word) ; [32:18 - 18]
argument: (command_substitution) ; [32:20 - 23]
(command) ; [32:22 - 22]
name: (command_name) ; [32:22 - 22]
(number) ; [32:22 - 22]
(command) ; [33:4 - 25]
name: (command_name) ; [33:4 - 7]
(word) ; [33:4 - 7]
argument: (concatenation) ; [33:9 - 25]
(expansion) ; [33:9 - 16]
(variable_name) ; [33:11 - 15]
(ERROR) ; [33:17 - 20]
(word) ; [33:21 - 24]
(word) ; [33:25 - 25]
(command) ; [34:4 - 18]
name: (command_name) ; [34:4 - 7]
(word) ; [34:4 - 7]
argument: (expansion) ; [34:9 - 18]
(variable_name) ; [34:11 - 17]
(command) ; [35:3 - 7]
name: (command_name) ; [35:3 - 7]
(word) ; [35:3 - 7]
(command) ; [31:3 - 7]
name: (command_name) ; [31:3 - 7]
(word) ; [31:3 - 7]
(command) ; [32:4 - 43]
name: (command_name) ; [32:4 - 43]
(concatenation) ; [32:4 - 43]
(word) ; [32:4 - 4]
(command_substitution) ; [32:5 - 43]
(command) ; [32:7 - 42]
name: (command_name) ; [32:7 - 10]
(word) ; [32:7 - 10]
argument: (concatenation) ; [32:12 - 42]
(word) ; [32:12 - 23]
(string) ; [32:24 - 42]
(string_content) ; [32:25 - 41]
|
That's not possible, though. The make query can't know what file it is in. Feel free to make a PR adding a |
@clason it will be my first time touching this code base, do you know where should I do it? |
The relevant query is |
@clason one question I have, what should I do to put the injection?
((comment) @injection.content
(#set! injection.language "comment"))
((shell_text) @injection.content
(#set! injection.language "bash"))
((shell_command) @injection.content
(#set! injection.language "bash"))
(define_directive
"define" @keyword
name: (word) @string.special.symbol
[
"="
":="
"::="
; ":::="
"?="
"!="
]? @operator
"endef" @keyword) My question is, wouldn't be better to assign to |
No, since we can only assign single captures to single nodes exposed by the parser. If you are not (yet) sufficiently familiar with treesitter queries, no worries; but then you'll have to wait for some else to do this. (Queries are community contributed.) |
@clason I haven't written a single one yet 😥 but I will give it a try, in the meantime if anyone does it will be nice too ✌️. |
Describe the highlighting problem
Makefile
and using adefine <name>\n...\n endef
the inside values will be highlighted as a whole and withraw_text
.target
calling thedefine
with$(call <defined>,"...")
it highlights the arguments astext
, including thestrings
.Example snippet that causes the problem
Tree-sitter parsing result
Example screenshot
:Inspect
of both:rose-pine-moon
more on how to configure here:Expected behavior
To have highlights other than
raw_text
ortext
, at least thestrings
.Output of
:checkhealth nvim-treesitter
Output of
nvim --version
Additional context
No response
The text was updated successfully, but these errors were encountered: