-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A lot more work has been put into this and those were 116 commits up to this point. I decided to squash all of them so that i will have an easier time rebasing in the future.
- Loading branch information
1 parent
41db5d7
commit 85a5f60
Showing
30 changed files
with
955 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Adding context queries | ||
|
||
Helix uses tree-sitter to filter out specific scopes in which said scope may exceed the current | ||
editor view, but which may be important for the developer to know. | ||
These context require an accompanying tree-sitter grammar and a `context.scm` query file | ||
to work properly. | ||
Query files should be placed in `runtime/queries/{language}/context.scm` | ||
when contributing to Helix. Note that to test the query files locally you should put | ||
them under your local runtime directory (`~/.config/helix/runtime` on Linux for example). | ||
|
||
The following [captures][tree-sitter-captures] are recognized: | ||
|
||
| Capture Name | | ||
| --- | | ||
| `context` | | ||
| `context.params` | | ||
|
||
[Example query files][context-examples] can be found in the helix GitHub repository. | ||
|
||
## Queries for the sticky-context feature | ||
|
||
All nodes that have a scope, should be captured with `context`, as an example a basic class. | ||
The `context.params` is a capture for all the function parameters. | ||
|
||
[tree-sitter-captures]: https://tree-sitter.github.io/tree-sitter/using-parsers#capturing-nodes | ||
[context-examples]: https://github.com/search?q=repo%3Ahelix-editor%2Fhelix+filename%3Acontext.scm&type=Code&ref=advsearch&l=&l= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.