-
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.
Supports more locations for completions contextual types (#21946)
- Loading branch information
Andy
authored
Feb 17, 2018
1 parent
9ee51fa
commit 69abe49
Showing
6 changed files
with
80 additions
and
31 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
27 changes: 27 additions & 0 deletions
27
tests/cases/fourslash/completionsRecommended_contextualTypes.ts
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,27 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @jsx: preserve | ||
|
||
// @Filename: /a.tsx | ||
////enum E {} | ||
////enum F {} | ||
////function f(e: E, f: F) {} | ||
////f(/*arg0*/, /*arg1*/); | ||
//// | ||
////function tag(arr: TemplateStringsArray, x: E) {} | ||
////tag`${/*tag*/}`; | ||
//// | ||
////declare function MainButton(props: { e: E }): any; | ||
////<MainButton e={/*jsx*/} /> | ||
////<MainButton e=/*jsx2*/ /> | ||
|
||
recommended("arg0"); | ||
recommended("arg1", "F"); | ||
recommended("tag"); | ||
recommended("jsx"); | ||
recommended("jsx2"); | ||
|
||
function recommended(markerName: string, enumName = "E") { | ||
goTo.marker(markerName); | ||
verify.completionListContains(enumName, `enum ${enumName}`, "", "enum", undefined, undefined , { isRecommended: 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