Skip to content

Commit 1920cdd

Browse files
Updates scope support test for new parse tree version (#2715)
With the new scope tree version this test broke. The iteration scope for functions is the entire program I guess it's reasonable that an empty document is still considered a function iteration scope https://github.com/cursorless-dev/cursorless/blob/ec914cad1e4c73d67a9d31054573b12450d1b7cd/queries/javascript.function.scm#L162 ## Checklist - [x] 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
1 parent 43e9e21 commit 1920cdd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/cursorless-vscode-e2e/src/suite/scopeProvider/runBasicScopeInfoTest.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ function helloWorld() {
5454
}
5555
`;
5656

57-
function getExpectedScope(scopeSupport: ScopeSupport): ScopeSupportInfo {
57+
function getExpectedScope(
58+
scopeSupport: ScopeSupport,
59+
iterationScopeSupport?: ScopeSupport,
60+
): ScopeSupportInfo {
5861
return {
5962
humanReadableName: "named function",
6063
isLanguageSpecific: true,
61-
iterationScopeSupport: scopeSupport,
64+
iterationScopeSupport: iterationScopeSupport ?? scopeSupport,
6265
scopeType: {
6366
type: "namedFunction",
6467
},
@@ -71,5 +74,8 @@ function getExpectedScope(scopeSupport: ScopeSupport): ScopeSupportInfo {
7174
}
7275

7376
const unsupported = getExpectedScope(ScopeSupport.unsupported);
74-
const supported = getExpectedScope(ScopeSupport.supportedButNotPresentInEditor);
77+
const supported = getExpectedScope(
78+
ScopeSupport.supportedButNotPresentInEditor,
79+
ScopeSupport.supportedAndPresentInEditor,
80+
);
7581
const present = getExpectedScope(ScopeSupport.supportedAndPresentInEditor);

0 commit comments

Comments
 (0)