File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/vscode-tailwindcss/src Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ interface ApiOptions {
7
7
}
8
8
9
9
export async function createApi ( { context, outputChannel } : ApiOptions ) {
10
+ let folderAnalysis : Promise < boolean > | null = null
11
+
10
12
async function workspaceNeedsLanguageServer ( ) {
13
+ if ( folderAnalysis ) return folderAnalysis
14
+
11
15
let source : CancellationTokenSource | null = new CancellationTokenSource ( )
12
16
source . token . onCancellationRequested ( ( ) => {
13
17
source ?. dispose ( )
@@ -22,7 +26,7 @@ export async function createApi({ context, outputChannel }: ApiOptions) {
22
26
setTimeout ( ( ) => source ?. cancel ( ) , 15_000 )
23
27
context . subscriptions . push ( source )
24
28
25
- folderAnalysis = anyWorkspaceFoldersNeedServer ( {
29
+ folderAnalysis ?? = anyWorkspaceFoldersNeedServer ( {
26
30
token : source . token ,
27
31
folders : workspace . workspaceFolders ?? [ ] ,
28
32
} )
You can’t perform that action at this time.
0 commit comments