-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support go-to-definition for imports of arbitrary files #42539
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5a039af
Support go-to-definition for imports of scripts and arbitrary files
andrewbranch 8a9cc94
Support go-to-definition for non-existent files
andrewbranch 5f256f1
Add missing file property
andrewbranch 248ed37
Use `isExternalModuleNameRelative` instead of `!pathIsBareSpecifier`
andrewbranch f6d3b18
Add partial semantic test
andrewbranch a5195f5
Combine with symbol search for non-source-file file references
andrewbranch 54d8a72
Fix and accept API baselines
andrewbranch 48e0d26
Fix useless or
andrewbranch c2aa82c
A definition is unverified if the file path was a guess, even if a so…
andrewbranch 280926f
Merge branch 'master' into bug/41861
andrewbranch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewbranch just realised that we are not passing this on in the through server even though we added this property to protocol.
tsserver37220.log