File tree Expand file tree Collapse file tree 4 files changed +21
-1
lines changed
Expand file tree Collapse file tree 4 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ namespace ts {
114114 // we deliberately exclude augmentations
115115 // since we are only interested in declarations of the module itself
116116 return tryFindAmbientModule(moduleName, /*withAugmentations*/ false);
117- }
117+ },
118+ getApparentType
118119 };
119120
120121 const tupleTypes: GenericType[] = [];
Original file line number Diff line number Diff line change @@ -2372,6 +2372,7 @@ namespace ts {
23722372 getAmbientModules ( ) : Symbol [ ] ;
23732373
23742374 tryGetMemberInModuleExports ( memberName : string , moduleSymbol : Symbol ) : Symbol | undefined ;
2375+ getApparentType ( type : Type ) : Type ;
23752376
23762377 /* @internal */ tryFindAmbientModuleWithoutAugmentations ( moduleName : string ) : Symbol ;
23772378
Original file line number Diff line number Diff line change @@ -244,6 +244,9 @@ namespace ts.Completions {
244244 }
245245
246246 function addStringLiteralCompletionsFromType ( type : Type , result : CompletionEntry [ ] ) : void {
247+ if ( type && type . flags & TypeFlags . TypeParameter ) {
248+ type = typeChecker . getApparentType ( type ) ;
249+ }
247250 if ( ! type ) {
248251 return ;
249252 }
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts'/>
2+
3+ ////interface Foo {
4+ //// foo: string;
5+ //// bar: string;
6+ //// }
7+ ////
8+ ////function f<K extends keyof Foo>(a: K) { };
9+ ////f("/*1*/
10+
11+ goTo . marker ( '1' ) ;
12+ verify . completionListContains ( "foo" ) ;
13+ verify . completionListContains ( "bar" ) ;
14+ verify . memberListCount ( 2 ) ;
15+
You can’t perform that action at this time.
0 commit comments