fix(language-server): rewrite Astro component auto-import names#15908
fix(language-server): rewrite Astro component auto-import names#15908FelmonFekadu wants to merge 5 commits intowithastro:mainfrom
Conversation
🦋 Changeset detectedLatest commit: ddf73d3 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
This is not the proper way to do it, because changing the component name will cause auto import to return something unexpected. Instead, we should always return the AstroComponent suffixes, but patch auto-import to not add it. You can use the Vue language-tools as reference, IIRC they still do it.
|
Implemented the rework you asked for. This keeps the generated I also dropped the ts-plugin-side rename and updated the language-server coverage around the completion path. |
Summary
AstroComponentsuffixes in the internal TSX output used by the language server.astroauto-import completion labels and resolved import edits back to the expected component name.astroauto-import completion path and the shared import-text rewrite helpersFixes #14683.
Testing
AstroCheckfixture tests because@astrojs/svelteand@astrojs/vueare not installed in this environment; the TypeScript/completion suites above pass)