Skip to content

Commit 7b45add

Browse files
committed
Remove Pylance create,start,stop and move language server output channel into Jedi and rename it from "Python Language Server" to "Jedi".. Pylance will now also create its own output window.
1 parent 6827afb commit 7b45add

18 files changed

+581
-1285
lines changed

src/client/activation/common/outputChannel.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,30 @@
66
import { inject, injectable } from 'inversify';
77
import { IApplicationShell, ICommandManager } from '../../common/application/types';
88
import '../../common/extensions';
9-
import { IDisposableRegistry, ILogOutputChannel } from '../../common/types';
9+
import { IDisposable, ILogOutputChannel } from '../../common/types';
1010
import { OutputChannelNames } from '../../common/utils/localize';
1111
import { ILanguageServerOutputChannel } from '../types';
1212

1313
@injectable()
1414
export class LanguageServerOutputChannel implements ILanguageServerOutputChannel {
1515
public output: ILogOutputChannel | undefined;
16-
16+
private disposables: IDisposable[] = [];
1717
private registered = false;
1818

1919
constructor(
2020
@inject(IApplicationShell) private readonly appShell: IApplicationShell,
2121
@inject(ICommandManager) private readonly commandManager: ICommandManager,
22-
@inject(IDisposableRegistry) private readonly disposable: IDisposableRegistry,
2322
) {}
2423

24+
public dispose(): void {
25+
this.disposables.forEach((d) => d && d.dispose());
26+
this.disposables = [];
27+
}
28+
2529
public get channel(): ILogOutputChannel {
2630
if (!this.output) {
27-
this.output = this.appShell.createOutputChannel(OutputChannelNames.languageServer);
28-
this.disposable.push(this.output);
31+
this.output = this.appShell.createOutputChannel(OutputChannelNames.JediLanguageServer);
32+
this.disposables.push(this.output);
2933
this.registerCommand().ignoreErrors();
3034
}
3135
return this.output;
@@ -39,10 +43,10 @@ export class LanguageServerOutputChannel implements ILanguageServerOutputChannel
3943
// This controls the visibility of the command used to display the LS Output panel.
4044
// We don't want to display it when Jedi is used instead of LS.
4145
await this.commandManager.executeCommand('setContext', 'python.hasLanguageServerOutputChannel', true);
42-
this.disposable.push(
46+
this.disposables.push(
4347
this.commandManager.registerCommand('python.viewLanguageServerOutput', () => this.output?.show(true)),
4448
);
45-
this.disposable.push({
49+
this.disposables.push({
4650
dispose: () => {
4751
this.registered = false;
4852
},

src/client/activation/node/languageServerProxy.ts

Lines changed: 0 additions & 236 deletions
This file was deleted.

0 commit comments

Comments
 (0)