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 {
114
114
// we deliberately exclude augmentations
115
115
// since we are only interested in declarations of the module itself
116
116
return tryFindAmbientModule(moduleName, /*withAugmentations*/ false);
117
- }
117
+ },
118
+ getApparentType
118
119
};
119
120
120
121
const tupleTypes: GenericType[] = [];
Original file line number Diff line number Diff line change @@ -2372,6 +2372,7 @@ namespace ts {
2372
2372
getAmbientModules ( ) : Symbol [ ] ;
2373
2373
2374
2374
tryGetMemberInModuleExports ( memberName : string , moduleSymbol : Symbol ) : Symbol | undefined ;
2375
+ getApparentType ( type : Type ) : Type ;
2375
2376
2376
2377
/* @internal */ tryFindAmbientModuleWithoutAugmentations ( moduleName : string ) : Symbol ;
2377
2378
Original file line number Diff line number Diff line change @@ -244,6 +244,9 @@ namespace ts.Completions {
244
244
}
245
245
246
246
function addStringLiteralCompletionsFromType ( type : Type , result : CompletionEntry [ ] ) : void {
247
+ if ( type && type . flags & TypeFlags . TypeParameter ) {
248
+ type = typeChecker . getApparentType ( type ) ;
249
+ }
247
250
if ( ! type ) {
248
251
return ;
249
252
}
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