diff --git a/src/extension.ts b/src/extension.ts index d37cb31b2b..fd452858e1 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -42,52 +42,6 @@ export async function activate(context: vscode.ExtensionContext) { // TODO: Do this using the graph once we migrate its dependencies onto the graph new CommandRunner(graph, thatMark, sourceMark); - // Disabled for now. - // See https://github.com/cursorless-dev/cursorless/issues/320 - // vscode.workspace.onDidChangeTextDocument(checkForEditsOutsideViewport) - function _checkForEditsOutsideViewport( - event: vscode.TextDocumentChangeEvent - ) { - // TODO: Only activate this code during the course of a cursorless action - // Can register pre/post command hooks the way we do with test case recorder - // TODO: Move this thing to a graph component - // TODO: Need to move command executor and test case recorder to graph - // component while we're doing this stuff so it's easier to register the - // hooks - // TODO: Should run this code even if document is not in a visible editor - // as long as we are during the course of a cursorless command. - const editor = vscode.window.activeTextEditor; - - if ( - editor == null || - editor.document !== event.document || - event.reason === vscode.TextDocumentChangeReason.Undo || - event.reason === vscode.TextDocumentChangeReason.Redo - ) { - return; - } - - const ranges = event.contentChanges - .filter( - (contentChange) => - !editor.visibleRanges.some( - (visibleRange) => - contentChange.range.intersection(visibleRange) != null - ) - ) - .map(({ range }) => range); - - if (ranges.length > 0) { - ranges.sort((a, b) => a.start.line - b.start.line); - const linesText = ranges - .map((range) => `${range.start.line + 1}-${range.end.line + 1}`) - .join(", "); - vscode.window.showWarningMessage( - `Modification outside of viewport at lines: ${linesText}` - ); - } - } - return { thatMark, sourceMark,