fix regex
and sql
injections in runtime/queries/rust/injections.scm
#13057
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this fixes the rust injections for
regex
andsql
by injecting the language into the(string_content)
instead of the outer(raw_string_literal)
/(string_literal)
additionally for the
sql
injections another issue was that they were being overriden by the default "rust" injections into the(token_tree)
of all(macro_invocations)
, so this now filters out those specific macros.i also wanted to add an injection for the
json!
macro, but i couldn't figure out a way to strip the leading and trailing paranthesis in thejson!({})
call to make the content actually valid json, similar to nvim-treesitter/nvim-treesitter#7715, but (as far as i can tell) helix does not support the(#offset! )
directive and i couldn't figure out a way to achieve this with the(#strip! )
directive.before:
after: