File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/vscode-tailwindcss/src Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -534,6 +534,11 @@ export async function activate(context: ExtensionContext) {
534
534
}
535
535
}
536
536
537
+ /**
538
+ * Note that this method can fire *many* times even for documents that are
539
+ * not in a visible editor. It's critical that this doesn't start any
540
+ * expensive operations more than is necessary.
541
+ */
537
542
async function didOpenTextDocument ( document : TextDocument ) : Promise < void > {
538
543
if ( document . languageId === 'tailwindcss' ) {
539
544
servers . css . boot ( context , outputChannel )
@@ -544,8 +549,7 @@ export async function activate(context: ExtensionContext) {
544
549
return
545
550
}
546
551
547
- let uri = document . uri
548
- let folder = Workspace . getWorkspaceFolder ( uri )
552
+ let folder = Workspace . getWorkspaceFolder ( document . uri )
549
553
550
554
// Files outside a folder can't be handled. This might depend on the language.
551
555
// Single file languages like JSON might handle files outside the workspace folders.
@@ -555,6 +559,7 @@ export async function activate(context: ExtensionContext) {
555
559
}
556
560
557
561
context . subscriptions . push ( Workspace . onDidOpenTextDocument ( didOpenTextDocument ) )
562
+
558
563
Workspace . textDocuments . forEach ( didOpenTextDocument )
559
564
context . subscriptions . push (
560
565
Workspace . onDidChangeWorkspaceFolders ( async ( ) => {
You can’t perform that action at this time.
0 commit comments