-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add proper jsonc comment support (#2145)
After bumping tree-sitter-json in cursorless-dev/vscode-parse-tree@5920905, the tree-sitter-json parser now has proper support for comments Fwiw, that version also includes proper jsonl support, so it's no longer a hack ## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [ ] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [ ] I have not broken the cheatsheet
- Loading branch information
Showing
6 changed files
with
54 additions
and
9 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,13 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
|
||
import { | ||
LanguageScopeSupportFacetMap, | ||
ScopeSupportFacetLevel, | ||
} from "./scopeSupportFacets.types"; | ||
|
||
const { supported } = ScopeSupportFacetLevel; | ||
|
||
export const jsonScopeSupport: LanguageScopeSupportFacetMap = { | ||
"comment.line": supported, | ||
"comment.block": supported, | ||
}; |
16 changes: 16 additions & 0 deletions
16
packages/cursorless-vscode-e2e/src/suite/fixtures/scopes/json/comment.block.scope
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,16 @@ | ||
/* | ||
Hello world | ||
*/ | ||
--- | ||
|
||
[Content] = | ||
[Removal] = | ||
[Domain] = 0:0-2:2 | ||
0| /* | ||
>-- | ||
1| Hello world | ||
------------- | ||
2| */ | ||
--< | ||
|
||
[Insertion delimiter] = "\n" |
10 changes: 10 additions & 0 deletions
10
packages/cursorless-vscode-e2e/src/suite/fixtures/scopes/json/comment.line.scope
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,10 @@ | ||
// Hello world | ||
--- | ||
|
||
[Content] = | ||
[Removal] = | ||
[Domain] = 0:0-0:14 | ||
0| // Hello world | ||
>--------------< | ||
|
||
[Insertion delimiter] = "\n" |
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 |
---|---|---|
@@ -1,4 +1 @@ | ||
;; import json.scm | ||
|
||
;; Currently not supported by our Tree sitter parser | ||
;; (comment) @comment @textFragment |