Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
04e0b34
Fix path
May 6, 2020
9297d96
Merge branch 'master' of https://github.com/Microsoft/vscode-python
May 6, 2020
9f3d5ac
Merge branch 'master' of https://github.com/Microsoft/vscode-python
May 11, 2020
607bf98
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jun 1, 2020
e566214
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jun 11, 2020
4477900
Actually fix settings
Jun 18, 2020
d0d50de
Add news
Jun 18, 2020
03aa5f9
Add test
Jun 18, 2020
e4a032f
Format
Jun 18, 2020
27eeec7
Suppress 'jediEnabled' removal
Jun 18, 2020
89f432e
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jun 23, 2020
3ed655b
Drop survey first launch threshold
Jun 26, 2020
64ac38a
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jun 29, 2020
52a4325
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jun 30, 2020
67d7cb8
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jul 8, 2020
0ce6d91
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jul 22, 2020
571115e
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Jul 30, 2020
41fbcbb
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 4, 2020
8fee970
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 10, 2020
67ea545
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 17, 2020
25d634f
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 18, 2020
de9b63d
Merge branch 'master' of https://github.com/Microsoft/vscode-python
Aug 18, 2020
355a381
Merge branch 'main' of https://github.com/Microsoft/vscode-python
Sep 10, 2020
20c7c53
Telemetry for exceptions
Sep 10, 2020
692a6b0
Merge branch 'main' of https://github.com/Microsoft/vscode-python int…
Sep 10, 2020
1c15da5
Remove custom exception telemetry
Sep 10, 2020
ce56804
Remove unused
Sep 10, 2020
97804c7
Merge branch 'main' of https://github.com/Microsoft/vscode-python int…
Sep 16, 2020
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
Prev Previous commit
Next Next commit
Suppress 'jediEnabled' removal
  • Loading branch information
Mikhail Arkhipov
Mikhail Arkhipov committed Jun 18, 2020
commit 27eeec76f8519ed0beb45274db2cd9200bde1f26
13 changes: 3 additions & 10 deletions src/client/testing/common/updateTestSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ export class UpdateTestSettingService implements IExtensionActivationService {
// - `true` or missing then set to `languageServer: Jedi`.
// - `false` and `languageServer` is present, do nothing.
// - `false` and `languageServer` is NOT present, set `languageServer` to `Microsoft`.
// `jediEnabled` is then removed.
// `jediEnabled` is NOT removed since JSONC parser may also remove comments.
const jediEnabledPath = ['python.jediEnabled'];
const languageServerPath = ['python.languageServer'];

try {
let ast = parseTree(fileContent);
let jediEnabledNode = findNodeAtLocation(ast, jediEnabledPath);
const ast = parseTree(fileContent);
const jediEnabledNode = findNodeAtLocation(ast, jediEnabledPath);
const jediEnabled = jediEnabledNode ? getNodeValue(jediEnabledNode) : true;
const languageServerNode = findNodeAtLocation(ast, languageServerPath);
const formattingOptions: FormattingOptions = {
Expand All @@ -135,13 +135,6 @@ export class UpdateTestSettingService implements IExtensionActivationService {
}

fileContent = applyEdits(fileContent, edits);
// Remove jediEnabled
ast = parseTree(fileContent);
jediEnabledNode = findNodeAtLocation(ast, jediEnabledPath);
if (jediEnabledNode) {
edits = modify(fileContent, jediEnabledPath, undefined, { formattingOptions });
fileContent = applyEdits(fileContent, edits);
}
// tslint:disable-next-line:no-empty
} catch {}
return fileContent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,32 +224,32 @@ suite('Application Diagnostics - Check Test Settings', () => {
{
testTitle: 'jediEnabled: true, no languageServer setting',
contents: '{ "python.jediEnabled": true }',
expectedContent: '{"python.languageServer": "Jedi"}'
expectedContent: '{ "python.jediEnabled": true, "python.languageServer": "Jedi"}'
},
{
testTitle: 'jediEnabled: true, languageServer setting present',
contents: '{ "python.jediEnabled": true }',
expectedContent: '{"python.languageServer": "Jedi"}'
expectedContent: '{ "python.jediEnabled": true, "python.languageServer": "Jedi"}'
},
{
testTitle: 'jediEnabled: false, no languageServer setting',
contents: '{ "python.jediEnabled": false }',
expectedContent: '{"python.languageServer": "Microsoft"}'
expectedContent: '{ "python.jediEnabled": false, "python.languageServer": "Microsoft"}'
},
{
testTitle: 'jediEnabled: false, languageServer is Microsoft',
contents: '{ "python.jediEnabled": false, "python.languageServer": "Microsoft" }',
expectedContent: '{"python.languageServer": "Microsoft"}'
expectedContent: '{ "python.jediEnabled": false, "python.languageServer": "Microsoft"}'
},
{
testTitle: 'jediEnabled: false, languageServer is None',
contents: '{ "python.jediEnabled": false, "python.languageServer": "None" }',
expectedContent: '{"python.languageServer": "None"}'
expectedContent: '{ "python.jediEnabled": false, "python.languageServer": "None"}'
},
{
testTitle: 'jediEnabled: false, languageServer is Jedi',
contents: '{ "python.jediEnabled": false, "python.languageServer": "Jedi" }',
expectedContent: '{"python.languageServer": "Jedi"}'
expectedContent: '{ "python.jediEnabled": false, "python.languageServer": "Jedi"}'
}
].forEach((item) => {
test(item.testTitle, async () => {
Expand Down