Home

tailwind-ctp-intellisense @8ca0e518b0592914075aef8e8042320116f7d50d - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-intellisense / src / lsp / providers / diagnostics / diagnosticsProvider.ts
- raw
 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
import { TextDocument } from 'vscode-languageserver'
import { State } from '../../util/state'
import { doValidate } from 'tailwindcss-language-service'

export async function provideDiagnostics(state: State, document: TextDocument) {
  state.editor.connection.sendDiagnostics({
    uri: document.uri,
    diagnostics: await doValidate(state, document),
  })
}

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)
  })
}