1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
diff --git a/src/lsp/server.ts b/src/lsp/server.ts
index bef666c9fc13a61d43637a6f74fe7df412797e15..8e9addff1790460044f406c65302aadc70cc75c6 100644
--- a/src/lsp/server.ts
+++ b/src/lsp/server.ts
@@ -26,7 +26,11 @@ } from './providers/completionProvider'
import { provideHover } from './providers/hoverProvider'
import { URI } from 'vscode-uri'
import { getDocumentSettings } from './util/getDocumentSettings'
-import { provideDiagnostics } from './providers/diagnosticsProvider'
+import {
+ provideDiagnostics,
+ updateAllDiagnostics,
+ clearAllDiagnostics,
+} from './providers/diagnosticsProvider'
import { createEmitter } from '../lib/emitter'
let connection = createConnection(ProposedFeatures.all)
@@ -102,6 +106,7 @@ state.configPath,
state.config,
state.plugins,
])
+ updateAllDiagnostics(state)
} else {
state = {
enabled: false,
@@ -122,6 +127,7 @@ payload.line = parseInt(match.groups.line, 10)
}
connection.sendNotification('tailwindcss/configError', [payload])
}
+ clearAllDiagnostics(state)
// TODO
// connection.sendNotification('tailwindcss/configUpdated', [null])
}
@@ -196,9 +202,7 @@ (change.settings.tailwindCSS || defaultSettings)
)
}
- state.editor.documents.all().forEach((doc) => {
- provideDiagnostics(state, doc)
- })
+ updateAllDiagnostics(state)
})
connection.onCompletion(
|