Support go-to-definition for imports of arbitrary files (#42539)

* Support go-to-definition for imports of scripts and arbitrary files

* Support go-to-definition for non-existent files

* Add missing file property

* Use `isExternalModuleNameRelative` instead of `!pathIsBareSpecifier`

* Add partial semantic test

* Combine with symbol search for non-source-file file references

* Fix and accept API baselines

* Fix useless or

* A definition is unverified if the file path was a guess, even if a source file has that path
This commit is contained in:
Andrew Branch
2021-03-01 15:15:09 -08:00
committed by GitHub
parent aa67b16e99
commit 4b67b4a7bc
15 changed files with 164 additions and 27 deletions

View File

@@ -987,8 +987,15 @@ namespace ts.server.protocol {
export interface FileSpanWithContext extends FileSpan, TextSpanWithContext {
}
export interface DefinitionInfo extends FileSpanWithContext {
/**
* When true, the file may or may not exist.
*/
unverified?: boolean;
}
export interface DefinitionInfoAndBoundSpan {
definitions: readonly FileSpanWithContext[];
definitions: readonly DefinitionInfo[];
textSpan: TextSpan;
}