Skip to content
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

gather list of tools that do have autocomplete working #2

Open
bmeck opened this issue Apr 3, 2020 · 4 comments
Open

gather list of tools that do have autocomplete working #2

bmeck opened this issue Apr 3, 2020 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@bmeck
Copy link
Owner

bmeck commented Apr 3, 2020

Particularly, given in a node project:

import 'fs'|
  //       ^ caret

They can perform some kind of completion for the binding names so that you end up with things like:

// caret position not important on the modified line
import {readFile} from 'fs'

I do not have editor/tooling that I currently use that does this without custom configuration. It seems that if no tooling does this by default, finding the reason why would be good.

@bmeck bmeck added the help wanted Extra attention is needed label Apr 3, 2020
@hax
Copy link

hax commented Apr 30, 2020

I guess one reason of "not by default", is programmers need to know it to make it work. For example, how can I know import 'fs' could have autocomplete? If I don't know, I will always write import {readFile} first.

IMO, the only discoverable way is creating a snippet import {} from '|' automatically or at least give a hint when you enter import |.

@bmeck
Copy link
Owner Author

bmeck commented Apr 2, 2021

Typescript is just now adding support ( https://devblogs.microsoft.com/typescript/announcing-typescript-4-3-beta/#import-statement-completions ), but they did reach out and state the status quo is a performance concern. CC: @DanielRosenwasser

@DanielRosenwasser
Copy link

DanielRosenwasser commented Apr 2, 2021

@andrewbranch did a lot of work to uncover existing inefficiencies and exploit different levels of caching to make this work well. He can speak more to this.

It remains to be seen whether this really alleviates the pain. I'm not huge on deferring to tooling to fix this but it might be enough. You can try it out in VS Code Insiders with the TypeScript/JavaScript Nightly extension.

@andrewbranch
Copy link

I will also point out that the feature we just added in TypeScript is obviously only useful to developers who already have some idea what a given module exports. Sometimes when I install an unfamiliar module, requesting completions at import { | } from "unfamiliar-module" is enough to get me started using it, but seeing every possibility at import | won’t help me at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants