Skip to content

Add codefix and completions for promoting existing type-only imports to non-type-only - #47552

Merged
Andrew Branch (andrewbranch) merged 5 commits into
microsoft:mainfrom
andrewbranch:feature/44804
Jan 26, 2022
Merged

Add codefix and completions for promoting existing type-only imports to non-type-only#47552
Andrew Branch (andrewbranch) merged 5 commits into
microsoft:mainfrom
andrewbranch:feature/44804

Conversation

@andrewbranch

@andrewbranch Andrew Branch (andrewbranch) commented Jan 22, 2022

Copy link
Copy Markdown
Member

Fixes #44804

We may want a corresponding VS Code update, because there is currently no indication in the completion details display that this completion has an associated action, even though we send a localized description with the code actions. I only just noticed that VS Code never uses that description; instead, the “Auto-import from ...” text seems to be hard-coded in the extension.

Was trying to get a screen recording, but my recorder software is crashing.

completion entry

codefix menu

codefix menu

@andrewbranch

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 22, 2022

Copy link
Copy Markdown
Contributor

Heya Andrew Branch (@andrewbranch), I've started to run the tarball bundle task on this PR at 280ad8e. You can monitor the build here.

@andrewbranch

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 22, 2022

Copy link
Copy Markdown
Contributor

Heya Andrew Branch (@andrewbranch), I've started to run the tarball bundle task on this PR at 8dee845. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Jan 22, 2022

Copy link
Copy Markdown
Contributor

Hey Andrew Branch (@andrewbranch), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/118112/artifacts?artifactName=tgz&fileId=2F94EF63693E9F06E11FA28AF9740F9151E995C6E631B1AFDC2A15F03C8DE06602&fileName=/typescript-4.6.0-insiders.20220122.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@4.6.0-pr-47552-4".;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some minor questions.

Comment thread src/services/textChanges.ts
Comment thread src/services/textChanges.ts
Comment thread src/services/codefixes/importFixes.ts Outdated
@lgarron

Lucas Garron (lgarron) commented Jan 29, 2022

Copy link
Copy Markdown

I had a chance to test this out for #47631 and it's 😻😻😻😻😻😻 for our project!

Thanks so much, Andrew Branch (@andrewbranch) and TypeScript Bot (@typescript-bot)!

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Existing import type prevents autocompletion of value import for TypeScript

4 participants