diff --git a/TODO b/TODO index 694dab4..edac1bd 100644 --- a/TODO +++ b/TODO @@ -1,26 +1,25 @@ MVP === - lint everything -- delete lint on close file TODO ==== - lint current file - [v] command clear all issues Long Term Desired Features ========================== - Fancy UIs for - arc patch - arc todo - arc unit - arc browse - arc paste (upload and download) - list open Differential in repo (for review) - get hovercard (content) for any object - push notifications from website ? - preview Remarkup - some magic to help the External Editor Link - arc lint: special-case some messages for better visibility (find more range/information.) - arc lint: support auto-fix (apply diff) - arc lint: `locations` field may be parsed into `relatedInformation`. diff --git a/src/extension.ts b/src/extension.ts index 51646ab..976089c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,44 +1,45 @@ import * as vscode from 'vscode'; import * as lint from './arc_lint'; export function activate(context: vscode.ExtensionContext) { - const collection = vscode.languages.createDiagnosticCollection('arc lint'); + const diagnostics = vscode.languages.createDiagnosticCollection('arc lint'); lint.setup(); function d(disposable: vscode.Disposable) { context.subscriptions.push(disposable); } + d(diagnostics); - d(vscode.commands.registerCommand('arc-vscode.clearLint', () => collection.clear())); + d(vscode.commands.registerCommand('arc-vscode.clearLint', () => diagnostics.clear())); d(vscode.workspace.onDidSaveTextDocument(onTextDocumentEvent)); d(vscode.workspace.onDidOpenTextDocument(onTextDocumentEvent)); d(vscode.workspace.onDidChangeConfiguration(onChangeConfig)); if (vscode.window.activeTextEditor) { - lint.lintFile(vscode.window.activeTextEditor.document, collection); + lint.lintFile(vscode.window.activeTextEditor.document, diagnostics); } d(vscode.window.onDidChangeActiveTextEditor(editor => { if (editor) { - lint.lintFile(editor.document, collection); + lint.lintFile(editor.document, diagnostics); } })); + d(vscode.workspace.onDidCloseTextDocument(document => diagnostics.delete(document.uri))); + function onTextDocumentEvent(document: vscode.TextDocument) { - lint.lintFile(document, collection); + lint.lintFile(document, diagnostics); } } -export function deactivate() { - // TODO collection.clear(); -} +export function deactivate() { } function onChangeConfig(e: vscode.ConfigurationChangeEvent) { if (!e.affectsConfiguration('arc-vscode.lint')) { return; } lint.updateLintSeverityMap(); }