GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — Support go-to-definition for imports of arbitrary files by andrewbranch · Pull Request #42539 · microsoft/TypeScript Conversation
|
|
TypeScript Bot (@typescript-bot) pack this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the tarball bundle task on this PR at 5f256f1. You can monitor the build here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Heads up Matt Bierner (@mjbvz) and Mine Starks (@minestarks). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
How does this work with partial semantic mode (including in the browser)? What will happen if we try go-to-definition on import { thing } from "./vandelay.js"/*1*/; thing/*2*/(); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Hey Daniel Rosenwasser (@DanielRosenwasser), I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Whatever the current behavior for go-to-definition on the identifier reference, that will be unchanged.
Don’t we already resolve one level of direct imports from your current source file? That should be unchanged as well. If we don’t, we would return a response saying the definition is at position 0 of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I mostly ask because #39037 is a related issue I've been interested in unlocking as well, but I get why this doesn't automatically unlock that. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Answering a question that nobody has asked, I tested this with emacs. This gives a picture of how a simply written language plugin will behave and is usually similar to how VS works too. Everything works fine. For the non-existent file, the editor raises an error inside |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sheetal Nandi (@sheetalkamat) I’m looking at adding a case in partialSemanticServer.ts now (just pushed a new commit), and it seems imports are resolved... the source file’s If we hadn’t resolved them, this case would be a problem, because the module specifier is extensionless. Without doing at least some basic module resolution, we wouldn’t know that the target file has a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Andrew Branch (@andrewbranch) interesting.. till you pointed out, I didn't realize we were doing module resolution as part of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
In that case, this feature currently works exactly the same for partial semantic mode as full semantic mode, and the new test will ensure that we don’t break it if we change partial semantic mode later. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2c49160 to
f6d3b18
Compare
There was an error while loading. Please reload this page.
|
New changes:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…urce file has that path
| end: node.getEnd(), | ||
| fileName: node.text | ||
| }, | ||
| unverified: !!verifiedFileName, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Andrew Branch (@andrewbranch) just realised that we are not passing this on in the through server even though we added this property to protocol.
tsserver37220.log
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
That's correct, it was shipped in 4.3 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Go-to-definition doesn't work when a file exists but is not a module
There was an error while loading. Please reload this page.