File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
tailwindcss-language-server/src
tailwindcss-language-service/src/util Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import type {
4545 Settings ,
4646 ClassNames ,
4747 Variant ,
48+ ClassEntry ,
4849} from '@tailwindcss/language-service/src/util/state'
4950import { provideDiagnostics } from './lsp/diagnosticsProvider'
5051import { doCodeActions } from '@tailwindcss/language-service/src/codeActions/codeActionProvider'
@@ -1014,7 +1015,7 @@ export async function createProjectService(
10141015 } ,
10151016 } )
10161017
1017- let classList = designSystem . getClassList ( ) . map ( ( className ) => {
1018+ let classList : ClassEntry [ ] = designSystem . getClassList ( ) . map ( ( className ) => {
10181019 return [
10191020 className [ 0 ] ,
10201021 {
@@ -1025,7 +1026,8 @@ export async function createProjectService(
10251026 } )
10261027
10271028 state . designSystem = designSystem
1028- state . classList = classList as any
1029+ state . classList = classList
1030+ state . variants = getVariants ( state )
10291031
10301032 console . log ( '---- RELOADED ----' )
10311033 } ,
Original file line number Diff line number Diff line change @@ -89,6 +89,13 @@ export interface Variant {
8989 selectors : ( params ?: { value ?: string ; label ?: string } ) => string [ ]
9090}
9191
92+ export interface ClassMetadata {
93+ color : culori . Color | KeywordColor | null
94+ modifiers ?: string [ ]
95+ }
96+
97+ export type ClassEntry = [ string , ClassMetadata ]
98+
9299export interface State {
93100 enabled : boolean
94101 isCssConfig ?: boolean
@@ -127,7 +134,7 @@ export interface State {
127134 editor ?: EditorState
128135 jit ?: boolean
129136 jitContext ?: any
130- classList ?: Array < [ string , { color : culori . Color | KeywordColor | null ; modifiers ?: string [ ] } ] >
137+ classList ?: ClassEntry [ ]
131138 classListContainsMetadata ?: boolean
132139 pluginVersions ?: string
133140 completionItemData ?: Record < string , any >
Original file line number Diff line number Diff line change 22
33## Prerelease
44
5- - Nothing yet!
5+ - Reload variants when editing the theme in v4 ( [ # 1094 ] ( https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1094 ) )
66
77## 0.12.14
88
You can’t perform that action at this time.
0 commit comments