Skip to content

Commit 561365f

Browse files
committed
Disable "snippets" expansion in Jedi LSP
This brings the Jedi based completion experience in line with that provided by Pylance. Completions now insert only the current symbol rather than assuming that the user wants to e.g: call that symbol. This means for example that completing `max` will insert just `max` rather `max(arg1, arg2)`. While for this case this may be seen as less useful, it means that insertions in places where a call is not desired (such as imports and typing contexts) will not be forced to manually remove the parentheses and template arguments which might otherwise be inserted. Users can still use the signature support UI to explore signatures and of course insertion of an opening parenthesis will still insert a closing one. Hopefully this new configuration will be preferable to a majority of users. Fixes #15858
1 parent f0253e5 commit 561365f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/client/activation/jedi/analysisOptions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class JediLanguageServerAnalysisOptions extends LanguageServerAnalysisOpt
5959
markupKindPreferred: 'markdown',
6060
completion: {
6161
resolveEagerly: false,
62-
disableSnippets: false,
62+
disableSnippets: true,
6363
},
6464
diagnostics: {
6565
enable: true,

src/test/activation/jedi/jediAnalysisOptions.unit.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ suite('Jedi LSP - analysis Options', () => {
6464

6565
expect(result.initializationOptions.markupKindPreferred).to.deep.equal('markdown');
6666
expect(result.initializationOptions.completion.resolveEagerly).to.deep.equal(false);
67-
expect(result.initializationOptions.completion.disableSnippets).to.deep.equal(false);
67+
expect(result.initializationOptions.completion.disableSnippets).to.deep.equal(true);
6868
expect(result.initializationOptions.diagnostics.enable).to.deep.equal(true);
6969
expect(result.initializationOptions.diagnostics.didOpen).to.deep.equal(true);
7070
expect(result.initializationOptions.diagnostics.didSave).to.deep.equal(true);

0 commit comments

Comments
 (0)