Skip to content

Commit d552636

Browse files
committed
Add test where different specifier than whats in the file is resolved to find the source
1 parent 2e58032 commit d552636

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// === goToSourceDefinition ===
2+
// === /node_modules/yargs/callback.js ===
3+
// export class Yargs { [|positional|]() { } }
4+
5+
// === /index.ts ===
6+
// import { command } from "yargs";
7+
// command("foo", yargs => {
8+
// yargs./*GOTO SOURCE DEF*/positional();
9+
// });
10+
11+
// === Details ===
12+
[
13+
{
14+
"containerKind": "",
15+
"containerName": "",
16+
"kind": "",
17+
"name": "",
18+
"unverified": true
19+
}
20+
]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/// <reference path="../fourslash.ts" />
2+
3+
// @moduleResolution: node
4+
5+
// This is just modified repro to ensure we are resolving module specifier thats not already present in the file
6+
7+
// @Filename: /node_modules/@types/yargs/package.json
8+
//// {
9+
//// "name": "@types/yargs",
10+
//// "version": "1.0.0",
11+
//// "types": "./index.d.ts"
12+
//// }
13+
14+
// @Filename: /node_modules/@types/yargs/callback.d.ts
15+
//// export declare class Yargs { positional(): Yargs; }
16+
17+
// @Filename: /node_modules/@types/yargs/index.d.ts
18+
//// import { Yargs } from "./callback";
19+
//// export declare function command(command: string, cb: (yargs: Yargs) => void): void;
20+
21+
// @Filename: /node_modules/yargs/package.json
22+
//// {
23+
//// "name": "yargs",
24+
//// "version": "1.0.0",
25+
//// "main": "index.js"
26+
//// }
27+
28+
// @Filename: /node_modules/yargs/callback.js
29+
//// export class Yargs { positional() { } }
30+
31+
// @Filename: /node_modules/yargs/index.js
32+
//// import { Yargs } from "./callback";
33+
//// export function command(cmd, cb) { cb(Yargs) }
34+
35+
// @Filename: /index.ts
36+
//// import { command } from "yargs";
37+
//// command("foo", yargs => {
38+
//// yargs.[|/*start*/positional|]();
39+
//// });
40+
41+
verify.baselineGoToSourceDefinition("start");

0 commit comments

Comments
 (0)