ember-tooling / ember-language-server

Language Server Protocol implementation for Ember.js projects
MIT License
98 stars 39 forks source link

Auto-import component for templates (diagnostics fix) #405

Open lifeart opened 2 weeks ago

lifeart commented 2 weeks ago

https://discord.com/channels/480462759797063690/487336430742274058/1278762113351028777

image

Notes, at the moment we already have related behaviour for components autocomplete:

https://github.com/lifeart/ember-language-server/blob/component-context-info-origin/src/completion-provider/glimmer-script-completion-provider.ts#L155

We may re-use it with diagnostics messages to provide this kind of fixes.


Logic:

If it's gts/gjs file, and we unable to find scoped name for CamelCased component-like template item, we should emit warning diagnostics message with possible fix (import file if exists in registry)