#Automatic import updates not triggering when renaming/moving .astro files in VS Code

3 messages · Page 1 of 1 (latest)

digital lynx
#

Whenever I rename or move an .astro component within the src/ directory using VS Code, the files that import that component do not update their import paths automatically.

Is this a known limitation of the Astro Language Server, or is there a specific setting I need to toggle to get .astro files to behave like .ts or .js files during a refactor?

rustic vineBOT
#

Hi @digital lynx. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

I’m sorry, but the provided knowledge sources don’t mention anything about automatic import updates or refactor/rename behavior for .astro files in VS Code or the Astro Language Server.

The docs do cover:

  • Recommended editor setup and the official VS Code extension, but only at a high level (syntax highlighting, IntelliSense, etc.), without detailing refactor features. [Editor setup]
  • TypeScript configuration and the @astrojs/ts-plugin, but again nothing about auto‑updating imports on file move/rename. [TypeScript setup]

Because of this, I can’t say from these sources whether what you’re seeing is a known limitation or a configuration issue, nor can I point to a specific setting to enable that behavior.

Given the limits of the docs here, the best next step would be to:

  • Check the Astro VS Code extension page and its documentation/changelog for mention of “rename”, “refactor”, or “update imports”. [Editor setup]
  • If it’s not documented there, open an issue or discussion on the Astro repo or the extension’s issue tracker describing your VS Code version, Astro extension version, and a minimal repro.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: