3

Implement location link for type inlay hints by HKalbasi · Pull Request #13699 ·...

 1 year ago
source link: https://github.com/rust-lang/rust-analyzer/pull/13699
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Implement location link for type inlay hints #13699

Conversation

Contributor

@HKalbasi HKalbasi commented Nov 29, 2022

edited by Veykril

fix #11701

This actually doesn't work due a problem in vscode: microsoft/vscode#167564

changelog note: The vscode issue is now fixed, but won't land until the january release, so the feature is disabled serverside for VSCode until then

jonas-schievink, jhgg, Veykril, noritada, SomeoneToIgnore, Bilalh, and safasofuoglu reacted with heart emoji

rustbot

added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label

Nov 29, 2022

Contributor

Author

HKalbasi commented Nov 29, 2022

@rustbot blocked

rustbot

added S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work.

and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

Nov 29, 2022

Collaborator

bors commented Dec 20, 2022

umbrella The latest upstream changes (presumably #13804) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

Author

HKalbasi commented Dec 20, 2022

The vscode issue is now fixed, but if I understand correctly it will be included in January release, not next release.

Member

Veykril commented Dec 21, 2022

Since it won't release until the january release I think we have two options, wait with merging this PR, or check the vscode client version on the server to conditionally enable the link part of this PR as VSCode tells its version in the InitializeParams (current version sends this "clientInfo":{"name":"Visual Studio Code","version":"1.74.1"}) and remove the check some months in the future since we drop support for older VSCode versions pretty fast anyways.

// FIXME: This is here since it is input of a method in `HirWrite`

// and things outside of hir need to implement that trait. We probably

// should move whole `hir_ty::display` to this crate so we will become

// able to use `ModuleDef` or `Definition` instead of `ModuleDefId`.

I think in general we want to have proper visitors for various things at some point, since the HirWrite interface is tailored to IDE purposes right now and shouldn't really be part of hir-ty either.

I think we should have something in hir-ty that basically turns a type into a tree that directly maps to surface syntax, but still uses IDs instead of names. That representation could then be consumed by the IDE crates

Veykril reacted with thumbs up emoji

Contributor

Author

HKalbasi commented Dec 21, 2022

check the vscode client version on the server to conditionally enable the link part of this PR

I think it is not necessary, since it wouldn't cause crash or anything like that, it just doesn't do its job.

Member

Veykril commented Dec 21, 2022

it just doesn't do its job.

I know but I imagine people will start reporting this as a bug. Though maybe its fine if we note this down in the changelog that it current VSCode has a bug there.

HKalbasi reacted with thumbs up emoji

Member

Veykril commented Dec 21, 2022

Thanks!
@bors r+

Collaborator

bors commented Dec 21, 2022

pushpin Commit e1aa73e has been approved by Veykril

It is now in the queue for this repository.

Collaborator

bors commented Dec 21, 2022

hourglass Testing commit e1aa73e with merge 271f7b4...

Collaborator

bors commented Dec 21, 2022

sunny Test successful - checks-actions
Approved by: Veykril
Pushing 271f7b4 to master...

if let Some(client) = client_info {

if client.name.contains("Code") || client.name.contains("Codium") {

if let Some(version) = &client.version {

if version.as_str() < "1.76" {

Shouldn't this be 1.75? 1.74 is the November release, they skip December, and 1.75 comes out in January.

Contributor

Author

@HKalbasi HKalbasi Dec 26, 2022

You are right. I wasn't aware that they will skip december release entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Assignees

No one assigned

Labels
S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work.
Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Implement inlay hint location links

6 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK