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

Add support for inlay hints #265

Merged
merged 4 commits into from
May 12, 2022
Merged

Add support for inlay hints #265

merged 4 commits into from
May 12, 2022

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Apr 28, 2022

Changes

This adds support for inlay hints! This requires upgrading the versions of a few things as inlay hints support was only added in the latest version of the LSP. Those versions are stable, as they've been through a lot of testing (and are already in use by other extensions)

image

Testing

Tests added

Docs

No docs needed, inlayHints are enabled using the same configuration they're enabled with in TypeScript files

@changeset-bot
Copy link

changeset-bot bot commented Apr 28, 2022

🦋 Changeset detected

Latest commit: ffd285e

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 added the ecosystem: upstream Issue is caused by a bug / missing feature upstream label May 3, 2022
@Princesseuh Princesseuh removed the ecosystem: upstream Issue is caused by a bug / missing feature upstream label May 11, 2022
@Princesseuh Princesseuh changed the title [WIP] Add support for inlay hints Add support for inlay hints May 11, 2022
@Princesseuh Princesseuh marked this pull request as ready for review May 11, 2022 14:57
@Princesseuh Princesseuh requested a review from a team as a code owner May 11, 2022 14:57
@Princesseuh Princesseuh self-assigned this May 11, 2022
Copy link
Collaborator

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

missing a changeset but otherwise looks good

Comment on lines +258 to +261
if (data.originalItem.source) {
item.labelDetails = { description: data.originalItem.source };
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Just a quick fix since we now support label details with the latest version of LSP, we also need to set it when resolving imports otherwise the resolved import label details will be empty

@Princesseuh Princesseuh merged commit 09e1163 into main May 12, 2022
@Princesseuh Princesseuh deleted the inlay-hints branch May 12, 2022 15:56
Princesseuh added a commit that referenced this pull request May 19, 2022
Princesseuh added a commit that referenced this pull request May 19, 2022
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.

2 participants