Skip to content

Commit

Permalink
slint: Update treesitter parser and queries (helix-editor#9551)
Browse files Browse the repository at this point in the history
* slint: Update treesitter parser and queries

* slint: Port over suggestions from nvim review
  • Loading branch information
hunger authored and cosmikwolf committed Feb 26, 2024
1 parent f17e38f commit 896a194
Show file tree
Hide file tree
Showing 7 changed files with 278 additions and 146 deletions.
2 changes: 1 addition & 1 deletion book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
| scala |||| `metals` |
| scheme || || |
| scss || | | `vscode-css-language-server` |
| slint || || `slint-lsp` |
| slint || || `slint-lsp` |
| smali || || |
| smithy || | | `cs` |
| sml || | | |
Expand Down
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@ language-servers = [ "slint-lsp" ]

[[grammar]]
name = "slint"
source = { git = "https://github.com/jrmoulton/tree-sitter-slint", rev = "00c8a2d3645766f68c0d0460086c0a994e5b0d85" }
source = { git = "https://github.com/slint-ui/tree-sitter-slint", rev = "15618215b79b9db08f824a5c97a12d073dcc1c00" }

[[language]]
name = "task"
Expand Down
20 changes: 19 additions & 1 deletion runtime/queries/rust/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,29 @@
(#set! injection.language "comment"))

((macro_invocation
macro: (identifier) @_html (#eq? @_html "html")
macro:
[
(scoped_identifier
name: (_) @_macro_name)
(identifier) @_macro_name
]
(token_tree) @injection.content)
(#eq? @_macro_name "html")
(#set! injection.language "html")
(#set! injection.include-children))

((macro_invocation
macro:
[
(scoped_identifier
name: (_) @_macro_name)
(identifier) @_macro_name
]
(token_tree) @injection.content)
(#eq? @_macro_name "slint")
(#set! injection.language "slint")
(#set! injection.include-children))

((macro_invocation
(token_tree) @injection.content)
(#set! injection.language "rust")
Expand Down
Loading

0 comments on commit 896a194

Please sign in to comment.