withastro / language-tools

Language tools for Astro
MIT License
242 stars 46 forks source link

🐛 BUG: quick fixes not working #798

Closed boiiiboi closed 5 months ago

boiiiboi commented 5 months ago

Describe the Bug

Title: Quick Fixes not working for TypeScript in Neovim with nvim-lspconfig

Description Quick Fixes for TypeScript imports are not working in Neovim when using nvim-lspconfig with tsserver. The expected import suggestions do not appear when hovering over unresolved symbols.

Expected Behavior A list of Quick Fixes should appear, including options to automatically import the unresolved symbol.

Actual Behavior No Quick Fixes are suggested, and no import options are shown.

Environment

Screenshots/Logs LspLog has no errors.

[START][2024-02-15 22:19:01] LSP logging initiated
[WARN][2024-02-15 22:19:01] ...lsp/handlers.lua:137 "The language server astro triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless"

Attempted Solutions

Additional Context This issue started occurring after updating to the latest version of nvim-lspconfig. Previous setups with similar configurations did not exhibit this problem.

Steps to Reproduce

  1. Install nvim-lspconfig and configure tsserver according to the documentation.
  2. Open a astro file and use an undefined symbol.
  3. Hover over the symbol and attempt to invoke Quick Fixes.
boiiiboi commented 5 months ago

After applying the settings from this page, everything worked out. My apologies for any confusion.

https://docs.astro.build/en/guides/typescript/#import-aliases