withastro / language-tools

Language tools for Astro
MIT License
272 stars 54 forks source link

fix: reload content on collections change #966

Closed Princesseuh closed 1 month ago

Princesseuh commented 1 month ago

Changes

This reworks a bit how we handle reloading schemas and add support for reloading the entire collections config. This PR focuses on fixing the language server handling of it, the TypeScript plugin part isn't as problematic, the only thing it doesn't handle is new collections being added, file updates works correctly (since they only care about the .ts part, not the schema)

Testing

I added a (1) test, this is generally hard to test because there's so many moving parts to it, the editor seeing the file changes, Astro reloading the file etc.

The one test should at least make sure the general idea for updating schemas works

Docs

N/A

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 534da57de8089854b9da9e708001388dfb500af0

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

This PR includes changesets to release 3 packages | Name | Type | | ------------------------ | ----- | | @astrojs/language-server | Patch | | @astrojs/ts-plugin | Patch | | astro-vscode | Patch |

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