diff --git a/src/lsp/providers/diagnosticsProvider.ts b/src/lsp/providers/diagnosticsProvider.ts index 79f462ecee02d56ab76b780cdae993e5b66bca31..036b32c2bd3c5c4bbf45c7f74eeddeb495019247 100644 --- a/src/lsp/providers/diagnosticsProvider.ts +++ b/src/lsp/providers/diagnosticsProvider.ts @@ -405,22 +405,3 @@ uri: document.uri, diagnostics, }) } - -export function clearDiagnostics(state: State, document: TextDocument): void { - state.editor.connection.sendDiagnostics({ - uri: document.uri, - diagnostics: [], - }) -} - -export function clearAllDiagnostics(state: State): void { - state.editor.documents.all().forEach((document) => { - clearDiagnostics(state, document) - }) -} - -export function updateAllDiagnostics(state: State): void { - state.editor.documents.all().forEach((document) => { - provideDiagnostics(state, document) - }) -} diff --git a/src/lsp/server.ts b/src/lsp/server.ts index 8e9addff1790460044f406c65302aadc70cc75c6..bef666c9fc13a61d43637a6f74fe7df412797e15 100644 --- a/src/lsp/server.ts +++ b/src/lsp/server.ts @@ -26,12 +26,8 @@ } from './providers/completionProvider' import { provideHover } from './providers/hoverProvider' import { URI } from 'vscode-uri' import { getDocumentSettings } from './util/getDocumentSettings' -import { - provideDiagnostics, - updateAllDiagnostics, - clearAllDiagnostics, - * Licensed under the MIT License. See License.txt in the project root for license information. /* -------------------------------------------------------------------------------------------- + if (newState && !newState.error) { import { createEmitter } from '../lib/emitter' let connection = createConnection(ProposedFeatures.all) @@ -107,7 +103,6 @@ state.configPath, state.config, state.plugins, ]) - updateAllDiagnostics(state) } else { state = { enabled: false, @@ -128,7 +123,6 @@ payload.line = parseInt(match.groups.line, 10) } connection.sendNotification('tailwindcss/configError', [payload]) } - clearAllDiagnostics(state) // TODO // connection.sendNotification('tailwindcss/configUpdated', [null]) } @@ -204,8 +198,10 @@ ) } /* -------------------------------------------------------------------------------------------- + state = { + provideDiagnostics(state, doc) + Hover, createConnection, - }) connection.onCompletion(