Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
only create output channel when needed
Brad Cornes <bradlc41@gmail.com>
3 years ago
2 changed files, 11 additions(+), 3 deletions(-)
M package.json -> package.json
diff --git a/package.json b/package.json
index 96f7d1bfa13e975968be0acf741ca6fcda6aeac9..8bd1d610912c8453602f614a51bb899fa40ff347 100755
--- a/package.json
+++ b/package.json
@@ -43,7 +43,8 @@   "contributes": {
     "commands": [
       {
         "command": "tailwindCSS.showOutput",
-        "title": "Tailwind CSS: Show Output"
+        "title": "Tailwind CSS: Show Output",
+        "enablement": "tailwindCSS.hasOutputChannel"
       }
     ],
     "grammars": [
M src/extension.ts -> src/extension.ts
diff --git a/src/extension.ts b/src/extension.ts
index 11058efab6957c1e6e632d30957c086cb2a12414..91420975699d228dbe2e6a8b026c168967fde186 100755
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -85,11 +85,13 @@ }
 
 export function activate(context: ExtensionContext) {
   let module = context.asAbsolutePath(path.join('dist', 'server', 'index.js'))
-  let outputChannel: OutputChannel = Window.createOutputChannel(CLIENT_NAME)
+  let outputChannel: OutputChannel
 
   context.subscriptions.push(
     commands.registerCommand('tailwindCSS.showOutput', () => {
-      outputChannel.show()
+      if (outputChannel) {
+        outputChannel.show()
+      }
     })
   )
 
@@ -153,6 +155,11 @@       languages.set(
         folder.uri.toString(),
         dedupe([...DEFAULT_LANGUAGES, ...Object.keys(getUserLanguages(folder))])
       )
+    }
+
+    if (!outputChannel) {
+      outputChannel = Window.createOutputChannel(CLIENT_NAME)
+      commands.executeCommand('setContext', 'tailwindCSS.hasOutputChannel', true)
     }
 
     let serverOptions: ServerOptions = {