File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,12 @@ namespace ts {
101
101
|| isImportEqualsDeclaration ( parent ) && node === parent . name ) {
102
102
let decl : Node = parent ;
103
103
while ( decl ) {
104
+ if ( isImportOrExportSpecifier ( decl ) ) {
105
+ // Don't return `SemanticMeaning.All` when `!decl.isTypeOnly`, as the node's ancestor may contain `type` modifier.
106
+ if ( decl . isTypeOnly ) {
107
+ return SemanticMeaning . Type ;
108
+ }
109
+ }
104
110
if ( isImportEqualsDeclaration ( decl ) || isImportClause ( decl ) || isExportDeclaration ( decl ) ) {
105
111
return decl . isTypeOnly ? SemanticMeaning . Type : SemanticMeaning . All ;
106
112
}
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+
3
+ // @Filename : /a.ts
4
+ ////export type A = number;
5
+ ////export const A = 42;
6
+ ////export type B = number;
7
+ ////export const B = 42;
8
+
9
+ // @Filename : /b.ts
10
+ ////import type { A/*1*/ } from './a';
11
+ ////import { type B/*2*/ } from './a';
12
+ ////export type { A/*3*/ } from './a';
13
+ ////export { type B/*4*/ } from './a';
14
+
15
+ verify . quickInfoAt ( "1" , [
16
+ "(alias) type A = number" ,
17
+ "import A" ,
18
+ ] . join ( "\n" ) ) ;
19
+
20
+ verify . quickInfoAt ( "2" , [
21
+ "(alias) type B = number" ,
22
+ "import B" ,
23
+ ] . join ( "\n" ) ) ;
24
+
25
+ verify . quickInfoAt ( "3" , [
26
+ "(alias) type A = number" ,
27
+ "export A" ,
28
+ ] . join ( "\n" ) ) ;
29
+
30
+ verify . quickInfoAt ( "4" , [
31
+ "(alias) type B = number" ,
32
+ "export B" ,
33
+ ] . join ( "\n" ) ) ;
You can’t perform that action at this time.
0 commit comments