Skip to content

Commit 7d059da

Browse files
author
Laurynas Grigutis
committed
Moved classFunctions option out of experimental
1 parent 3b4e04c commit 7d059da

File tree

5 files changed

+15
-18
lines changed

5 files changed

+15
-18
lines changed

packages/tailwindcss-language-service/src/completionProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,8 @@ async function provideClassAttributeCompletions(
747747

748748
let matches = matchClassAttributes(str, settings.classAttributes)
749749

750-
if (settings.experimental.classFunctions?.length) {
751-
matches.push(...matchClassFunctions(str, settings.experimental.classFunctions))
750+
if (settings.classFunctions?.length) {
751+
matches.push(...matchClassFunctions(str, settings.classFunctions))
752752
}
753753

754754
if (matches.length === 0) {

packages/tailwindcss-language-service/src/util/find.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,7 @@ function getTailwindSettingsForClassFunctions(): Parameters<typeof findClassList
284284
...defaultSettings,
285285
tailwindCSS: {
286286
...defaultSettings.tailwindCSS,
287-
experimental: {
288-
...defaultSettings.tailwindCSS.experimental,
289-
classFunctions: ['cva', 'cn'],
290-
},
287+
classFunctions: ['cva', 'cn'],
291288
},
292289
}),
293290
},

packages/tailwindcss-language-service/src/util/find.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ export async function findClassListsInHtmlRange(
183183
const settings = (await state.editor.getConfiguration(doc.uri)).tailwindCSS
184184
const matches = matchClassAttributes(text, settings.classAttributes)
185185

186-
if (settings.experimental.classFunctions?.length) {
187-
matches.push(...matchClassFunctions(text, settings.experimental.classFunctions))
186+
if (settings.classFunctions?.length) {
187+
matches.push(...matchClassFunctions(text, settings.classFunctions))
188188
}
189189

190190
const result: DocumentClassList[] = []

packages/tailwindcss-language-service/src/util/state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export type TailwindCssSettings = {
4646
emmetCompletions: boolean
4747
includeLanguages: Record<string, string>
4848
classAttributes: string[]
49+
classFunctions: string[]
4950
suggestions: boolean
5051
hovers: boolean
5152
codeActions: boolean
@@ -66,7 +67,6 @@ export type TailwindCssSettings = {
6667
experimental: {
6768
classRegex: string[] | [string, string][]
6869
configFile: string | Record<string, string | string[]> | null
69-
classFunctions: string[]
7070
}
7171
files: {
7272
exclude: string[]
@@ -180,6 +180,7 @@ export function getDefaultTailwindSettings() {
180180
inspectPort: null,
181181
emmetCompletions: false,
182182
classAttributes: ['class', 'className', 'ngClass', 'class:list'],
183+
classFunctions: [],
183184
codeActions: true,
184185
hovers: true,
185186
suggestions: true,
@@ -202,7 +203,6 @@ export function getDefaultTailwindSettings() {
202203
experimental: {
203204
classRegex: [],
204205
configFile: null,
205-
classFunctions: [],
206206
},
207207
},
208208
// Return this as const object that satisfies Settings to be able to see the exact default values we specify

packages/vscode-tailwindcss/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@
184184
],
185185
"markdownDescription": "The HTML attributes for which to provide class completions, hover previews, linting etc."
186186
},
187+
"tailwindCSS.classFunctions": {
188+
"type": "array",
189+
"items": {
190+
"type": "string"
191+
},
192+
"default": [],
193+
"markdownDescription": "The function names for which to provide class completions, hover previews, linting etc."
194+
},
187195
"tailwindCSS.suggestions": {
188196
"type": "boolean",
189197
"default": true,
@@ -304,14 +312,6 @@
304312
"default": null,
305313
"markdownDescription": "Manually specify the Tailwind config file or files that should be read to provide IntelliSense features. Can either be a single string value, or an object where each key is a config file path and each value is a glob or array of globs representing the set of files that the config file applies to."
306314
},
307-
"tailwindCSS.experimental.classFunctions": {
308-
"type": "array",
309-
"items": {
310-
"type": "string"
311-
},
312-
"default": [],
313-
"markdownDescription": "The function names for which to provide class completions, hover previews, linting etc."
314-
},
315315
"tailwindCSS.showPixelEquivalents": {
316316
"type": "boolean",
317317
"default": true,

0 commit comments

Comments
 (0)