File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { CompletionItem , SymbolKind } from 'vscode' ;
1+ import { CompletionItem , SymbolKind , SnippetString } from 'vscode' ;
22import * as proxy from '../../providers/jediProxy' ;
33import { extractSignatureAndDocumentation } from '../../providers/jediHelpers' ;
44import { PythonSettings } from '../../common/configSettings' ;
@@ -18,7 +18,7 @@ export class CompletionParser {
1818 completionItem . detail = sigAndDocs [ 0 ] . split ( / \r ? \n / ) . join ( '' ) ;
1919 if ( pythonSettings . autoComplete . addBrackets === true &&
2020 ( item . kind === SymbolKind . Function || item . kind === SymbolKind . Method ) ) {
21- completionItem . insertText = item . text + '({{}})' ;
21+ completionItem . insertText = new SnippetString ( item . text ) . appendText ( "(" ) . appendTabstop ( ) . appendText ( ")" ) ;
2222 }
2323
2424 // ensure the built in memebers are at the bottom
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import * as telemetryContracts from '../common/telemetryContracts';
66import { extractSignatureAndDocumentation } from './jediHelpers' ;
77import { EOL } from 'os' ;
88import { PythonSettings } from '../common/configSettings' ;
9+ import { SnippetString } from 'vscode' ;
910
1011const pythonSettings = PythonSettings . getInstance ( ) ;
1112
@@ -25,7 +26,7 @@ export class PythonCompletionItemProvider implements vscode.CompletionItemProvid
2526 completionItem . detail = sigAndDocs [ 0 ] . split ( / \r ? \n / ) . join ( '' ) ;
2627 if ( pythonSettings . autoComplete . addBrackets === true &&
2728 ( item . kind === vscode . SymbolKind . Function || item . kind === vscode . SymbolKind . Method ) ) {
28- completionItem . insertText = item . text + '({{}})' ;
29+ completionItem . insertText = new SnippetString ( item . text ) . appendText ( "(" ) . appendTabstop ( ) . appendText ( ")" ) ;
2930 }
3031
3132 // ensure the built in memebers are at the bottom
You can’t perform that action at this time.
0 commit comments