-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow][match] Tests for find-references on match pattern bindings
Summary: Tests for find-references on match pattern bindings. Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D67842016 fbshipit-source-id: 174e89840627d3134e3f8ef2d8447d88ca39d130
- Loading branch information
1 parent
d4a2cb2
commit c515999
Showing
9 changed files
with
215 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,12 @@ | ||
// @flow | ||
|
||
declare const x: mixed; | ||
|
||
const e = match (x) { | ||
[const a]: a, | ||
{foo: const a}: a, | ||
{const a}: a, | ||
1 as const a: a, | ||
2 as a: a, | ||
const a: a, | ||
}; |
31 changes: 31 additions & 0 deletions
31
newtests/lsp/findReferences/__snapshots__/match-as-const.json
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,31 @@ | ||
{ | ||
"method": "textDocument/references", | ||
"result": [ | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 8, | ||
"character": 13 | ||
}, | ||
"end": { | ||
"line": 8, | ||
"character": 14 | ||
} | ||
} | ||
}, | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 8, | ||
"character": 16 | ||
}, | ||
"end": { | ||
"line": 8, | ||
"character": 17 | ||
} | ||
} | ||
} | ||
] | ||
} |
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,31 @@ | ||
{ | ||
"method": "textDocument/references", | ||
"result": [ | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 9, | ||
"character": 7 | ||
}, | ||
"end": { | ||
"line": 9, | ||
"character": 8 | ||
} | ||
} | ||
}, | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 9, | ||
"character": 10 | ||
}, | ||
"end": { | ||
"line": 9, | ||
"character": 11 | ||
} | ||
} | ||
} | ||
] | ||
} |
31 changes: 31 additions & 0 deletions
31
newtests/lsp/findReferences/__snapshots__/match-binding-top.json
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,31 @@ | ||
{ | ||
"method": "textDocument/references", | ||
"result": [ | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 10, | ||
"character": 8 | ||
}, | ||
"end": { | ||
"line": 10, | ||
"character": 9 | ||
} | ||
} | ||
}, | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 10, | ||
"character": 11 | ||
}, | ||
"end": { | ||
"line": 10, | ||
"character": 12 | ||
} | ||
} | ||
} | ||
] | ||
} |
31 changes: 31 additions & 0 deletions
31
newtests/lsp/findReferences/__snapshots__/match-obj-long.json
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,31 @@ | ||
{ | ||
"method": "textDocument/references", | ||
"result": [ | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 6, | ||
"character": 14 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"character": 15 | ||
} | ||
} | ||
}, | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 6, | ||
"character": 18 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"character": 19 | ||
} | ||
} | ||
} | ||
] | ||
} |
31 changes: 31 additions & 0 deletions
31
newtests/lsp/findReferences/__snapshots__/match-obj-shorthand.json
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,31 @@ | ||
{ | ||
"method": "textDocument/references", | ||
"result": [ | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 7, | ||
"character": 9 | ||
}, | ||
"end": { | ||
"line": 7, | ||
"character": 10 | ||
} | ||
} | ||
}, | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 7, | ||
"character": 13 | ||
}, | ||
"end": { | ||
"line": 7, | ||
"character": 14 | ||
} | ||
} | ||
} | ||
] | ||
} |
31 changes: 31 additions & 0 deletions
31
newtests/lsp/findReferences/__snapshots__/match-tuple.json
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,31 @@ | ||
{ | ||
"method": "textDocument/references", | ||
"result": [ | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 5, | ||
"character": 9 | ||
}, | ||
"end": { | ||
"line": 5, | ||
"character": 10 | ||
} | ||
} | ||
}, | ||
{ | ||
"uri": "<PLACEHOLDER_PROJECT_URL>/__fixtures__/match.js", | ||
"range": { | ||
"start": { | ||
"line": 5, | ||
"character": 13 | ||
}, | ||
"end": { | ||
"line": 5, | ||
"character": 14 | ||
} | ||
} | ||
} | ||
] | ||
} |
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,2 @@ | ||
[options] | ||
experimental.pattern_matching_expressions=true |
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