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

fix(js/css): Fixes intellisense inside inline styles and scripts #897

Closed
wants to merge 4 commits into from

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Jul 9, 2024

Changes

We calculate inline scripts and styles (inside HTML events and style attributes respectively) using the positions from the AST the compiler returns. This is fine, however the offset it returns consider multiple bytes characters, unlike LSP (well, it's in reality more complicated than that because of encoding and stuff, but it's still somewhat that)

This PR changes it so we uses the Point returned instead, which do consider lines and columns character by character

Fixes #862

Testing

Added a bunch of tests

Docs

N/A

Copy link

changeset-bot bot commented Jul 9, 2024

🦋 Changeset detected

Latest commit: d329910

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/check 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

@Princesseuh Princesseuh marked this pull request as ready for review July 9, 2024 15:50
Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

I believe in you! 🌻

Princesseuh added a commit that referenced this pull request Jul 11, 2024
@Princesseuh
Copy link
Member Author

Superceded by #900, added the tests from this PR to it

Princesseuh added a commit that referenced this pull request Jul 16, 2024
* fix: scripts affecting intellisense

* test: add tests from #897

* feat: update compiler

* chore: changeset
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: autocomplete does not work with inline style when Japanese text is included in an element.
2 participants