Skip to content

Commit 779e84f

Browse files
author
Aleksander Boruch-Gruszecki
committed
Create local output channel if tracing is disabled
Remember to actually check if zip URL is set before zipping. Checking if url is undefined was meaningless, since it now defaults to empty string (in package.json).
1 parent 4075b97 commit 779e84f

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

vscode-dotty/src/tracer.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,15 @@ export class Tracer {
8484

8585
run(): vscode.OutputChannel | undefined {
8686
const consentCommandDisposable = vscode.commands.registerCommand(consentCommandName, () => this.askForTracingConsent())
87-
if (this.isTracingEnabled) {
88-
if (this.tracingConsent.get() === 'no-answer') this.askForTracingConsent()
89-
this.initializeAsyncWorkspaceDump()
90-
91-
const lspOutputChannel = this.createLspOutputChannel()
92-
const statusBarItem = this.createStatusBarItem()
93-
for (const disposable of [consentCommandDisposable, lspOutputChannel, statusBarItem]) {
94-
if (disposable) this.ctx.extensionContext.subscriptions.push(disposable)
95-
}
96-
return lspOutputChannel
87+
if (this.isTracingEnabled && this.tracingConsent.get() === 'no-answer') this.askForTracingConsent()
88+
this.initializeAsyncWorkspaceDump()
89+
90+
const lspOutputChannel = this.createLspOutputChannel()
91+
const statusBarItem = this.createStatusBarItem()
92+
for (const disposable of [consentCommandDisposable, lspOutputChannel, statusBarItem]) {
93+
if (disposable) this.ctx.extensionContext.subscriptions.push(disposable)
9794
}
95+
return lspOutputChannel
9896
}
9997

10098
private askForTracingConsent(): void {
@@ -111,7 +109,7 @@ export class Tracer {
111109

112110
private initializeAsyncWorkspaceDump() {
113111
const url = this.remoteWorkspaceDumpUrl
114-
if (url === undefined) return
112+
if (!url) return
115113

116114
const doInitialize = () => {
117115
try {

0 commit comments

Comments
 (0)