-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 3.8.0-dev.20200108
Search Terms:
- suggest / suggestion / suggestions
- completion / completions
- private fields
- completionInfo
Code
For the TS:
class K {
#value: number;
private keyword: number = 1;
foo() {
this.#va
}
}-
Trigger completions after
#va -
Accept suggestion for
#value
Expected behavior:
The suggestion results in this.#value:
Actual behavior:
After the suggestion, there is an extra this.:
class Prv {
#value: number;
private keyword: number = 1;
foo() {
return this.this.#value;
}
}I believe the root cause is that insertText is being included for this completion item:
{
"name": "#value",
"kind": "property",
"kindModifiers": "",
"sortText": "3",
"insertText": "this.#value"
},
Compare this with completions for private properties, which in a similar case do not include insertText:
{
"name": "keyword",
"kind": "property",
"kindModifiers": "private",
"sortText": "0"
},
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue