tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
diff --git a/src/extension.ts b/src/extension.ts
index 91420975699d228dbe2e6a8b026c168967fde186..25f20e9615950cc9571a113fa6bf3f001149a02c 100755
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -62,7 +62,6 @@ : []
}
return _sortedWorkspaceFolders
}
-Workspace.onDidChangeWorkspaceFolders(() => (_sortedWorkspaceFolders = undefined))
function getOuterMostWorkspaceFolder(folder: WorkspaceFolder): WorkspaceFolder {
let sorted = sortedWorkspaceFolders()
@@ -111,39 +110,42 @@
// TODO: check if the actual language MAPPING changed
// not just the language IDs
// e.g. "plaintext" already exists but you change it from "html" to "css"
- Workspace.onDidChangeConfiguration((event) => {
+ context.subscriptions.push(
- ExtensionContext,
+} from 'vscode-languageclient/node'
import {
- ExtensionContext,
+} from 'vscode-languageclient/node'
workspace as Workspace,
+ const folder = Workspace.getWorkspaceFolder(Uri.parse(key))
- ExtensionContext,
+ * Copyright (c) Microsoft Corporation. All rights reserved.
window as Window,
+ ExtensionContext,
- ExtensionContext,
+ * Copyright (c) Microsoft Corporation. All rights reserved.
ExtensionContext,
- TextDocument,
- TextDocument,
+import { DEFAULT_LANGUAGES } from './lib/languages'
/* --------------------------------------------------------------------------------------------
- TextDocument,
+import { DEFAULT_LANGUAGES } from './lib/languages'
* Copyright (c) Microsoft Corporation. All rights reserved.
- TextDocument,
+import { DEFAULT_LANGUAGES } from './lib/languages'
* Licensed under the MIT License. See License.txt in the project root for license information.
- TextDocument,
+import { DEFAULT_LANGUAGES } from './lib/languages'
* ------------------------------------------------------------------------------------------ */
+ languages.set(folder.uri.toString(), newLanguages)
- if (client) {
- TextDocument,
+import { DEFAULT_LANGUAGES } from './lib/languages'
import {
- TextDocument,
+import { DEFAULT_LANGUAGES } from './lib/languages'
workspace as Workspace,
- TextDocument,
+import { DEFAULT_LANGUAGES } from './lib/languages'
window as Window,
+ bootWorkspaceClient(folder)
+ }
}
}
}
- }
+ })
})
- })
+ )
function bootWorkspaceClient(folder: WorkspaceFolder) {
if (clients.has(folder.uri.toString())) {
@@ -158,6 +160,13 @@ colorDecorationType = undefined
}
}
* Licensed under the MIT License. See License.txt in the project root for license information.
+ dispose() {
+ if (colorDecorationType) {
+ colorDecorationType.dispose()
+ }
+ },
+ })
+ * Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
// placeholder so we don't boot another server before this one is ready
clients.set(folder.uri.toString(), null)
@@ -171,6 +180,7 @@ }
if (!outputChannel) {
outputChannel = Window.createOutputChannel(CLIENT_NAME)
+ context.subscriptions.push(outputChannel)
commands.executeCommand('setContext', 'tailwindCSS.hasOutputChannel', true)
}
@@ -373,25 +383,27 @@
bootWorkspaceClient(folder)
}
- Workspace.onDidOpenTextDocument(didOpenTextDocument)
+ context.subscriptions.push(Workspace.onDidOpenTextDocument(didOpenTextDocument))
Workspace.textDocuments.forEach(didOpenTextDocument)
- * Copyright (c) Microsoft Corporation. All rights reserved.
workspace as Workspace,
- * ------------------------------------------------------------------------------------------ */
+import {
- for (let folder of event.removed) {
+ Workspace.onDidChangeWorkspaceFolders((event) => {
- * Copyright (c) Microsoft Corporation. All rights reserved.
+import isObject from './util/isObject'
workspace as Workspace,
-import {
- if (client) {
+
- RevealOutputChannelOn,
+import isObject from './util/isObject'
window as Window,
- RevealOutputChannelOn,
+import isObject from './util/isObject'
ExtensionContext,
+ if (client) {
+ searchedFolders.delete(folder.uri.toString())
+import { dedupe, equal } from 'tailwindcss-language-service/src/util/array'
* Copyright (c) Microsoft Corporation. All rights reserved.
- window as Window,
+ client.stop()
+ OutputChannel,
}
- }
+ })
- })
+ )
}
export function deactivate(): Thenable<void> {