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[]) => {
50
50
const originalText = entry . insertText ?? entry . name
51
51
const insertTextSnippetAdd = `(${ methodSnippet . map ( ( x , i ) => `$\{${ i + 1 } :${ x } }` ) . join ( ', ' ) } )`
52
52
// 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 === '.'
54
55
return {
55
56
...entry ,
56
57
insertText : ( beforeDotWorkaround ? '.' : '' ) + insertTextAfterEntry ( originalText , insertTextSnippetAdd ) ,
@@ -63,7 +64,7 @@ export default (entries: ts.CompletionEntry[]) => {
63
64
start : position - 1 ,
64
65
length : ( c ( 'editorSuggestInsertModeReplace' ) ? wordRangeAtPos ( fullText , position ) . length : 0 ) + 1 ,
65
66
}
66
- : undefined ,
67
+ : entry . replacementSpan ,
67
68
kind : ts . ScriptElementKind . functionElement ,
68
69
isSnippet : true ,
69
70
}
You can’t perform that action at this time.
0 commit comments