Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasArvidsson committed Nov 9, 2024
1 parent 0d9e923 commit a672947
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let foo, bar;
---

[Range] = 0:4-0:12
>--------<
0| let foo, bar;

[Domain] = 0:0-0:13
>-------------<
0| let foo, bar;
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
let foo, bar;
---

[#1 Content] =
[#1 Domain] = 0:4-0:7
>---<
0| let foo, bar;

[#1 Removal] = 0:4-0:9
>-----<
0| let foo, bar;

[#1 Trailing delimiter] = 0:7-0:9
>--<
0| let foo, bar;

[#1 Insertion delimiter] = ", "


[#2 Content] =
[#2 Domain] = 0:9-0:12
>---<
0| let foo, bar;

[#2 Removal] = 0:7-0:12
>-----<
0| let foo, bar;

[#2 Leading delimiter] = 0:7-0:9
>--<
0| let foo, bar;

[#2 Insertion delimiter] = ", "
3 changes: 3 additions & 0 deletions packages/common/src/scopeSupportFacets/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = {
"value.return": supported,
"value.return.lambda": supported,
"value.field": supported,

"collectionItem.unenclosed": supported,
"collectionItem.unenclosed.iteration": supported,
};

export const javascriptJsxScopeSupport: LanguageScopeSupportFacetMap = {
Expand Down
9 changes: 9 additions & 0 deletions queries/javascript.core.scm
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@
(#insertion-delimiter! @collectionItem ", ")
)

;;!! let foo, bar;
;;! ^^^^^^^^
;;! -------------
(lexical_declaration
.
(_) @collectionItem.iteration.start.startOf
";"? @collectionItem.iteration.end.startOf
) @collectionItem.iteration.domain

(expression_statement
[
;; name:
Expand Down

0 comments on commit a672947

Please sign in to comment.