Making VSCode import autocomplete work with `@glimmer/component`

By following the instructions at Stable TypeScript Types in Ember 5.1, I’ve been able to get VSCode autocomplete working in Discourse. We’re using JS (not TS), Ember 5.5, with Embroider.

/**
 * @typedef {import('ember-source/types')} EmberTypes
 */

This works pretty well, but does not appear to include @glimmer/component. So if I autocomplete on import Component, I get this:

@ember/component makes sense. But it seems weird that @ember/-internals/... and @glimmer/component/dist/.. are available.

Is there a @typedef statement which could help add @glimmer/component to this list? And is there any way to remove those internal modules from the list?

WIP branch can be found here: DEV: Switch to bundled Ember types by davidtaylorhq · Pull Request #25370 · discourse/discourse · GitHub

4 Likes