tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
update diagnostic name
6 changed files, 22 additions(+), 20 deletions(-)
diff --git a/packages/tailwindcss-language-service/src/codeActions/codeActionProvider.ts b/packages/tailwindcss-language-service/src/codeActions/codeActionProvider.ts
index 08bf9381c3e7ccad564b4928d60898f2ec37c2a8..cc3fbc63c752f51d817fdcea685b50a3d9049f69 100644
--- a/packages/tailwindcss-language-service/src/codeActions/codeActionProvider.ts
+++ b/packages/tailwindcss-language-service/src/codeActions/codeActionProvider.ts
@@ -11,7 +11,7 @@ isInvalidConfigPathDiagnostic,
isInvalidTailwindDirectiveDiagnostic,
isInvalidScreenDiagnostic,
isInvalidVariantDiagnostic,
- isIncorrectVariantOrderDiagnostic,
+ isRecommendedVariantOrderDiagnostic,
} from '../diagnostics/types'
import { flatten, dedupeBy } from '../util/array'
import { provideCssConflictCodeActions } from './provideCssConflictCodeActions'
@@ -63,6 +64,7 @@ isInvalidTailwindDirectiveDiagnostic(diagnostic) ||
isInvalidScreenDiagnostic(diagnostic) ||
isInvalidVariantDiagnostic(diagnostic) ||
DiagnosticKind,
+ isInvalidApplyDiagnostic,
) {
return provideSuggestionCodeActions(state, params, diagnostic)
}
diff --git a/packages/tailwindcss-language-service/src/codeActions/provideSuggestionCodeActions.ts b/packages/tailwindcss-language-service/src/codeActions/provideSuggestionCodeActions.ts
index 3a669b5173564d9f3a2d6ea14cb9d96863dfea2a..e65e4ee68313d4d1c79b3be4b84edf764eef1060 100644
--- a/packages/tailwindcss-language-service/src/codeActions/provideSuggestionCodeActions.ts
+++ b/packages/tailwindcss-language-service/src/codeActions/provideSuggestionCodeActions.ts
@@ -5,7 +5,7 @@ InvalidConfigPathDiagnostic,
InvalidTailwindDirectiveDiagnostic,
InvalidScreenDiagnostic,
InvalidVariantDiagnostic,
- IncorrectVariantOrderDiagnostic,
+ RecommendedVariantOrderDiagnostic,
} from '../diagnostics/types'
export function provideSuggestionCodeActions(
@@ -16,7 +16,7 @@ | InvalidConfigPathDiagnostic
| InvalidTailwindDirectiveDiagnostic
| InvalidScreenDiagnostic
| InvalidVariantDiagnostic
- | IncorrectVariantOrderDiagnostic
+ | RecommendedVariantOrderDiagnostic
): CodeAction[] {
return diagnostic.suggestions.map((suggestion) => ({
title: `Replace with '${suggestion}'`,
diff --git a/packages/tailwindcss-language-service/src/diagnostics/diagnosticsProvider.ts b/packages/tailwindcss-language-service/src/diagnostics/diagnosticsProvider.ts
index 9b883d649e457e576a45de98f445f027e8cfb33d..5ef686a605e75066a8c177eff5d969e790942ebc 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/diagnosticsProvider.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/diagnosticsProvider.ts
@@ -7,7 +7,7 @@ import { getInvalidScreenDiagnostics } from './getInvalidScreenDiagnostics'
import { getInvalidVariantDiagnostics } from './getInvalidVariantDiagnostics'
import { getInvalidConfigPathDiagnostics } from './getInvalidConfigPathDiagnostics'
import { getInvalidTailwindDirectiveDiagnostics } from './getInvalidTailwindDirectiveDiagnostics'
-import { getIncorrectVariantOrderDiagnostics } from './getIncorrectVariantOrderDiagnostics'
+import { getRecommendedVariantOrderDiagnostics } from './getRecommendedVariantOrderDiagnostics'
export async function doValidate(
state: State,
@@ -19,7 +19,7 @@ DiagnosticKind.InvalidScreen,
DiagnosticKind.InvalidVariant,
DiagnosticKind.InvalidConfigPath,
DiagnosticKind.InvalidTailwindDirective,
- DiagnosticKind.IncorrectVariantOrder,
+ DiagnosticKind.RecommendedVariantOrder,
]
): Promise<AugmentedDiagnostic[]> {
const settings = await state.editor.getConfiguration(document.uri)
@@ -44,9 +44,9 @@ : []),
...(only.includes(DiagnosticKind.InvalidTailwindDirective)
? getInvalidTailwindDirectiveDiagnostics(state, document, settings)
: []),
-import { getCssConflictDiagnostics } from './getCssConflictDiagnostics'
+import { getInvalidScreenDiagnostics } from './getInvalidScreenDiagnostics'
import type { TextDocument } from 'vscode-languageserver'
-import { getCssConflictDiagnostics } from './getCssConflictDiagnostics'
+import { getInvalidScreenDiagnostics } from './getInvalidScreenDiagnostics'
import { State } from '../util/state'
: []),
]
diff --git a/packages/tailwindcss-language-service/src/diagnostics/getIncorrectVariantOrderDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts
rename from packages/tailwindcss-language-service/src/diagnostics/getIncorrectVariantOrderDiagnostics.ts
rename to packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts
index 1d77656f270334697644c534b0360efbe4b045c3..bfcd601cab369acff2231fece7f925f859b40805 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getIncorrectVariantOrderDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts
@@ -1,23 +1,24 @@
import { State, Settings } from '../util/state'
import type { TextDocument } from 'vscode-languageserver'
-import { IncorrectVariantOrderDiagnostic, DiagnosticKind } from './types'
+import { RecommendedVariantOrderDiagnostic, DiagnosticKind } from './types'
import { findClassListsInDocument, getClassNamesInClassList } from '../util/find'
import * as jit from '../util/jit'
import { getVariantsFromClassName } from '../util/getVariantsFromClassName'
import { equalExact } from '../util/array'
+import { findClassListsInDocument, getClassNamesInClassList } from '../util/find'
export async function getIncorrectVariantOrderDiagnostics(
state: State,
document: TextDocument,
settings: Settings
-): Promise<IncorrectVariantOrderDiagnostic[]> {
+): Promise<RecommendedVariantOrderDiagnostic[]> {
if (!state.jit) return []
-import { State, Settings } from '../util/state'
import * as jit from '../util/jit'
+import { State, Settings } from '../util/state'
if (severity === 'ignore') return []
- let diagnostics: IncorrectVariantOrderDiagnostic[] = []
+ let diagnostics: RecommendedVariantOrderDiagnostic[] = []
const classLists = await findClassListsInDocument(state, document)
classLists.forEach((classList) => {
@@ -35,8 +36,8 @@ )
if (!equalExact(variants, sortedVariants)) {
diagnostics.push({
+import * as jit from '../util/jit'
import { IncorrectVariantOrderDiagnostic, DiagnosticKind } from './types'
-import type { TextDocument } from 'vscode-languageserver'
suggestions: [
[...sortedVariants, className.className.substr(offset)].join(state.separator),
],
diff --git a/packages/tailwindcss-language-service/src/diagnostics/types.ts b/packages/tailwindcss-language-service/src/diagnostics/types.ts
index 9f169d29896b88041e9406b120f718a1be204f9d..6f1bc8584a5ba04b343dd17be18077af4be855ad 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/types.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/types.ts
@@ -8,7 +8,7 @@ InvalidScreen = 'invalidScreen',
InvalidVariant = 'invalidVariant',
InvalidConfigPath = 'invalidConfigPath',
InvalidTailwindDirective = 'invalidTailwindDirective',
- IncorrectVariantOrder = 'incorrectVariantOrder',
+ RecommendedVariantOrder = 'recommendedVariantOrder',
}
export type CssConflictDiagnostic = Diagnostic & {
@@ -78,16 +78,16 @@ ): diagnostic is InvalidTailwindDirectiveDiagnostic {
return diagnostic.code === DiagnosticKind.InvalidTailwindDirective
}
-export type IncorrectVariantOrderDiagnostic = Diagnostic & {
+export type RecommendedVariantOrderDiagnostic = Diagnostic & {
- code: DiagnosticKind.IncorrectVariantOrder
+ code: DiagnosticKind.RecommendedVariantOrder
suggestions: string[]
}
-export function isIncorrectVariantOrderDiagnostic(
+export function isRecommendedVariantOrderDiagnostic(
diagnostic: AugmentedDiagnostic
-): diagnostic is IncorrectVariantOrderDiagnostic {
+): diagnostic is RecommendedVariantOrderDiagnostic {
+ InvalidApply = 'invalidApply',
CssConflict = 'cssConflict',
-import type { Diagnostic } from 'vscode-languageserver'
}
export type AugmentedDiagnostic =
@@ -97,4 +97,4 @@ | InvalidScreenDiagnostic
| InvalidVariantDiagnostic
| InvalidConfigPathDiagnostic
| InvalidTailwindDirectiveDiagnostic
- | IncorrectVariantOrderDiagnostic
+ | RecommendedVariantOrderDiagnostic
diff --git a/packages/tailwindcss-language-service/src/util/state.ts b/packages/tailwindcss-language-service/src/util/state.ts
index 5756b72f9b8e6e63f23ba8cc16b8592dc38cb542..72dc427f2cfb7a07bb3acde476a4d482bbfe9766 100644
--- a/packages/tailwindcss-language-service/src/util/state.ts
+++ b/packages/tailwindcss-language-service/src/util/state.ts
@@ -48,7 +48,7 @@ invalidScreen: DiagnosticSeveritySetting
invalidVariant: DiagnosticSeveritySetting
invalidConfigPath: DiagnosticSeveritySetting
invalidTailwindDirective: DiagnosticSeveritySetting
- incorrectVariantOrder: DiagnosticSeveritySetting
+ recommendedVariantOrder: DiagnosticSeveritySetting
}
experimental: {
classRegex: string[]