Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 033029a

Browse files
d3r3kkAman Agarwal
authored and
Aman Agarwal
committed
Upgrade to latest LS protocol (#2164)
* LS symbol providers * Different ready wait * Upgrade dependencies to latest LS * Make open files only default * Turn off hash checks * Fix double progress display * Update packages * Anchor dependencies * Add missing mock from vscode-mock * Downgrade pylint to < 2.0.0 to mirror prospector requirements
1 parent 4db747d commit 033029a

File tree

8 files changed

+39
-41
lines changed

8 files changed

+39
-41
lines changed

news/1 Enhancements/2000.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Only report Language Server download progress once. (Thanks @MikhailArkhipov)

news/1 Enhancements/2113.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Set default analysis for language server to open files only. (Thanks @MikhailArkhipov)

package-lock.json

+27-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"theme": "dark"
4141
},
4242
"engines": {
43-
"vscode": "^1.23.0"
43+
"vscode": "^1.25.0"
4444
},
4545
"recommendations": [
4646
"donjayamanne.jupyter"
@@ -1277,7 +1277,7 @@
12771277
},
12781278
"python.analysis.openFilesOnly": {
12791279
"type": "boolean",
1280-
"default": false,
1280+
"default": true,
12811281
"description": "Only show errors and warnings for open files rather than for the entire workspace.",
12821282
"scope": "resource"
12831283
},
@@ -1964,7 +1964,7 @@
19641964
"fs-extra": "4.0.3",
19651965
"fuzzy": "0.1.3",
19661966
"get-port": "3.2.0",
1967-
"glob": "^7.1.2",
1967+
"glob": "7.1.2",
19681968
"iconv-lite": "0.4.21",
19691969
"inversify": "4.11.1",
19701970
"line-by-line": "0.1.6",
@@ -1990,8 +1990,9 @@
19901990
"vscode-debugadapter": "1.28.0",
19911991
"vscode-debugprotocol": "1.28.0",
19921992
"vscode-extension-telemetry": "0.0.15",
1993-
"vscode-languageclient": "3.5.1",
1994-
"vscode-languageserver": "3.5.1",
1993+
"vscode-languageclient": "4.3.0",
1994+
"vscode-languageserver": "4.3.0",
1995+
"vscode-languageserver-protocol": "3.9.0",
19951996
"winreg": "1.2.4",
19961997
"xml2js": "0.4.19"
19971998
},

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ flake8
44
autopep8
55
black ; python_version>='3.6'
66
yapf
7-
pylint
7+
pylint<2.0.0
88
pep8
99
prospector
1010
pydocstyle

src/client/activation/downloader.ts

+1-14
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { createDeferred } from '../common/helpers';
1111
import { IFileSystem, IPlatformService } from '../common/platform/types';
1212
import { IExtensionContext, IOutputChannel } from '../common/types';
1313
import { IServiceContainer } from '../ioc/types';
14-
import { HashVerifier } from './hashVerifier';
1514
import { PlatformData } from './platformData';
1615

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

7270
await window.withProgress({
73-
location: ProgressLocation.Window,
74-
title
71+
location: ProgressLocation.Window
7572
}, (progress) => {
7673

7774
requestProgress(request(uri))
@@ -98,16 +95,6 @@ export class LanguageServerDownloader {
9895
return tempFile.filePath;
9996
}
10097

101-
private async verifyDownload(filePath: string, platformString: string): Promise<void> {
102-
this.output.appendLine('');
103-
this.output.append('Verifying download... ');
104-
const verifier = new HashVerifier();
105-
if (!await verifier.verifyHash(filePath, platformString, await this.platformData.getExpectedHash())) {
106-
throw new Error('Hash of the downloaded file does not match.');
107-
}
108-
this.output.appendLine('valid.');
109-
}
110-
11198
private async unpackArchive(extensionPath: string, tempFilePath: string): Promise<void> {
11299
this.output.append('Unpacking archive... ');
113100

src/client/activation/languageServer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export class LanguageServerExtensionActivator implements IExtensionActivator {
232232
properties
233233
},
234234
displayOptions: {
235-
preferredFormat: 1, // Markdown
235+
preferredFormat: 'markdown',
236236
trimDocumentationLines: false,
237237
maxDocumentationLineLength: 0,
238238
trimDocumentationText: false,

src/test/vscode-mock.ts

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ mockedVSCode.EventEmitter = vscodeMocks.vscMock.EventEmitter;
6464
mockedVSCode.ConfigurationTarget = vscodeMocks.vscMockExtHostedTypes.ConfigurationTarget;
6565
mockedVSCode.StatusBarAlignment = vscodeMocks.vscMockExtHostedTypes.StatusBarAlignment;
6666
mockedVSCode.SignatureHelp = vscodeMocks.vscMockExtHostedTypes.SignatureHelp;
67+
mockedVSCode.DocumentLink = vscodeMocks.vscMockExtHostedTypes.DocumentLink;
6768

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

0 commit comments

Comments
 (0)