Skip to content

Commit b4c2ce8

Browse files
authored
Merge release into master (#5481)
1 parent 6dbd8b6 commit b4c2ce8

4 files changed

Lines changed: 72 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2019.4.1 (24 April 2019)
4+
5+
### Fixes
6+
7+
1. Remove trailing commas in JSON files.
8+
(thanks [Romain](https://github.com/quarthex))
9+
([#5437](https://github.com/Microsoft/vscode-python/issues/5437))
10+
311
## 2019.4.0 (23 April 2019)
412

513
### Enhancements
@@ -58,6 +66,14 @@
5866
([#5219](https://github.com/Microsoft/vscode-python/issues/5219))
5967
1. Add telemetry for variable explorer and turn on by default.
6068
([#5337](https://github.com/Microsoft/vscode-python/issues/5337))
69+
1. Show a message when no variables are defined
70+
([#5228](https://github.com/Microsoft/vscode-python/issues/5228))
71+
1. Variable explorer UI fixes via PM / designer
72+
([#5274](https://github.com/Microsoft/vscode-python/issues/5274))
73+
1. Allow column sorting in variable explorer
74+
([#5281](https://github.com/Microsoft/vscode-python/issues/5281))
75+
1. Swap getsizeof size value for something more sensible in the variable explorer
76+
([#5368](https://github.com/Microsoft/vscode-python/issues/5368))
6177

6278
### Fixes
6379

@@ -110,6 +126,16 @@
110126
([#5333](https://github.com/Microsoft/vscode-python/issues/5333))
111127
1. Fix dataviewer header column alignment.
112128
([#5351](https://github.com/Microsoft/vscode-python/issues/5351))
129+
1. Make background cell color useable in all themes.
130+
([#5236](https://github.com/Microsoft/vscode-python/issues/5236))
131+
1. Filtered rows shows 'fetching' instead of No rows.
132+
([#5278](https://github.com/Microsoft/vscode-python/issues/5278))
133+
1. Multi-dimensional arrays don't open in the data viewer.
134+
([#5395](https://github.com/Microsoft/vscode-python/issues/5395))
135+
1. Fix sorting of lists with numbers and missing entries.
136+
([#5414](https://github.com/Microsoft/vscode-python/issues/5414))
137+
1. Fix error with bad len() values in variable explorer
138+
([#5420](https://github.com/Microsoft/vscode-python/issues/5420))
113139
1. Update ptvsd to [4.2.8](https://github.com/Microsoft/ptvsd/releases/tag/v4.2.8).
114140
* Path mapping bug fixes.
115141
* Fix for hang when using debug console.
@@ -184,6 +210,10 @@
184210
([#5213](https://github.com/Microsoft/vscode-python/issues/5213))
185211
1. Fix failing variable explorer test.
186212
([#5348](https://github.com/Microsoft/vscode-python/issues/5348))
213+
1. Reliably end test tasks in Azure Pipelines.
214+
([#5129](https://github.com/Microsoft/vscode-python/issues/5129))
215+
1. Deprecate [travis](https://travis-ci.org/) in favor of [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/).
216+
([#4024](https://github.com/Microsoft/vscode-python/issues/4024))
187217

188218
### Thanks
189219

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Python",
44
"description": "Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, and more.",
55
"version": "2019.5.0-dev",
6-
"languageServerVersion": "0.2.59",
6+
"languageServerVersion": "0.2.62",
77
"publisher": "ms-python",
88
"author": {
99
"name": "Microsoft Corporation"

src/client/activation/languageServer/activator.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,22 @@ export class LanguageServerExtensionActivator implements ILanguageServerActivato
6565
}
6666
public async prepareLanguageServerForNoICU(languageServerFolderPath: string): Promise<void> {
6767
const targetJsonFile = path.join(languageServerFolderPath, 'Microsoft.Python.LanguageServer.runtimeconfig.json');
68+
// tslint:disable-next-line:no-any
69+
let content: any = {};
6870
if (await this.fs.fileExists(targetJsonFile)) {
69-
return;
71+
try {
72+
content = JSON.parse(await this.fs.readFile(targetJsonFile));
73+
if (content.runtimeOptions && content.runtimeOptions.configProperties &&
74+
content.runtimeOptions.configProperties['System.Globalization.Invariant'] === true) {
75+
return;
76+
}
77+
} catch {
78+
// Do nothing.
79+
}
7080
}
71-
const json = { runtimeOptions: { configProperties: { 'System.Globalization.Invariant': true } } };
72-
await this.fs.writeFile(targetJsonFile, JSON.stringify(json));
81+
content.runtimeOptions = content.runtimeOptions || {};
82+
content.runtimeOptions.configProperties = content.runtimeOptions.configProperties || {};
83+
content.runtimeOptions.configProperties['System.Globalization.Invariant'] = true;
84+
await this.fs.writeFile(targetJsonFile, JSON.stringify(content));
7385
}
7486
}

src/test/activation/languageServer/activator.unit.test.ts

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,26 @@ suite('Language Server - Activator', () => {
167167
verify(lsDownloader.downloadLanguageServer(anything(), undefined)).once();
168168
verify(fs.fileExists(targetJsonFile)).once();
169169
});
170-
test('Do not download nor check if ICU config exists after downloading', async () => {
170+
test('Download if contents of ICU config is not as expected', async () => {
171171
const languageServerFolder = 'Some folder name';
172172
const languageServerFolderPath = path.join(EXTENSION_ROOT_DIR, languageServerFolder);
173173
const mscorlib = path.join(languageServerFolderPath, 'mscorlib.dll');
174174
const targetJsonFile = path.join(languageServerFolderPath, 'Microsoft.Python.LanguageServer.runtimeconfig.json');
175+
const jsonContents = { runtimeOptions: { configProperties: { 'System.Globalization.Invariant': false } } };
175176

176177
when(settings.downloadLanguageServer).thenReturn(true);
177178
when(lsFolderService.getLanguageServerFolderName(undefined)).thenResolve(languageServerFolder);
178-
when(fs.fileExists(mscorlib)).thenResolve(true);
179+
when(fs.fileExists(mscorlib)).thenResolve(false);
180+
when(lsDownloader.downloadLanguageServer(languageServerFolderPath, undefined)).thenResolve();
181+
when(fs.fileExists(targetJsonFile)).thenResolve(true);
182+
when(fs.readFile(targetJsonFile)).thenResolve(JSON.stringify(jsonContents));
179183

180184
await activator.ensureLanguageServerIsAvailable(undefined);
181185

182186
verify(lsFolderService.getLanguageServerFolderName(undefined)).once();
183-
verify(lsDownloader.downloadLanguageServer(anything(), undefined)).never();
184-
verify(fs.fileExists(targetJsonFile)).never();
187+
verify(lsDownloader.downloadLanguageServer(anything(), undefined)).once();
188+
verify(fs.fileExists(targetJsonFile)).once();
189+
verify(fs.readFile(targetJsonFile)).once();
185190
});
186191
test('JSON file is created to ensure LS can start without ICU', async () => {
187192
const targetJsonFile = path.join('some folder', 'Microsoft.Python.LanguageServer.runtimeconfig.json');
@@ -194,14 +199,30 @@ suite('Language Server - Activator', () => {
194199
verify(fs.fileExists(targetJsonFile)).atLeast(1);
195200
verify(fs.writeFile(targetJsonFile, JSON.stringify(contents))).once();
196201
});
197-
test('JSON file is not created if it already exists', async () => {
202+
test('JSON file is not created if it already exists with the right content', async () => {
198203
const targetJsonFile = path.join('some folder', 'Microsoft.Python.LanguageServer.runtimeconfig.json');
199204
const contents = { runtimeOptions: { configProperties: { 'System.Globalization.Invariant': true } } };
205+
const existingContents = { runtimeOptions: { configProperties: { 'System.Globalization.Invariant': true } } };
200206
when(fs.fileExists(targetJsonFile)).thenResolve(true);
207+
when(fs.readFile(targetJsonFile)).thenResolve(JSON.stringify(existingContents));
201208

202209
await activator.prepareLanguageServerForNoICU('some folder');
203210

204211
verify(fs.fileExists(targetJsonFile)).atLeast(1);
205212
verify(fs.writeFile(targetJsonFile, JSON.stringify(contents))).never();
213+
verify(fs.readFile(targetJsonFile)).once();
214+
});
215+
test('JSON file is created if it already exists but with the wrong file content', async () => {
216+
const targetJsonFile = path.join('some folder', 'Microsoft.Python.LanguageServer.runtimeconfig.json');
217+
const contents = { runtimeOptions: { configProperties: { 'System.Globalization.Invariant': true } } };
218+
const existingContents = { runtimeOptions: { configProperties: { 'System.Globalization.Invariant': false } } };
219+
when(fs.fileExists(targetJsonFile)).thenResolve(true);
220+
when(fs.readFile(targetJsonFile)).thenResolve(JSON.stringify(existingContents));
221+
222+
await activator.prepareLanguageServerForNoICU('some folder');
223+
224+
verify(fs.fileExists(targetJsonFile)).atLeast(1);
225+
verify(fs.writeFile(targetJsonFile, JSON.stringify(contents))).once();
226+
verify(fs.readFile(targetJsonFile)).once();
206227
});
207228
});

0 commit comments

Comments
 (0)