-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Expose importModuleSpecifierEnding to protocol #36725
Conversation
Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @amcasey, @mjbvz, @minestarks for you. Feel free to loop in other consumers/maintainers if necessary |
Our current behavior seems to be that of the "index" setting. In the vscode PR the default is set to "minimal." Is that a more common usage? |
@jessetrinity good catch, the default in TS Server depends on the project’s For that matter, shouldn’t we just pick |
@jessetrinity updated the VS Code PR with an “auto” setting that leaves the existing default-picking intact. Thanks! I still want to look at selecting "js" by default in some cases before merging here. |
That is a loaded question. In reality, our
Really we should probably have more than two |
I think there’s a subtlety I’m missing about resolver differences—if you’re checking with TS and compiling with Babel, why wouldn’t you still just use |
@andrewbranch only if you're not using TS to strip the type annotations and you're using the babel plugin. Before the babel plugin existed, you'd go thru TS to strip annotations (with |
Hmm, well that's kind of unfortunate, but still, I don’t think it would be breaking per se to use that as a heuristic for auto-import endings:
So is the heuristic good enough to be worth it? Is it going to be correct for most people? |
Probablyish We're going to have to deal with the commonjs vs esm resolver distinction soon enough anyway, though; |
I’m starting to dislike this as an editor preference because it feels like if you enable |
Yes, when we discussed this offline there was a lot of ambiguity including
Really the only people who benefit are people who have no dependencies |
We decided to move forward with this in the design meeting—any final feedback or concerns? |
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.
Looks good to me with the auto setting.
Fixes #24779
VS Code PR: microsoft/vscode#90405
Pre-existing test (the feature is old)