Skip to content

Make cross-file go-to-definition work in the syntax-only server #39037

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

One of the original motivators for the syntax-only server was to make sure that users could navigate around their project, and inter-file go-to-definition is table-stakes. Some of this is already described in #37713, but the idea is:

// @filename: foo.ts
export interface Stuff {
  foo: string;
}

export function foo(x: Stuff) {
}

// @filename: bar.ts
import { foo } from "./foo";
import * as fooModule from "./foo"

/**/foo()

fooModule./**/foo();

Go to definition on either call to foo should just work. Go to definition on the import path should also work. We can do this by performing a super-basic basic resolution of the path.

If there's an export *, we should consider trying to continue the search too.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptRescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions