-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: the start of dart lang support (#2671)
Hello, hopefully I did these first steps right and I would like some rough guidance on adding the subsequent things like snippets or any other essentials for dart support, thanks! ## 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 --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4362f67
commit 762f377
Showing
8 changed files
with
106 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
foo() { | ||
if (true) { } | ||
} | ||
--- | ||
|
||
[Content] = | ||
[Domain] = 1:2-1:15 | ||
>-------------< | ||
1| if (true) { } | ||
|
||
[Removal] = 1:0-1:15 | ||
>---------------< | ||
1| if (true) { } | ||
|
||
[Leading delimiter] = 1:0-1:2 | ||
>--< | ||
1| if (true) { } | ||
|
||
[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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
final list = [1,2,3]; | ||
--- | ||
|
||
[Content] = | ||
[Domain] = 0:13-0:20 | ||
>-------< | ||
0| final list = [1,2,3]; | ||
|
||
[Removal] = 0:12-0:20 | ||
>--------< | ||
0| final list = [1,2,3]; | ||
|
||
[Leading delimiter] = 0:12-0:13 | ||
>-< | ||
0| final list = [1,2,3]; | ||
|
||
[Insertion delimiter] = " " |
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,25 @@ | ||
final map = { | ||
'hi': 1, | ||
}; | ||
--- | ||
|
||
[Content] = | ||
[Domain] = 0:14-2:3 | ||
>- | ||
0| final map = { | ||
1| 'hi': 1, | ||
2| }; | ||
---< | ||
|
||
[Removal] = 0:13-2:3 | ||
>-- | ||
0| final map = { | ||
1| 'hi': 1, | ||
2| }; | ||
---< | ||
|
||
[Leading delimiter] = 0:13-0:14 | ||
>-< | ||
0| final map = { | ||
|
||
[Insertion delimiter] = " " |
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,9 @@ | ||
foo() { | ||
if (true) {} | ||
|
||
final list = [1, 2, 3]; | ||
|
||
final map = { | ||
'hi': 1, | ||
}; | ||
} |
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,11 @@ | ||
import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; | ||
import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel; | ||
|
||
export const dartScopeSupport: LanguageScopeSupportFacetMap = { | ||
ifStatement: supported, | ||
list: supported, | ||
map: supported, | ||
}; |
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
5 changes: 5 additions & 0 deletions
5
packages/cursorless-org-docs/src/docs/user/languages/dart.mdx
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,5 @@ | ||
import Language from "./Language"; | ||
|
||
# dart | ||
|
||
<Language languageId="dart"></Language> |
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,18 @@ | ||
|
||
;;!! if () {} | ||
;;! ^^^^^^^^ | ||
(if_statement) @ifStatement | ||
|
||
;;!! [ 0 ] | ||
;;! ^^^^^ | ||
[ | ||
(list_literal) | ||
(list_pattern) | ||
] @list | ||
|
||
;;!! { value: 0 } | ||
;;! ^^^^^^^^^^^^ | ||
[ | ||
(set_or_map_literal) | ||
(map_pattern) | ||
] @map |