Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

fix: scripts affecting intellisense#900

Merged
Princesseuh merged 5 commits into
mainfrom
fix/script-intellisense
Jul 16, 2024
Merged

fix: scripts affecting intellisense#900
Princesseuh merged 5 commits into
mainfrom
fix/script-intellisense

Conversation

@Princesseuh
Copy link
Copy Markdown
Member

@Princesseuh Princesseuh commented Jul 11, 2024

Changes

Requires withastro/compiler#1019

This PR reworks how script and style are extracted from files, using the compiler's information instead of crawling through various ASTs. This makes file updates simpler, much faster, and also more correct as the ASTs sometimes had wrong or misleading positions due to how they were being generated.

Fixes #800
Fixes #862
This PR also fixes an issue where CSS selection ranges didn't work inside style tags, reported on Discord

Testing

Tests should pass!

Docs

N/A

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jul 11, 2024

🦋 Changeset detected

Latest commit: db9f309

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

Comment on lines -113 to -114
* TODO: Merge this with `findEmbeddedCSS`? Unlike scripts, there's no scoping being done here, so merging all of it in
* the same virtual file is possible, though it might make mapping more tricky.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the case now in the new format, which improves intellisense for class names and stuff when you have multiple style tags in the same file. Kinda unlikely, but still funny!

@Princesseuh Princesseuh merged commit d993c0d into main Jul 16, 2024
@Princesseuh Princesseuh deleted the fix/script-intellisense branch July 16, 2024 16:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

2 participants