File tree 3 files changed +13
-4
lines changed
tailwindcss-language-server/src
tailwindcss-language-service/src/util
3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import type {
45
45
Settings ,
46
46
ClassNames ,
47
47
Variant ,
48
+ ClassEntry ,
48
49
} from '@tailwindcss/language-service/src/util/state'
49
50
import { provideDiagnostics } from './lsp/diagnosticsProvider'
50
51
import { doCodeActions } from '@tailwindcss/language-service/src/codeActions/codeActionProvider'
@@ -1014,7 +1015,7 @@ export async function createProjectService(
1014
1015
} ,
1015
1016
} )
1016
1017
1017
- let classList = designSystem . getClassList ( ) . map ( ( className ) => {
1018
+ let classList : ClassEntry [ ] = designSystem . getClassList ( ) . map ( ( className ) => {
1018
1019
return [
1019
1020
className [ 0 ] ,
1020
1021
{
@@ -1025,7 +1026,8 @@ export async function createProjectService(
1025
1026
} )
1026
1027
1027
1028
state . designSystem = designSystem
1028
- state . classList = classList as any
1029
+ state . classList = classList
1030
+ state . variants = getVariants ( state )
1029
1031
1030
1032
console . log ( '---- RELOADED ----' )
1031
1033
} ,
Original file line number Diff line number Diff line change @@ -89,6 +89,13 @@ export interface Variant {
89
89
selectors : ( params ?: { value ?: string ; label ?: string } ) => string [ ]
90
90
}
91
91
92
+ export interface ClassMetadata {
93
+ color : culori . Color | KeywordColor | null
94
+ modifiers ?: string [ ]
95
+ }
96
+
97
+ export type ClassEntry = [ string , ClassMetadata ]
98
+
92
99
export interface State {
93
100
enabled : boolean
94
101
isCssConfig ?: boolean
@@ -127,7 +134,7 @@ export interface State {
127
134
editor ?: EditorState
128
135
jit ?: boolean
129
136
jitContext ?: any
130
- classList ?: Array < [ string , { color : culori . Color | KeywordColor | null ; modifiers ?: string [ ] } ] >
137
+ classList ?: ClassEntry [ ]
131
138
classListContainsMetadata ?: boolean
132
139
pluginVersions ?: string
133
140
completionItemData ?: Record < string , any >
Original file line number Diff line number Diff line change 2
2
3
3
## Prerelease
4
4
5
- - Nothing yet!
5
+ - Reload variants when editing the theme in v4 ( [ # 1094 ] ( https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1094 ) )
6
6
7
7
## 0.12.14
8
8
You can’t perform that action at this time.
0 commit comments