Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
997635a
LS symbol providers
Jun 8, 2018
f6c6276
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jun 13, 2018
0a20fef
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jun 19, 2018
660a627
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jun 29, 2018
3813395
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jul 3, 2018
d4fd3ab
Different ready wait
Jul 4, 2018
3a0bea4
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jul 12, 2018
56bf688
Upgrade dependencies to latest LS
Jul 12, 2018
37f1154
Make open files only default
Jul 12, 2018
4092bcc
Turn off hash checks
Jul 12, 2018
49ec38a
Fix double progress display
Jul 12, 2018
f7e245b
Update packages
Jul 13, 2018
bdce0ff
Anchor dependencies
brettcannon Jul 13, 2018
969db02
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 6, 2018
13828ca
Merge master
Aug 6, 2018
5d45558
Add setting for diag throttling
Aug 6, 2018
70b13f7
Add MacOS version check
Aug 7, 2018
462ff7c
News
Aug 7, 2018
4e12b3c
Correct MacOS check and lay infra for Linux checks
Aug 8, 2018
0d3c066
Linux version check
Aug 8, 2018
925f663
Linux check
Aug 8, 2018
fef0e92
Simplify
Aug 8, 2018
2c7243c
Test prep
Aug 8, 2018
07dc2fa
Platform tests
Aug 8, 2018
cd970be
Mac compat tests
Aug 8, 2018
c63c904
Ubuntu tests
Aug 9, 2018
42ebdd1
Revert "Ubuntu tests"
Aug 9, 2018
d3c7acb
Revert "Mac compat tests"
Aug 9, 2018
d86997b
Revert "Platform tests"
Aug 9, 2018
5caca65
Revert "Test prep"
Aug 9, 2018
983cbeb
Revert "Simplify"
Aug 9, 2018
0f116cc
Revert "Linux check"
Aug 9, 2018
cfc9b2d
Revert "Linux version check"
Aug 9, 2018
4fe1052
Revert "Correct MacOS check and lay infra for Linux checks"
Aug 9, 2018
c8dedc3
Revert "News"
Aug 9, 2018
5e40775
Revert "Add MacOS version check"
Aug 9, 2018
e63479b
News
Aug 9, 2018
e44afad
Format
Aug 9, 2018
d7cd632
Undo
Aug 9, 2018
d70322c
Pass async startup option to LS
Aug 10, 2018
ed8ac1b
News for LS fixes
Aug 10, 2018
c000856
News for LS fixes
Aug 10, 2018
0abe7b3
Merge master
Aug 10, 2018
3bd21b1
Remove issue that is not fixed
Aug 10, 2018
a399fc4
Add news
Aug 10, 2018
f0ab109
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 10, 2018
6870109
News
Aug 10, 2018
adcd0ab
News
Aug 10, 2018
0756aef
News
Aug 13, 2018
9e40248
News
Aug 14, 2018
92df7f2
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 15, 2018
40bac62
Drop typeshed submodule
Aug 16, 2018
b2546d1
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 16, 2018
e0c4b87
Add settings to control LS output
Aug 16, 2018
1d1d7bf
News
Aug 16, 2018
8e11bea
Fix case
Aug 17, 2018
652ab22
Switch to 1.26 and LSP 4.4 for outline
Aug 20, 2018
2e92432
Merge branch 'master' of https://github.com/MikhailArkhipov/vscode-py…
Aug 20, 2018
83c356d
News
Aug 20, 2018
8c63050
News
Aug 20, 2018
797941b
Add package lock
Aug 20, 2018
e24c7e5
Update mock to 1.26
Aug 20, 2018
c3334c8
Tweak news entry wording
brettcannon Aug 21, 2018
a8b21ef
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 21, 2018
e71199c
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 24, 2018
613fd49
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 27, 2018
f3a08aa
Move rope rename off common to Jedi
Aug 27, 2018
c51936c
Move Rename to LS
Aug 30, 2018
f67cbfa
Ref fix
Aug 30, 2018
d7f7ea6
Merge master
Sep 6, 2018
f4353dd
Update LS contrib
Sep 6, 2018
1b33dde
Merge issue
Sep 6, 2018
bfdc24a
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Sep 13, 2018
1187d7e
Make sure progress is cleared
Sep 13, 2018
1d19d2f
Revert "Make sure progress is cleared"
Sep 18, 2018
636b31b
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Sep 18, 2018
0eb40d4
Merge branch 'rename'
Sep 18, 2018
1471e90
Line breaks and remove duplication
Sep 18, 2018
0b532c0
Add news
Sep 20, 2018
9f79830
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Sep 22, 2018
70ddfd0
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Sep 30, 2018
0db5d74
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Oct 3, 2018
7f7f945
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Oct 4, 2018
a662720
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Oct 16, 2018
1955db1
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Oct 17, 2018
589ea33
Listen to LS telemetry event
Oct 17, 2018
cc09f95
Remove prefixPath as :S does not need it
Oct 18, 2018
ff3a944
Merge branch 'master' of https://github.com/MikhailArkhipov/vscode-py…
Oct 18, 2018
c40d39f
LS temetry support
Oct 22, 2018
7728cd5
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Oct 22, 2018
f9881cd
Merge master
Oct 22, 2018
e202b61
Package
Oct 22, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions src/client/activation/interpreterDataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export class InterpreterData {
// tslint:disable-next-line:no-shadowed-variable
public readonly path: string,
public readonly version: string,
public readonly prefix: string,
public readonly searchPaths: string,
public readonly hash: string
) { }
Expand Down Expand Up @@ -81,26 +80,23 @@ export class InterpreterDataService {
}

private async getInterpreterDataFromPython(execService: IPythonExecutionService, interpreterPath: string): Promise<InterpreterData> {
const result = await execService.exec(['-c', 'import sys; print(sys.version_info); print(sys.prefix)'], {});
// 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) <<SOMETIMES NEW LINE HERE>>
// [MSC v.1500 32 bit (Intel)]
// C:\Python27
const result = await execService.exec(['-c', 'import sys; print(sys.version_info)'], {});
// sys.version_info(major=3, minor=6, micro=6, releaselevel='final', serial=0)
if (!result.stdout) {
throw Error('Unable to determine Python interpreter version and system prefix.');
}
const output = result.stdout.splitLines({ removeEmptyEntries: true, trim: true });
if (!output || output.length < 2) {
if (!output || output.length < 1) {
throw Error('Unable to parse version and and system prefix from the Python interpreter output.');
}
const majorMatches = output[0].match(/major=(\d*?),/);
const minorMatches = output[0].match(/minor=(\d*?),/);
if (!majorMatches || majorMatches.length < 2 || !minorMatches || minorMatches.length < 2) {
throw Error('Unable to parse interpreter version.');
}
const prefix = output[output.length - 1];
const hash = await this.getInterpreterHash(interpreterPath);
const searchPaths = await this.getSearchPaths(execService);
return new InterpreterData(DataVersion, interpreterPath, `${majorMatches[1]}.${minorMatches[1]}`, prefix, searchPaths, hash);
return new InterpreterData(DataVersion, interpreterPath, `${majorMatches[1]}.${minorMatches[1]}`, searchPaths, hash);
}

private async getSearchPaths(execService: IPythonExecutionService): Promise<string> {
Expand Down
12 changes: 7 additions & 5 deletions src/client/activation/languageServer/languageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import { LanguageServerSymbolProvider } from '../../providers/symbolProvider';
import { sendTelemetryEvent } from '../../telemetry';
import {
PYTHON_LANGUAGE_SERVER_ENABLED,
PYTHON_LANGUAGE_SERVER_ERROR
PYTHON_LANGUAGE_SERVER_ERROR,
PYTHON_LANGUAGE_SERVER_TELEMETRY
} from '../../telemetry/constants';
import { IUnitTestManagementService } from '../../unittests/types';
import { LanguageServerDownloader } from '../downloader';
Expand Down Expand Up @@ -164,6 +165,10 @@ export class LanguageServerExtensionActivator implements IExtensionActivator {
this.languageClient = this.createSelfContainedLanguageClient(serverModule, clientOptions);
try {
await this.startLanguageClient();
this.languageClient.onTelemetry(telemetryEvent => {
const eventName = telemetryEvent.Name ? telemetryEvent.Name : PYTHON_LANGUAGE_SERVER_TELEMETRY;
sendTelemetryEvent(eventName, telemetryEvent.Measurements, telemetryEvent.Properties);
});
return true;
} catch (ex) {
this.appShell.showErrorMessage(`Language server failed to start. Error ${ex}`);
Expand Down Expand Up @@ -212,8 +217,7 @@ export class LanguageServerExtensionActivator implements IExtensionActivator {

// tslint:disable-next-line:member-ordering
public async getAnalysisOptions(): Promise<LanguageClientOptions | undefined> {
// tslint:disable-next-line:no-any
const properties = new Map<string, any>();
const properties = new Map<string, {}>();
let interpreterData: InterpreterData | undefined;
let pythonPath = '';

Expand All @@ -231,8 +235,6 @@ export class LanguageServerExtensionActivator implements IExtensionActivator {
properties['InterpreterPath'] = interpreterData.path;
// tslint:disable-next-line:no-string-literal
properties['Version'] = interpreterData.version;
// tslint:disable-next-line:no-string-literal
properties['PrefixPath'] = interpreterData.prefix;
}

// tslint:disable-next-line:no-string-literal
Expand Down
1 change: 1 addition & 0 deletions src/client/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const PYTHON_LANGUAGE_SERVER_DOWNLOADED = 'PYTHON_LANGUAGE_SERVER.DOWNLOA
export const PYTHON_LANGUAGE_SERVER_ERROR = 'PYTHON_LANGUAGE_SERVER.ERROR';
export const PYTHON_LANGUAGE_SERVER_STARTUP = 'PYTHON_LANGUAGE_SERVER.STARTUP';
export const PYTHON_LANGUAGE_SERVER_PLATFORM_NOT_SUPPORTED = 'PYTHON_LANGUAGE_SERVER.PLATFORM_NOT_SUPPORTED';
export const PYTHON_LANGUAGE_SERVER_TELEMETRY = 'PYTHON_LANGUAGE_SERVER.EVENT';

export const TERMINAL_CREATE = 'TERMINAL.CREATE';
export const PYTHON_LANGUAGE_SERVER_LIST_BLOB_STORE_PACKAGES = 'PYTHON_LANGUAGE_SERVER.LIST_BLOB_PACKAGES';
7 changes: 6 additions & 1 deletion src/client/telemetry/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type FormatTelemetry = {
formatSelection: boolean;
};

export type LanguageServerTelemetry = {
export type LanguageServerVersionTelemetry = {
success: boolean;
lsVersion?: string;
};
Expand All @@ -24,6 +24,10 @@ export type LanguageServerErrorTelemetry = {
error: string;
};

export type LanguageServerTelemetry = {
[key: string]: string;
};

export type LinterTrigger = 'auto' | 'save';

export type LintingTelemetry = {
Expand Down Expand Up @@ -93,6 +97,7 @@ export type TerminalTelemetry = {
};
export type TelemetryProperties = FormatTelemetry
| LanguageServerTelemetry
| LanguageServerVersionTelemetry
| LanguageServerErrorTelemetry
| LintingTelemetry
| EditorLoadTelemetry
Expand Down