tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
rename utilityConflicts lint rule
8 changed files, 27 additions(+), 27 deletions(-)
diff --git a/package.json b/package.json
index eb1c050d8f60b87d9618f8b283483c7fd465a8c4..8f3ce0e7323924f8ec28fc5f58f73b746d7b4ac1 100755
--- a/package.json
+++ b/package.json
@@ -76,7 +76,7 @@ "default": true,
"markdownDescription": "Enable linting",
"scope": "language-overridable"
},
- "tailwindCSS.lint.utilityConflicts": {
+ "tailwindCSS.lint.cssConflict": {
"type": "string",
"enum": [
"ignore",
diff --git a/src/lsp/providers/codeActions/codeActionProvider.ts b/src/lsp/providers/codeActions/codeActionProvider.ts
index 1ad8c557040e553c6d546be503df3ad396ba6f89..19420f68ca37f549bac335634c81d8b5d3119af1 100644
--- a/src/lsp/providers/codeActions/codeActionProvider.ts
+++ b/src/lsp/providers/codeActions/codeActionProvider.ts
@@ -6,14 +6,14 @@ import {
DiagnosticKind,
isInvalidApplyDiagnostic,
AugmentedDiagnostic,
- isUtilityConflictsDiagnostic,
+ isCssConflictDiagnostic,
isInvalidConfigPathDiagnostic,
isInvalidTailwindDirectiveDiagnostic,
isInvalidScreenDiagnostic,
isInvalidVariantDiagnostic,
} from '../diagnostics/types'
import { flatten, dedupeBy } from '../../../util/array'
-import { provideUtilityConflictsCodeActions } from './provideUtilityConflictsCodeActions'
+import { provideCssConflictCodeActions } from './provideCssConflictCodeActions'
import { provideInvalidApplyCodeActions } from './provideInvalidApplyCodeActions'
import { provideSuggestionCodeActions } from './provideSuggestionCodeActions'
@@ -56,8 +56,8 @@ if (isInvalidApplyDiagnostic(diagnostic)) {
return provideInvalidApplyCodeActions(state, params, diagnostic)
}
- if (isUtilityConflictsDiagnostic(diagnostic)) {
- return provideUtilityConflictsCodeActions(state, params, diagnostic)
+ if (isCssConflictDiagnostic(diagnostic)) {
+ return provideCssConflictCodeActions(state, params, diagnostic)
}
if (
diff --git a/src/lsp/providers/codeActions/provideUtilityConflictsCodeActions.ts b/src/lsp/providers/codeActions/provideCssConflictCodeActions.ts
rename from src/lsp/providers/codeActions/provideUtilityConflictsCodeActions.ts
rename to src/lsp/providers/codeActions/provideCssConflictCodeActions.ts
index 007cd88bcd1c777298102f6e73260f3c62ea0178..f6a6edb159000f7e53aae3c88e6b7fef94d08b70 100644
--- a/src/lsp/providers/codeActions/provideUtilityConflictsCodeActions.ts
+++ b/src/lsp/providers/codeActions/provideCssConflictCodeActions.ts
@@ -4,14 +4,14 @@ CodeActionParams,
CodeAction,
CodeActionKind,
} from 'vscode-languageserver'
-import { UtilityConflictsDiagnostic } from '../diagnostics/types'
+import { CssConflictDiagnostic } from '../diagnostics/types'
import { joinWithAnd } from '../../util/joinWithAnd'
import { removeRangesFromString } from '../../util/removeRangesFromString'
-export async function provideUtilityConflictsCodeActions(
+export async function provideCssConflictCodeActions(
_state: State,
params: CodeActionParams,
- diagnostic: UtilityConflictsDiagnostic
+ diagnostic: CssConflictDiagnostic
): Promise<CodeAction[]> {
return [
{
diff --git a/src/lsp/providers/diagnostics/diagnosticsProvider.ts b/src/lsp/providers/diagnostics/diagnosticsProvider.ts
index 60956f0dd34ff63f5973d6308cd5fc47f59bfcea..a22f8460e8c1eef13c3db52052b37d051a58797a 100644
--- a/src/lsp/providers/diagnostics/diagnosticsProvider.ts
+++ b/src/lsp/providers/diagnostics/diagnosticsProvider.ts
@@ -2,7 +2,7 @@ import { TextDocument } from 'vscode-languageserver'
import { State } from '../../util/state'
import { getDocumentSettings } from '../../util/getDocumentSettings'
import { DiagnosticKind, AugmentedDiagnostic } from './types'
-import { getUtilityConflictDiagnostics } from './getUtilityConflictDiagnostics'
+import { getCssConflictDiagnostics } from './getCssConflictDiagnostics'
import { getInvalidApplyDiagnostics } from './getInvalidApplyDiagnostics'
import { getInvalidScreenDiagnostics } from './getInvalidScreenDiagnostics'
import { getInvalidVariantDiagnostics } from './getInvalidVariantDiagnostics'
@@ -13,7 +13,7 @@ export async function getDiagnostics(
state: State,
document: TextDocument,
only: DiagnosticKind[] = [
- DiagnosticKind.UtilityConflicts,
+ DiagnosticKind.CssConflict,
DiagnosticKind.InvalidApply,
DiagnosticKind.InvalidScreen,
DiagnosticKind.InvalidVariant,
@@ -25,8 +25,8 @@ const settings = await getDocumentSettings(state, document)
return settings.validate
? [
- ...(only.includes(DiagnosticKind.UtilityConflicts)
- ? getUtilityConflictDiagnostics(state, document, settings)
+ ...(only.includes(DiagnosticKind.CssConflict)
+ ? getCssConflictDiagnostics(state, document, settings)
: []),
...(only.includes(DiagnosticKind.InvalidApply)
? getInvalidApplyDiagnostics(state, document, settings)
diff --git a/src/lsp/providers/diagnostics/getUtilityConflictDiagnostics.ts b/src/lsp/providers/diagnostics/getCssConflictDiagnostics.ts
rename from src/lsp/providers/diagnostics/getUtilityConflictDiagnostics.ts
rename to src/lsp/providers/diagnostics/getCssConflictDiagnostics.ts
index 80216e09d137b326a30211fcb7283dc32c2fea8d..73da4869da22efd201be30ab434b9f61a0a5b3b6 100644
--- a/src/lsp/providers/diagnostics/getUtilityConflictDiagnostics.ts
+++ b/src/lsp/providers/diagnostics/getCssConflictDiagnostics.ts
@@ -1,7 +1,7 @@
import { joinWithAnd } from '../../util/joinWithAnd'
import { State, Settings } from '../../util/state'
import { TextDocument, DiagnosticSeverity } from 'vscode-languageserver'
-import { UtilityConflictsDiagnostic, DiagnosticKind } from './types'
+import { CssConflictDiagnostic, DiagnosticKind } from './types'
import {
findClassListsInDocument,
getClassNamesInClassList,
@@ -10,15 +10,15 @@ import { getClassNameDecls } from '../../util/getClassNameDecls'
import { getClassNameMeta } from '../../util/getClassNameMeta'
import { equal } from '../../../util/array'
-export function getUtilityConflictDiagnostics(
+export function getCssConflictDiagnostics(
state: State,
document: TextDocument,
settings: Settings
-): UtilityConflictsDiagnostic[] {
- let severity = settings.lint.utilityConflicts
+): CssConflictDiagnostic[] {
+ let severity = settings.lint.cssConflict
if (severity === 'ignore') return []
- let diagnostics: UtilityConflictsDiagnostic[] = []
+ let diagnostics: CssConflictDiagnostic[] = []
const classLists = findClassListsInDocument(state, document)
classLists.forEach((classList) => {
@@ -51,7 +51,7 @@
if (conflictingClassNames.length === 0) return
diagnostics.push({
- code: DiagnosticKind.UtilityConflicts,
+ code: DiagnosticKind.CssConflict,
className,
otherClassNames: conflictingClassNames,
range: className.range,
diff --git a/src/lsp/providers/diagnostics/types.ts b/src/lsp/providers/diagnostics/types.ts
index 385aac55033657c115363d37bf2c00414d581a60..1cfd0e2b4d4b26b543776be2c4810661b799f6c2 100644
--- a/src/lsp/providers/diagnostics/types.ts
+++ b/src/lsp/providers/diagnostics/types.ts
@@ -2,7 +2,7 @@ import { Diagnostic } from 'vscode-languageserver'
import { DocumentClassName, DocumentClassList } from '../../util/state'
export enum DiagnosticKind {
- UtilityConflicts = 'utilityConflicts',
+ CssConflict = 'cssConflict',
InvalidApply = 'invalidApply',
InvalidScreen = 'invalidScreen',
InvalidVariant = 'invalidVariant',
@@ -10,16 +10,16 @@ InvalidConfigPath = 'invalidConfigPath',
InvalidTailwindDirective = 'invalidTailwindDirective',
}
-export type UtilityConflictsDiagnostic = Diagnostic & {
- code: DiagnosticKind.UtilityConflicts
+export type CssConflictDiagnostic = Diagnostic & {
+ code: DiagnosticKind.CssConflict
className: DocumentClassName
otherClassNames: DocumentClassName[]
}
-export function isUtilityConflictsDiagnostic(
+export function isCssConflictDiagnostic(
diagnostic: AugmentedDiagnostic
-): diagnostic is UtilityConflictsDiagnostic {
- return diagnostic.code === DiagnosticKind.UtilityConflicts
+): diagnostic is CssConflictDiagnostic {
+ return diagnostic.code === DiagnosticKind.CssConflict
}
export type InvalidApplyDiagnostic = Diagnostic & {
@@ -78,7 +78,7 @@ return diagnostic.code === DiagnosticKind.InvalidTailwindDirective
}
export type AugmentedDiagnostic =
- | UtilityConflictsDiagnostic
+ | CssConflictDiagnostic
| InvalidApplyDiagnostic
| InvalidScreenDiagnostic
| InvalidVariantDiagnostic
diff --git a/src/lsp/server.ts b/src/lsp/server.ts
index d543c304df5ad3c9d358ac820cd530ea6e4b5bb6..cc85ae4662a1e6cbc4a8af47df121dd7acdb8f31 100644
--- a/src/lsp/server.ts
+++ b/src/lsp/server.ts
@@ -46,7 +46,7 @@ emmetCompletions: false,
includeLanguages: {},
validate: true,
lint: {
- utilityConflicts: 'warning',
+ cssConflict: 'warning',
invalidApply: 'error',
invalidScreen: 'error',
invalidVariant: 'error',
diff --git a/src/lsp/util/state.ts b/src/lsp/util/state.ts
index 4158c590762e6acb60bcfdc865a0f96c44816326..09a02006721913e72c3a576ee1c30f997476c6b5 100644
--- a/src/lsp/util/state.ts
+++ b/src/lsp/util/state.ts
@@ -33,7 +33,7 @@ emmetCompletions: boolean
includeLanguages: Record<string, string>
validate: boolean
lint: {
- utilityConflicts: DiagnosticSeveritySetting
+ cssConflict: DiagnosticSeveritySetting
invalidApply: DiagnosticSeveritySetting
invalidScreen: DiagnosticSeveritySetting
invalidVariant: DiagnosticSeveritySetting