Skip to content

fix(language-server): defer HTML expression completions to TS#15927

Merged
Princesseuh merged 2 commits into
withastro:mainfrom
felmonon:fix/href-attribute-expression-completions
Mar 16, 2026
Merged

fix(language-server): defer HTML expression completions to TS#15927
Princesseuh merged 2 commits into
withastro:mainfrom
felmonon:fix/href-attribute-expression-completions

Conversation

@felmonon
Copy link
Copy Markdown
Contributor

Summary

  • let the HTML plugin return null when completion is requested inside a brace expression so the TypeScript service can handle it
  • add a regression test covering completions in HTML attribute expressions like href={some}
  • add a changeset for the language server fix

Fixes #14671.

Testing

  • pnpm -C packages/language-tools/language-server build
  • pnpm -C packages/language-tools/language-server exec astro-scripts test test/typescript/completions.test.ts --teardown-test ./test/misc/teardown.ts --tsx true --setup ./test/setup.js
  • pnpm -C packages/language-tools/language-server exec astro-scripts test test/html/completions.test.ts --teardown-test ./test/misc/teardown.ts --tsx true --setup ./test/setup.js
  • pnpm -C packages/language-tools/language-server exec astro-scripts test test/{html/completions.test.ts,typescript/completions.test.ts} --teardown-test ./test/misc/teardown.ts --tsx true --setup ./test/setup.js

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 15, 2026

🦋 Changeset detected

Latest commit: 95ab634

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

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 thread .changeset/green-forks-laugh.md
Comment thread .changeset/green-forks-laugh.md Outdated
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Copy link
Copy Markdown
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

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

Tried this in local and it seemed to work fine!

@Princesseuh Princesseuh merged commit 421e8de into withastro:main Mar 16, 2026
8 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Mar 16, 2026
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: No type support/suggestions when using {} for href.

2 participants