-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add completions from the 'this' type (#21231)
* Add completions from the 'this' type * Code review
- Loading branch information
Andy
authored
Jan 17, 2018
1 parent
48ac301
commit 8ed885d
Showing
7 changed files
with
93 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
////class C { | ||
//// "foo bar": number; | ||
//// xyz() { | ||
//// /**/ | ||
//// } | ||
////} | ||
//// | ||
////function f(this: { x: number }) { /*f*/ } | ||
|
||
goTo.marker(""); | ||
|
||
verify.completionListContains("xyz", "(method) C.xyz(): void", "", "method", undefined, undefined, { | ||
includeInsertTextCompletions: true, | ||
insertText: "this.xyz", | ||
}); | ||
|
||
verify.completionListContains("foo bar", '(property) C["foo bar"]: number', "", "property", undefined, undefined, { | ||
includeInsertTextCompletions: true, | ||
insertText: 'this["foo bar"]', | ||
}); | ||
|
||
goTo.marker("f"); | ||
|
||
verify.completionListContains("x", "(property) x: number", "", "property", undefined, undefined, { | ||
includeInsertTextCompletions: true, | ||
insertText: "this.x", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters