only create output channel when needed
parent
c6c2abf15e
commit
da69936f11
|
@ -43,7 +43,8 @@
|
|||
"commands": [
|
||||
{
|
||||
"command": "tailwindCSS.showOutput",
|
||||
"title": "Tailwind CSS: Show Output"
|
||||
"title": "Tailwind CSS: Show Output",
|
||||
"enablement": "tailwindCSS.hasOutputChannel"
|
||||
}
|
||||
],
|
||||
"grammars": [
|
||||
|
|
|
@ -85,11 +85,13 @@ function getUserLanguages(folder?: WorkspaceFolder): Record<string, string> {
|
|||
|
||||
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', () => {
|
||||
if (outputChannel) {
|
||||
outputChannel.show()
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
|
@ -155,6 +157,11 @@ export function activate(context: ExtensionContext) {
|
|||
)
|
||||
}
|
||||
|
||||
if (!outputChannel) {
|
||||
outputChannel = Window.createOutputChannel(CLIENT_NAME)
|
||||
commands.executeCommand('setContext', 'tailwindCSS.hasOutputChannel', true)
|
||||
}
|
||||
|
||||
let serverOptions: ServerOptions = {
|
||||
run: { module, transport: TransportKind.ipc },
|
||||
debug: {
|
||||
|
|
Loading…
Reference in New Issue