File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
typescript/src/completions Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ export default (entries: ts.CompletionEntry[]) => {
5050 const originalText = entry . insertText ?? entry . name
5151 const insertTextSnippetAdd = `(${ methodSnippet . map ( ( x , i ) => `$\{${ i + 1 } :${ x } }` ) . join ( ', ' ) } )`
5252 // https://github.com/zardoy/typescript-vscode-plugins/issues/161
53- const beforeDotWorkaround = prior . isMemberCompletion && prevChar === '.'
53+ // todo implement workaround for ?. as well
54+ const beforeDotWorkaround = ! entry . replacementSpan && prior . isMemberCompletion && prevChar === '.'
5455 return {
5556 ...entry ,
5657 insertText : ( beforeDotWorkaround ? '.' : '' ) + insertTextAfterEntry ( originalText , insertTextSnippetAdd ) ,
@@ -63,7 +64,7 @@ export default (entries: ts.CompletionEntry[]) => {
6364 start : position - 1 ,
6465 length : ( c ( 'editorSuggestInsertModeReplace' ) ? wordRangeAtPos ( fullText , position ) . length : 0 ) + 1 ,
6566 }
66- : undefined ,
67+ : entry . replacementSpan ,
6768 kind : ts . ScriptElementKind . functionElement ,
6869 isSnippet : true ,
6970 }
You can’t perform that action at this time.
0 commit comments