1
1
/// <reference path="fourslash.ts" />
2
2
3
3
// @Filename : /foo/types/types.ts
4
- ////[|export type [|Full|] = { prop: string; };|]
4
+ ////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |} Full|] = { prop: string; };|]
5
5
6
6
// @Filename : /foo/types/index.ts
7
- ////import * as foo from './types';
8
- ////export { foo };
7
+ ////[| import * as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |} foo|] from './types';|]
8
+ ////[| export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |} foo|] };|]
9
9
10
10
// @Filename : /app.ts
11
- ////import { foo } from './foo/types';
12
- ////export type fullType = foo. Full;
11
+ ////[| import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 6 |} foo|] } from './foo/types';|]
12
+ ////export type fullType = [| foo|].[| Full|] ;
13
13
////type namespaceImport = typeof import('./foo/types');
14
- ////type fullType2 = import('./foo/types').foo. Full;
14
+ ////type fullType2 = import('./foo/types').[| foo|].[| Full|] ;
15
15
16
16
verify . noErrors ( ) ;
17
- const [ full0Def , full0 ] = test . ranges ( ) ;
18
- verify . referenceGroups ( [ full0 ] , [ {
19
- definition : "type foo" ,
20
- ranges : [ full0 ]
21
- } ] )
17
+ const [ full0Def , full0 , foo0Def , foo0 , foo1Def , foo1 , foo2Def , foo2 , foo3 , full1 , foo4 , full2 ] = test . ranges ( ) ;
18
+ const fullRanges = [ full0 , full1 , full2 ] ;
19
+ const full = {
20
+ definition : "type Full = {\n prop: string;\n}" ,
21
+ ranges : fullRanges
22
+ } ;
23
+ verify . referenceGroups ( fullRanges , [ full ] ) ;
22
24
25
+ const fooTypesRanges = [ foo0 , foo1 ] ;
26
+ const fooTypes = {
27
+ definition : "import foo" ,
28
+ ranges : fooTypesRanges
29
+ } ;
30
+ const fooAppRanges = [ foo2 , foo3 ] ;
31
+ const fooApp = {
32
+ definition : "import foo" ,
33
+ ranges : fooAppRanges
34
+ } ;
35
+ verify . referenceGroups ( fooTypesRanges , [ fooTypes , fooApp ] ) ;
36
+ verify . referenceGroups ( fooAppRanges , [ fooApp , fooTypes ] ) ;
0 commit comments