File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
packages/tailwindcss-language-server Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,13 @@ export async function createProjectService(
469
469
log ( `supported features: ${ JSON . stringify ( features ) } ` )
470
470
state . features = features
471
471
472
+ if ( params . initializationOptions ?. testMode ) {
473
+ state . features = [
474
+ ...state . features ,
475
+ ...( params . initializationOptions . additionalFeatures ?? [ ] ) ,
476
+ ]
477
+ }
478
+
472
479
if ( ! features . includes ( 'css-at-theme' ) ) {
473
480
tailwindcss = tailwindcss . default ?? tailwindcss
474
481
}
@@ -695,6 +702,14 @@ export async function createProjectService(
695
702
state . v4Fallback = true
696
703
state . jit = true
697
704
state . features = features
705
+
706
+ if ( params . initializationOptions ?. testMode ) {
707
+ state . features = [
708
+ ...state . features ,
709
+ ...( params . initializationOptions . additionalFeatures ?? [ ] ) ,
710
+ ]
711
+ }
712
+
698
713
state . modules = {
699
714
tailwindcss : { version : tailwindcssVersion , module : tailwindcss } ,
700
715
postcss : { version : null , module : null } ,
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ import { clearLanguageBoundariesCache } from '@tailwindcss/language-service/src/
47
47
import { DefaultMap } from '../../src/util/default-map'
48
48
import { connect , ConnectOptions } from './connection'
49
49
import type { DeepPartial } from '@tailwindcss/language-service/src/types'
50
+ import type { Feature } from '@tailwindcss/language-service/src/features'
50
51
51
52
export interface DocumentDescriptor {
52
53
/**
@@ -170,6 +171,14 @@ export interface ClientOptions extends ConnectOptions {
170
171
* Settings to provide the server immediately when it starts
171
172
*/
172
173
settings ?: DeepPartial < Settings >
174
+
175
+ /**
176
+ * Additional features to force-enable
177
+ *
178
+ * These should normally be enabled by the server based on the project
179
+ * and the Tailwind CSS version it detects
180
+ */
181
+ features ?: Feature [ ]
173
182
}
174
183
175
184
export interface Client extends ClientWorkspace {
@@ -394,6 +403,7 @@ export async function createClient(opts: ClientOptions): Promise<Client> {
394
403
workspaceFolders,
395
404
initializationOptions : {
396
405
testMode : true ,
406
+ additionalFeatures : opts . features ,
397
407
...opts . options ,
398
408
} ,
399
409
} )
You can’t perform that action at this time.
0 commit comments