You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using SQL as an example, but this applies more generally.
Some SQL comments start with "#" (e.g. Mysql I think). So I tried to modify my languages.toml:
[[language]]
name = "sql"
comment-tokens = ["#", "--"]
Result:
Failed to parse language config: duplicate field `comment-tokens`
in `language`
The default sql language definition includes
comment-token = "--"
Possible solutions I looked at:
I couldn't find a way to un-define comment-token in the user languages.toml. (maybe there is one?)
Relevant code is roughly here. Seems this is using serde aliases. But at this point, I think the configs are already merged. Probably this needs to be handled earlier to remove the default config option if either of the two versions is present in the user config.
Arguably the default languages.toml could be updated to list both tokens for SQL. This would fix the issue for SQL but doesn't solve the customization problem more generally.
The text was updated successfully, but these errors were encountered:
One more question, the documentation says:
"The tokens to use as a comment token, either a single token "//" or an array ["//", "///", "//!"] (the first token will be used for commenting). Also configurable as comment-token for backwards compatibility"
It says that in the case of an array - the first token will be used.
I have .vue files, in which there are 3 languages: html, js/ts, css. So there are 3 tokens used for commenting:
<!-- -->
//
/* */
How to make the correct token for comments be used? So far it only incorrectly uses comments for html - everywhere.
Is it the tree sitter responsible for identifying the context in which the comment is being made - or is it an internal thing in rust?
Please, clarify.
Using SQL as an example, but this applies more generally.
Some SQL comments start with "#" (e.g. Mysql I think). So I tried to modify my
languages.toml
:Result:
The default sql language definition includes
Possible solutions I looked at:
languages.toml
. (maybe there is one?)languages.toml
could be updated to list both tokens for SQL. This would fix the issue for SQL but doesn't solve the customization problem more generally.The text was updated successfully, but these errors were encountered: