Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ const simpleScopeTypeTypesSet = new Set(simpleScopeTypeTypes);

export type SimpleScopeTypeType = (typeof simpleScopeTypeTypes)[number];

export const pseudoScopes = new Set<SimpleScopeTypeType>([
export const pseudoScopeTypes = new Set<SimpleScopeTypeType>([
"instance",
"interior",
"className",
"functionName",
]);
Comment thread
AndreasArvidsson marked this conversation as resolved.
Outdated
Expand All @@ -229,7 +228,7 @@ export function isSimpleScopeType(
}

export function isPseudoScope(scopeType: ScopeType): boolean {
return isSimpleScopeType(scopeType) && pseudoScopes.has(scopeType.type);
return isSimpleScopeType(scopeType) && pseudoScopeTypes.has(scopeType.type);
}

export interface SimpleScopeType {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { pseudoScopes, simpleScopeTypeTypes } from "@cursorless/lib-common";
import { pseudoScopeTypes, simpleScopeTypeTypes } from "@cursorless/lib-common";

const scopeCaptureNames = [
...simpleScopeTypeTypes.filter((s) => !pseudoScopes.has(s)),
// Interior is a pseudo scope, but it's implemented with an actual internal scope
"interior",
] as const;
const scopeCaptureNames = simpleScopeTypeTypes.filter(
(s) => !pseudoScopeTypes.has(s),
);

export type ScopeCaptureName = (typeof scopeCaptureNames)[number];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
import type {
Direction,
Position,
ScopeType,
TextEditor,
} from "@cursorless/lib-common";
import { NoContainingScopeError } from "@cursorless/lib-common";
import type { Direction, Position, TextEditor } from "@cursorless/lib-common";
import type { LanguageDefinitions } from "../../../../languages/LanguageDefinitions";
import type { Target } from "../../../../typings/target.types";
import { InteriorTarget } from "../../../targets";
import { BaseScopeHandler } from "../BaseScopeHandler";
import type { TargetScope } from "../scope.types";
import type {
ComplexScopeType,
ScopeIteratorRequirements,
} from "../scopeHandler.types";
import type { ScopeIteratorRequirements } from "../scopeHandler.types";
import type { TreeSitterScopeHandler } from "../TreeSitterScopeHandler";

export class InteriorScopeHandler extends BaseScopeHandler {
public readonly scopeType = { type: "interior" } as const;
public readonly iterationScopeType = { type: "document" } as const;
protected isHierarchical = true;

static maybeCreate(
Expand All @@ -39,12 +31,6 @@ export class InteriorScopeHandler extends BaseScopeHandler {
super();
}

get iterationScopeType(): ScopeType | ComplexScopeType {
throw new NoContainingScopeError(
"Iteration scope for InteriorScopeHandler",
);
}

*generateScopeCandidates(
editor: TextEditor,
position: Position,
Expand Down
Loading