MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / checkCurrentEditorSelectionIsPosition

Function checkCurrentEditorSelectionIsPosition

src/test/helpers.ts:947–954  ·  view source on GitHub ↗
(expectedUri: vs.Uri, expectedPosition: vs.Position)

Source from the content-addressed store, hash-verified

945}
946
947export async function checkCurrentEditorSelectionIsPosition(expectedUri: vs.Uri, expectedPosition: vs.Position): Promise<boolean> {
948 const editor = currentEditor();
949 return fsPath(editor.document.uri) === fsPath(expectedUri)
950 && editor.selection.start.line === expectedPosition.line
951 && editor.selection.start.character === expectedPosition.character
952 && editor.selection.end.line === expectedPosition.line
953 && editor.selection.end.character === expectedPosition.character;
954}
955
956export function snippetValue(text: string | vs.SnippetString | undefined) {
957 return !text || typeof text === "string" ? text : text.value;

Callers 2

Calls 2

fsPathFunction · 0.90
currentEditorFunction · 0.85

Tested by

no test coverage detected