Skip to content

[typescript-language-features] Add importModuleSpecifierEnding preference #90405

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

Merged

Conversation

andrewbranch
Copy link
Member

This PR fixes microsoft/TypeScript#24779
TS protocol update: microsoft/TypeScript#36725

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 10, 2020

Thanks! Quick question: does this only work on TS 3.8+ or does it work on older TS versions? Any idea which TS version it was first introduced with?

@andrewbranch
Copy link
Member Author

It looks like it should work from TS 3.1 onward: microsoft/TypeScript#26028

@minestarks
Copy link
Member

Does this also influence the "auto update import on rename file" scenario? Should it? (And should the user setting text reflect that?)

@andrewbranch
Copy link
Member Author

@minestarks I’m open to suggestions on the text, but more and more refactors are incorporating auto-imports (microsoft/TypeScript#36615), so I don’t think we can call them all out individually.

Updating this PR with a default “auto” mode that omits this setting so TS Server can continue to pick a default based on project settings.

@minestarks
Copy link
Member

@andrewbranch oh OK, I think the text is fine then, I was under the impression that "auto import" only referred to the completion list feature. But it may make sense to think of it as "any instance where we add/edit an import statement for you".

@andrewbranch
Copy link
Member Author

I want to discuss how this setting will interact with future ESM work with the team first, so I’m going to close in the meantime.

@andrewbranch
Copy link
Member Author

Ok, we decided to move forward with this, since we anticipate some time and complexity before we have a new module resolution mode that would require .js extensions. Build should turn green when microsoft/TypeScript#36725 is merged.

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 26, 2020

@andrewbranch Is this good to merge now?

@mjbvz mjbvz added this to the March 2020 milestone Feb 26, 2020
@andrewbranch
Copy link
Member Author

@mjbvz I don’t know how you all usually handle protocol updates—these changes should now build against TypeScript master/nightly, but will fail with type errors against TypeScript 3.8. Let me know if you want me to work around that somehow, but otherwise yes, this is ready to be merged.

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 26, 2020

Thanks. We are in endgame I'm going to hold off on merging this until the March release of VS Code

@mjbvz mjbvz merged commit 23850c7 into microsoft:master Feb 28, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 28, 2020

Thanks! Will be in VS Code 1.44 (and the insiders for it)

@andrewbranch andrewbranch deleted the feature/importModuleSpecifierEnding branch February 28, 2020 21:12
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preference for including file extension on auto imports
3 participants