You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gather list of tools that do have autocomplete working #2
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 lineimport{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.
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 |.
@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.
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.
Activity
hax commentedon 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 writeimport {readFile}first.IMO, the only discoverable way is creating a snippet
import {} from '|'automatically or at least give a hint when you enterimport |.bmeck commentedon 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 commentedon 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 commentedon Apr 2, 2021
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 atimport |won’t help me at all.