Skip to content

Commit 0ccdcc6

Browse files
cleanup
1 parent 2f15dc6 commit 0ccdcc6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/cursorless-engine/src/languages/LanguageDefinition.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class LanguageDefinition {
7171
scopeType as SimpleScopeType,
7272
);
7373

74-
if (scopeType.type === "comment") {
74+
if (useContiguousScopeHandler(scopeType)) {
7575
return new ContiguousScopeHandler(scopeHandler);
7676
}
7777

@@ -151,3 +151,15 @@ function readQueryFileAndImports(languageQueryPath: string) {
151151

152152
return Object.values(rawQueryStrings).join("\n");
153153
}
154+
155+
/**
156+
* Returns true if the given scope type should use a contiguous scope handler.
157+
*/
158+
function useContiguousScopeHandler(scopeType: ScopeType): boolean {
159+
switch (scopeType.type) {
160+
case "comment":
161+
return true;
162+
default:
163+
return false;
164+
}
165+
}

0 commit comments

Comments
 (0)