-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
aa67b16
commit 4b67b4a
Showing
15 changed files
with
164 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/cases/fourslash/goToDefinitionCSSPatternAmbientModule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @esModuleInterop: true | ||
|
||
// @Filename: index.css | ||
//// /*2a*/html { font-size: 16px; } | ||
|
||
// @Filename: types.ts | ||
//// declare module /*2b*/"*.css" { | ||
//// const styles: any; | ||
//// export = styles; | ||
//// } | ||
|
||
// @Filename: index.ts | ||
//// import styles from [|/*1*/"./index.css"|]; | ||
|
||
verify.goToDefinition("1", ["2a", "2b"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @filename: scriptThing.ts | ||
//// /*1d*/console.log("woooo side effects") | ||
|
||
// @filename: stylez.css | ||
//// /*2d*/div { | ||
//// color: magenta; | ||
//// } | ||
|
||
// @filename: moduleThing.ts | ||
|
||
// not a module, but we should let you jump to it. | ||
//// import [|/*1*/"./scriptThing"|]; | ||
|
||
// not JS/TS, but if we can, you should be able to jump to it. | ||
//// import [|/*2*/"./stylez.css"|]; | ||
|
||
verify.goToDefinition("1", "1d"); | ||
verify.goToDefinition("2", "2d"); |
Oops, something went wrong.