54 lines
2.0 KiB
Go
54 lines
2.0 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual goToSource18_reusedFromDifferentFolder"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestGoToSource18_reusedFromDifferentFolder(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @lib: es5
|
|
// @moduleResolution: bundler
|
|
// @Filename: /home/src/workspaces/project/node_modules/@types/yargs/package.json
|
|
{
|
|
"name": "@types/yargs",
|
|
"version": "1.0.0",
|
|
"types": "./index.d.ts"
|
|
}
|
|
// @Filename: /home/src/workspaces/project/node_modules/@types/yargs/callback.d.ts
|
|
export declare class Yargs { positional(): Yargs; }
|
|
// @Filename: /home/src/workspaces/project/node_modules/@types/yargs/index.d.ts
|
|
import { Yargs } from "./callback";
|
|
export declare function command(command: string, cb: (yargs: Yargs) => void): void;
|
|
// @Filename: /home/src/workspaces/project/node_modules/yargs/package.json
|
|
{
|
|
"name": "yargs",
|
|
"version": "1.0.0",
|
|
"main": "index.js"
|
|
}
|
|
// @Filename: /home/src/workspaces/project/node_modules/yargs/callback.js
|
|
export class Yargs { positional() { } }
|
|
// @Filename: /home/src/workspaces/project/node_modules/yargs/index.js
|
|
// Specifically didnt have ./callback import to ensure that resolving module sepcifier adds the file to project at later stage
|
|
export function command(cmd, cb) { cb(Yargs) }
|
|
// @Filename: /home/src/workspaces/project/folder/random.ts
|
|
import { Yargs } from "yargs/callback";
|
|
// @Filename: /home/src/workspaces/project/some/index.ts
|
|
import { random } from "../folder/random";
|
|
import { command } from "yargs";
|
|
command("foo", yargs => {
|
|
yargs.[|/*start*/positional|]();
|
|
});`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.MarkTestAsStradaServer()
|
|
f.VerifyBaselineGoToSourceDefinition(t, "start")
|
|
}
|