Skip to content

Commit 3599c32

Browse files
committed
add outputchannel
1 parent 6827afb commit 3599c32

File tree

22 files changed

+4704
-4696
lines changed

22 files changed

+4704
-4696
lines changed

.vscode/launch.json

Lines changed: 262 additions & 262 deletions
Large diffs are not rendered by default.
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# Install Python on Linux
2-
3-
To install the latest version of Python on [Debian-based Linux distributions](https://www.debian.org/), you can create a new terminal (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>`</kbd>) and run the following commands:
4-
5-
6-
```
7-
sudo apt-get update
8-
sudo apt-get install python3 python3-venv python3-pip
9-
```
10-
11-
For [Fedora-based Linux distributions](https://getfedora.org/), you can run the following:
12-
13-
```
14-
sudo dnf install python3
15-
```
16-
17-
To verify if Python was successfully installed, run the following command in the terminal:
18-
19-
20-
```
21-
python3 --version
22-
```
1+
# Install Python on Linux
2+
3+
To install the latest version of Python on [Debian-based Linux distributions](https://www.debian.org/), you can create a new terminal (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>`</kbd>) and run the following commands:
4+
5+
6+
```
7+
sudo apt-get update
8+
sudo apt-get install python3 python3-venv python3-pip
9+
```
10+
11+
For [Fedora-based Linux distributions](https://getfedora.org/), you can run the following:
12+
13+
```
14+
sudo dnf install python3
15+
```
16+
17+
To verify if Python was successfully installed, run the following command in the terminal:
18+
19+
20+
```
21+
python3 --version
22+
```
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Install Python on macOS
2-
3-
If you have [Homebrew](https://brew.sh/) installed, you can install Python by running the following command in the terminal (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>`</kbd>):
4-
5-
```
6-
brew install python3
7-
```
8-
9-
If you don't have Homebrew, you can download a Python installer for macOS from [python.org](https://www.python.org/downloads/mac-osx/).
10-
11-
To verify if Python was successfully installed, run the following command in the terminal:
12-
13-
```
14-
python3 --version
15-
```
1+
# Install Python on macOS
2+
3+
If you have [Homebrew](https://brew.sh/) installed, you can install Python by running the following command in the terminal (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>`</kbd>):
4+
5+
```
6+
brew install python3
7+
```
8+
9+
If you don't have Homebrew, you can download a Python installer for macOS from [python.org](https://www.python.org/downloads/mac-osx/).
10+
11+
To verify if Python was successfully installed, run the following command in the terminal:
12+
13+
```
14+
python3 --version
15+
```

src/client/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ export function buildApi(
145145
},
146146
},
147147
pylance: {
148+
getOutputChannel: () => outputChannel.channel,
148149
createClient: (...args: any[]): BaseLanguageClient => {
149150
// Make sure we share output channel so that we can share one with
150151
// Jedi as well.

src/client/browser/api.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { BaseLanguageClient } from 'vscode-languageclient';
77
import { LanguageClient } from 'vscode-languageclient/browser';
88
import { PYTHON_LANGUAGE } from '../common/constants';
99
import { ApiForPylance, TelemetryReporter } from '../pylanceApi';
10+
import { LogOutputChannel } from 'vscode';
1011

1112
export interface IBrowserExtensionApi {
1213
/**
@@ -16,12 +17,14 @@ export interface IBrowserExtensionApi {
1617
pylance: ApiForPylance;
1718
}
1819

19-
export function buildApi(reporter: TelemetryReporter): IBrowserExtensionApi {
20+
export function buildApi(reporter: TelemetryReporter, outputChannel: LogOutputChannel): IBrowserExtensionApi {
2021
const api: IBrowserExtensionApi = {
2122
pylance: {
2223
// eslint-disable-next-line @typescript-eslint/no-explicit-any
24+
// deprecated
2325
createClient: (...args: any[]): BaseLanguageClient =>
2426
new LanguageClient(PYTHON_LANGUAGE, 'Python Language Server', args[0], args[1]),
27+
getOutputChannel: () => outputChannel,
2528
start: (client: BaseLanguageClient): Promise<void> => client.start(),
2629
stop: (client: BaseLanguageClient): Promise<void> => client.stop(),
2730
getTelemetryReporter: () => reporter,

src/client/browser/extension.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { EventName } from '../telemetry/constants';
1212
import { createStatusItem } from './intellisenseStatus';
1313
import { PylanceApi } from '../activation/node/pylanceApi';
1414
import { buildApi, IBrowserExtensionApi } from './api';
15+
import { OutputChannelNames } from '../common/utils/localize';
1516

1617
interface BrowserConfig {
1718
distUrl: string; // URL to Pylance's dist folder.
@@ -23,7 +24,8 @@ let pylanceApi: PylanceApi | undefined;
2324
export function activate(context: vscode.ExtensionContext): Promise<IBrowserExtensionApi> {
2425
const reporter = getTelemetryReporter();
2526

26-
const activationPromise = Promise.resolve(buildApi(reporter));
27+
const outputChannel = vscode.window.createOutputChannel(OutputChannelNames.python, { log: true });
28+
const activationPromise = Promise.resolve(buildApi(reporter, outputChannel));
2729
const pylanceExtension = vscode.extensions.getExtension<PylanceApi>(PYLANCE_EXTENSION_ID);
2830
if (pylanceExtension) {
2931
// Make sure we run pylance once we activated core extension.

0 commit comments

Comments
 (0)