Skip to content

Commit f33d636

Browse files
authored
Merge pull request #448 from pranaysashank/master
Create output channel only if there are no existing clients.
2 parents abd7b6f + 16ee42a commit f33d636

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/extension.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,21 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
150150
const clientsKey = folder ? folder.uri.toString() : uri.toString();
151151
// Set a unique name per workspace folder (useful for multi-root workspaces).
152152
const langName = 'Haskell' + (folder ? ` (${folder.name})` : '');
153-
const outputChannel: OutputChannel = window.createOutputChannel(langName);
154153

155154
// If the client already has an LSP server for this uri/folder, then don't start a new one.
156155
if (clients.has(clientsKey)) {
157156
return;
158157
}
158+
159159
// Set the key to null to prevent multiple servers being launched at once
160160
clients.set(clientsKey, null);
161161

162162
const logLevel = workspace.getConfiguration('haskell', uri).trace.server;
163163
const clientLogLevel = workspace.getConfiguration('haskell', uri).trace.client;
164164
const logFile = workspace.getConfiguration('haskell', uri).logFile;
165165

166+
const outputChannel: OutputChannel = window.createOutputChannel(langName);
167+
166168
const logger: Logger = new ExtensionLogger('client', clientLogLevel, outputChannel);
167169

168170
let serverExecutable;

0 commit comments

Comments
 (0)