Skip to content

set sort label for quick access elements to avoid symbols get removed when they have the same label - #1124

Merged
martinlippert merged 1 commit into
eclipse-lsp4e:mainfrom
martinlippert:quick-access-sorting-fix
Sep 27, 2024
Merged

martinlippert merged 1 commit into
eclipse-lsp4e:mainfrom
martinlippert:quick-access-sorting-fix

Conversation

@martinlippert

Copy link
Copy Markdown
Contributor

When you have multiple workspace symbols with the same label, only one shows up in the workspace quick access list. The reason is that the filtering and sorting mechanism of the quick access dialog uses a comparator for a set that uses the getSortLabel method of the elements - which refers to getLabel by default.

This PR overrides the default implementation and makes sure (by adding the random extension ID to make symbols unique) that getSortLabel returns different values for different symbols, even if they have the exact same label.

As a follow-up here, we should think about showing more information for a symbol on the dialog to allow users to distinguish those symbols with the same label somehow, but that is a task for a separate PR or issue.

@mickaelistria mickaelistria left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All good to me. Feel free to merge as soon as Jenkins build completes successfully.

@martinlippert
martinlippert merged commit 8cd5d23 into eclipse-lsp4e:main Sep 27, 2024
@martinlippert

Copy link
Copy Markdown
Contributor Author

Thanks @mickaelistria and @rubenporras for taking a look, much appreciated. Merged now.

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.

3 participants