|
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