Skip to content

Commit 829f3ee

Browse files
committed
add a message to let users know where pylance output window is
1 parent 6827afb commit 829f3ee

File tree

8 files changed

+567
-533
lines changed

8 files changed

+567
-533
lines changed

src/client/activation/node/languageServerProxy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
1717
import { EventName } from '../../telemetry/constants';
1818
import { FileBasedCancellationStrategy } from '../common/cancellationUtils';
1919
import { ProgressReporting } from '../progress';
20-
import { ILanguageClientFactory, ILanguageServerProxy } from '../types';
20+
import { ILanguageClientFactory, ILanguageServerOutputChannel, ILanguageServerProxy } from '../types';
2121
import { traceDecoratorError, traceDecoratorVerbose, traceError } from '../../logging';
2222
import { IWorkspaceService } from '../../common/application/types';
2323
import { PYLANCE_EXTENSION_ID } from '../../common/constants';
2424
import { PylanceApi } from './pylanceApi';
25+
import { Pylance } from '../../common/utils/localize';
2526

2627
// eslint-disable-next-line @typescript-eslint/no-namespace
2728
namespace InExperiment {
@@ -67,6 +68,7 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
6768
private readonly environmentService: IEnvironmentVariablesProvider,
6869
private readonly workspace: IWorkspaceService,
6970
private readonly extensions: IExtensions,
71+
private readonly lsOutputChannel: ILanguageServerOutputChannel,
7072
) {}
7173

7274
private static versionTelemetryProps(instance: NodeLanguageServerProxy) {
@@ -100,6 +102,7 @@ export class NodeLanguageServerProxy implements ILanguageServerProxy {
100102
if (api && api.client && api.client.isEnabled()) {
101103
this.pylanceApi = api;
102104
await api.client.start();
105+
this.lsOutputChannel.channel.appendLine(Pylance.pylanceOutputChannelMessage);
103106
return;
104107
}
105108

src/client/api.ts

Lines changed: 170 additions & 169 deletions
Large diffs are not rendered by default.

src/client/browser/api.ts

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
2-
// Licensed under the MIT License.
3-
4-
'use strict';
5-
6-
import { BaseLanguageClient } from 'vscode-languageclient';
7-
import { LanguageClient } from 'vscode-languageclient/browser';
8-
import { PYTHON_LANGUAGE } from '../common/constants';
9-
import { ApiForPylance, TelemetryReporter } from '../pylanceApi';
10-
11-
export interface IBrowserExtensionApi {
12-
/**
13-
* @deprecated Temporarily exposed for Pylance until we expose this API generally. Will be removed in an
14-
* iteration or two.
15-
*/
16-
pylance: ApiForPylance;
17-
}
18-
19-
export function buildApi(reporter: TelemetryReporter): IBrowserExtensionApi {
20-
const api: IBrowserExtensionApi = {
21-
pylance: {
22-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
23-
createClient: (...args: any[]): BaseLanguageClient =>
24-
new LanguageClient(PYTHON_LANGUAGE, 'Python Language Server', args[0], args[1]),
25-
start: (client: BaseLanguageClient): Promise<void> => client.start(),
26-
stop: (client: BaseLanguageClient): Promise<void> => client.stop(),
27-
getTelemetryReporter: () => reporter,
28-
},
29-
};
30-
31-
return api;
32-
}
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
'use strict';
5+
6+
import { BaseLanguageClient } from 'vscode-languageclient';
7+
import { LanguageClient } from 'vscode-languageclient/browser';
8+
import { PYTHON_LANGUAGE } from '../common/constants';
9+
import { ApiForPylance, TelemetryReporter } from '../pylanceApi';
10+
11+
export interface IBrowserExtensionApi {
12+
/**
13+
* @deprecated Temporarily exposed for Pylance until we expose this API generally. Will be removed in an
14+
* iteration or two.
15+
*/
16+
pylance: ApiForPylance;
17+
}
18+
19+
export function buildApi(reporter: TelemetryReporter): IBrowserExtensionApi {
20+
const api: IBrowserExtensionApi = {
21+
pylance: {
22+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
23+
// deprecated
24+
createClient: (...args: any[]): BaseLanguageClient =>
25+
new LanguageClient(PYTHON_LANGUAGE, 'Python Language Server', args[0], args[1]),
26+
start: (client: BaseLanguageClient): Promise<void> => client.start(),
27+
stop: (client: BaseLanguageClient): Promise<void> => client.stop(),
28+
getTelemetryReporter: () => reporter,
29+
},
30+
};
31+
32+
return api;
33+
}

0 commit comments

Comments
 (0)