-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support recommended completion for union (#24326)
* Support recommended completion for union * Fix for empty enum, which is not a union
- Loading branch information
Andy
authored
May 22, 2018
1 parent
694a985
commit 9cda2bd
Showing
5 changed files
with
37 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @strictNullChecks: true | ||
|
||
////const enum E { A = "A", B = "B" } | ||
////const enum E2 { X = "X", Y = "Y" } | ||
////const e: E | undefined = /*a*/ | ||
////const e2: E | E2 = /*b*/ | ||
|
||
verify.completions( | ||
{ | ||
marker: "a", | ||
includes: { name: "E", isRecommended: true }, | ||
isNewIdentifierLocation: true, | ||
}, | ||
{ | ||
marker: "b", | ||
// Arbitrarily chooses one to be recommended | ||
includes: [{ name: "E", isRecommended: true, }, { name: "E2" }], | ||
isNewIdentifierLocation: true, | ||
}, | ||
); |
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