Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to latest LS protocol #2164

Merged
merged 17 commits into from
Jul 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions news/1 Enhancements/2000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Only report Language Server download progress once. (Thanks @MikhailArkhipov)
1 change: 1 addition & 0 deletions news/1 Enhancements/2113.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set default analysis for language server to open files only. (Thanks @MikhailArkhipov)
47 changes: 27 additions & 20 deletions package-lock.json

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

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"theme": "dark"
},
"engines": {
"vscode": "^1.23.0"
"vscode": "^1.25.0"
},
"recommendations": [
"donjayamanne.jupyter"
Expand Down Expand Up @@ -1277,7 +1277,7 @@
},
"python.analysis.openFilesOnly": {
"type": "boolean",
"default": false,
"default": true,
"description": "Only show errors and warnings for open files rather than for the entire workspace.",
"scope": "resource"
},
Expand Down Expand Up @@ -1964,7 +1964,7 @@
"fs-extra": "4.0.3",
"fuzzy": "0.1.3",
"get-port": "3.2.0",
"glob": "^7.1.2",
"glob": "7.1.2",
"iconv-lite": "0.4.21",
"inversify": "4.11.1",
"line-by-line": "0.1.6",
Expand All @@ -1990,8 +1990,9 @@
"vscode-debugadapter": "1.28.0",
"vscode-debugprotocol": "1.28.0",
"vscode-extension-telemetry": "0.0.15",
"vscode-languageclient": "3.5.1",
"vscode-languageserver": "3.5.1",
"vscode-languageclient": "4.3.0",
"vscode-languageserver": "4.3.0",
"vscode-languageserver-protocol": "3.9.0",
"winreg": "1.2.4",
"xml2js": "0.4.19"
},
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ flake8
autopep8
black ; python_version>='3.6'
yapf
pylint
pylint<2.0.0
pep8
prospector
pydocstyle
Expand Down
15 changes: 1 addition & 14 deletions src/client/activation/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { createDeferred } from '../common/helpers';
import { IFileSystem, IPlatformService } from '../common/platform/types';
import { IExtensionContext, IOutputChannel } from '../common/types';
import { IServiceContainer } from '../ioc/types';
import { HashVerifier } from './hashVerifier';
import { PlatformData } from './platformData';

// tslint:disable-next-line:no-require-imports no-var-requires
Expand Down Expand Up @@ -42,7 +41,6 @@ export class LanguageServerDownloader {
let localTempFilePath = '';
try {
localTempFilePath = await this.downloadFile(downloadUriPrefix, enginePackageFileName, 'Downloading Microsoft Python Language Server... ');
await this.verifyDownload(localTempFilePath, platformString);
await this.unpackArchive(context.extensionPath, localTempFilePath);
} catch (err) {
this.output.appendLine('failed.');
Expand Down Expand Up @@ -70,8 +68,7 @@ export class LanguageServerDownloader {
});

await window.withProgress({
location: ProgressLocation.Window,
title
location: ProgressLocation.Window
}, (progress) => {

requestProgress(request(uri))
Expand All @@ -98,16 +95,6 @@ export class LanguageServerDownloader {
return tempFile.filePath;
}

private async verifyDownload(filePath: string, platformString: string): Promise<void> {
this.output.appendLine('');
this.output.append('Verifying download... ');
const verifier = new HashVerifier();
if (!await verifier.verifyHash(filePath, platformString, await this.platformData.getExpectedHash())) {
throw new Error('Hash of the downloaded file does not match.');
}
this.output.appendLine('valid.');
}

private async unpackArchive(extensionPath: string, tempFilePath: string): Promise<void> {
this.output.append('Unpacking archive... ');

Expand Down
2 changes: 1 addition & 1 deletion src/client/activation/languageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export class LanguageServerExtensionActivator implements IExtensionActivator {
properties
},
displayOptions: {
preferredFormat: 1, // Markdown
preferredFormat: 'markdown',
trimDocumentationLines: false,
maxDocumentationLineLength: 0,
trimDocumentationText: false,
Expand Down
1 change: 1 addition & 0 deletions src/test/vscode-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ mockedVSCode.EventEmitter = vscodeMocks.vscMock.EventEmitter;
mockedVSCode.ConfigurationTarget = vscodeMocks.vscMockExtHostedTypes.ConfigurationTarget;
mockedVSCode.StatusBarAlignment = vscodeMocks.vscMockExtHostedTypes.StatusBarAlignment;
mockedVSCode.SignatureHelp = vscodeMocks.vscMockExtHostedTypes.SignatureHelp;
mockedVSCode.DocumentLink = vscodeMocks.vscMockExtHostedTypes.DocumentLink;

// This API is used in src/client/telemetry/telemetry.ts
const extensions = TypeMoq.Mock.ofType<typeof vscode.extensions>();
Expand Down