Skip to content

Improve completion label details display #15956

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

Merged
merged 2 commits into from
Nov 24, 2023
Merged

Conversation

ahlinc
Copy link
Contributor

@ahlinc ahlinc commented Nov 24, 2023

This PR improves completion label details display by separating trait and alias info from the label LSP field to an additional existing label_detail field. Changes look like the following:

Before

Screenshot from 2023-11-24 12-03-08

After

Screenshot from 2023-11-24 12-21-57

All existing tests are passed without any changes in test themselves logic.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 24, 2023
@lnicola
Copy link
Member

lnicola commented Nov 24, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Nov 24, 2023

📌 Commit f8bf1dc has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Nov 24, 2023

⌛ Testing commit f8bf1dc with merge 1c794ac...

bors added a commit that referenced this pull request Nov 24, 2023
Improve completion label details display

This PR improves completion label details display by separating trait and alias info from the `label` LSP field to an additional existing `label_detail` field. Changes look like the following:

### Before

![Screenshot from 2023-11-24 12-03-08](https://github.com/rust-lang/rust-analyzer/assets/14666676/74066f0d-f1ac-4e99-8be5-c5141d513d23)

### After

![Screenshot from 2023-11-24 12-21-57](https://github.com/rust-lang/rust-analyzer/assets/14666676/45fca112-4612-40a3-81b9-07ff12de0962)

_All existing tests are passed without any changes in test themselves logic._
@lnicola
Copy link
Member

lnicola commented Nov 24, 2023

@bors r-

@lnicola
Copy link
Member

lnicola commented Nov 24, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Nov 24, 2023

📌 Commit f0adf8c has been approved by lnicola

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Nov 24, 2023

⌛ Testing commit f0adf8c with merge 8733728...

@ahlinc
Copy link
Contributor Author

ahlinc commented Nov 24, 2023

@lnicola As I understand @bors will complete this PR as it saw it on the f8bf1dc commit.
Can I open an another PR with a small fix that force pushed here?
As I understand you can poke @bors again to get it to see the latest changes on the PR branch where I fixed your notice and added some doc comment.

@lnicola
Copy link
Member

lnicola commented Nov 24, 2023

I think it's using the new version now: 8733728.

@ahlinc
Copy link
Contributor Author

ahlinc commented Nov 24, 2023

@lnicola Thank you for such fast assisting and approval of this changes!

@bors
Copy link
Contributor

bors commented Nov 24, 2023

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing 8733728 to master...

@bors bors merged commit 8733728 into rust-lang:master Nov 24, 2023
@ahlinc ahlinc deleted the label-detail branch November 24, 2023 13:20
bors added a commit that referenced this pull request Nov 25, 2023
fix: add fallback for completion label details

This PR adds a fallback to a previous implementation in a case when the label detail field isn't supported by LSP client and the support isn't reported by the LSP initialize request. In this case additional info about trait and aliases would be merged into the label field as it was before the #15956 PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants