Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow disabling handling updating files on file renames #961

Merged
merged 4 commits into from
Oct 3, 2024

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Oct 3, 2024

Changes

When using the Astro TypeScript plugin in addition to the language server, both will attempt to update imports whenever a file is renamed.

Both of them will handle it correctly individually, however if you run both in a row (pressing Yes or Always to the prompt in VS Code) the result will be corrupted, as editors who can handle multiple LSP renaming at the same time won't merge the results, they'll run them sequentially.

This PR adds a setting to disable the language server's handling of this, as more often than not, you want the TS plugin to handle it (so that it might handle additional formats from other plugins as well). This setting is disabled by default in VS Code, as the TS plugin is always included.

Fix #896

Testing

Added tests

Docs

Apart from the setting description, N/A.

Copy link

changeset-bot bot commented Oct 3, 2024

🦋 Changeset detected

Latest commit: f5e64e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@astrojs/language-server Minor
astro-vscode Minor

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

@Princesseuh Princesseuh merged commit 3a836de into main Oct 3, 2024
4 checks passed
@Princesseuh Princesseuh deleted the feat/allow-disable-imports-updates branch October 3, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Refactoring astro.config.mjs file name is wrong
2 participants