import type { TextDocument } from 'vscode-languageserver' ; import { State } from '../util/state' ; import { DiagnosticKind , AugmentedDiagnostic } from './types' ; import { getCssConflictDiagnostics } from './getCssConflictDiagnostics' ; import { getInvalidApplyDiagnostics } from './getInvalidApplyDiagnostics' ; import { getInvalidScreenDiagnostics } from './getInvalidScreenDiagnostics' ; import { getInvalidVariantDiagnostics } from './getInvalidVariantDiagnostics' ; import { getInvalidConfigPathDiagnostics } from './getInvalidConfigPathDiagnostics' ; import { getInvalidTailwindDirectiveDiagnostics } from './getInvalidTailwindDirectiveDiagnostics' ; import { getRecommendedVariantOrderDiagnostics } from './getRecommendedVariantOrderDiagnostics' ; export async function doValidate ( state , document , only = [ DiagnosticKind . CssConflict , DiagnosticKind . InvalidApply , DiagnosticKind . InvalidScreen , DiagnosticKind . InvalidVariant , DiagnosticKind . InvalidConfigPath , DiagnosticKind . InvalidTailwindDirective , DiagnosticKind . RecommendedVariantOrder , ] ) { const settings = await state . editor . getConfiguration ( document . uri ) ; return settings . tailwindCSS . validate ? [ ... ( only . includes ( DiagnosticKind . CssConflict ) ? await getCssConflictDiagnostics ( state , document , settings ) : [ ] ) , ... ( only . includes ( DiagnosticKind . InvalidApply ) ? await getInvalidApplyDiagnostics ( state , document , settings ) : [ ] ) , ... ( only . includes ( DiagnosticKind . InvalidScreen ) ? getInvalidScreenDiagnostics ( state , document , settings ) : [ ] ) , ... ( only . includes ( DiagnosticKind . InvalidVariant ) ? getInvalidVariantDiagnostics ( state , document , settings ) : [ ] ) , ... ( only . includes ( DiagnosticKind . InvalidConfigPath ) ? getInvalidConfigPathDiagnostics ( state , document , settings ) : [ ] ) , ... ( only . includes ( DiagnosticKind . InvalidTailwindDirective ) ? getInvalidTailwindDirectiveDiagnostics ( state , document , settings ) : [ ] ) , ... ( only . includes ( DiagnosticKind . RecommendedVariantOrder ) ? await getRecommendedVariantOrderDiagnostics ( state , document , settings ) : [ ] ) , ] : [ ] ; } export async function provideDiagnostics ( state , document ) { } export function clearDiagnostics ( state , document ) { } export function clearAllDiagnostics ( state ) { state . editor . documents . all ( ) . forEach ( ( document ) => { clearDiagnostics ( state , document ) ; } ) ; } export function updateAllDiagnostics ( state ) { state . editor . documents . all ( ) . forEach ( ( document ) => { provideDiagnostics ( state , document ) ; } ) ; }