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

improvement: sorting workspace members with same name by frequency #6393

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

Temurlock
Copy link
Contributor

inspired by: scalameta/metals-feature-requests#254 (comment)

Added ranking by frequency for workspace symbols with the same name.
It useful when project has multiple objects with same name (like Future (scala, java, twitter) or Clock (java, cats, zio))
It uses ReferenceProvider to count files where workspace member could have been referenced
False positive result from bloom filter is counted as reference in file to keep sorting fast (if we wanted to make it precise we should read semanticdb of matching paths which is expensive)

@Temurlock Temurlock force-pushed the sorting_workspace_members branch 2 times, most recently from c19e31b to b764a3a Compare May 9, 2024 21:05
Copy link
Contributor

@filipwiech filipwiech left a comment

Choose a reason for hiding this comment

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

This seems like a really nice idea, and limiting it to the symbols with the same name only looks like a safe bet that shouldn't disrupt anything. 🙂

@Temurlock Temurlock force-pushed the sorting_workspace_members branch from b764a3a to bf42d0d Compare May 10, 2024 05:47
@Temurlock Temurlock force-pushed the sorting_workspace_members branch from bf42d0d to 3e1f2f3 Compare May 19, 2024 15:23
@Temurlock Temurlock force-pushed the sorting_workspace_members branch from 2d23ffe to e67d5d3 Compare May 21, 2024 06:01
@Temurlock Temurlock requested review from tgodzik and kasiaMarek May 21, 2024 12:00
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Some comments plus you need to rebase your PR and run scalafmt

val futureCompletionResult: List[String] =
List("Future - scala.concurrent", "Future - java.util.concurrent")

checkItems(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use check it would still be visible which one is first.

@Temurlock Temurlock force-pushed the sorting_workspace_members branch from e67d5d3 to 361b2fc Compare June 26, 2024 11:33
@Temurlock Temurlock force-pushed the sorting_workspace_members branch from 361b2fc to 3c047b4 Compare July 4, 2024 04:55
@Temurlock Temurlock force-pushed the sorting_workspace_members branch from 3c047b4 to 71f7d34 Compare July 4, 2024 05:05
@Temurlock Temurlock force-pushed the sorting_workspace_members branch from 71f7d34 to 6d42fa1 Compare July 4, 2024 05:49
@Temurlock Temurlock force-pushed the sorting_workspace_members branch from 6d42fa1 to ed3a875 Compare July 4, 2024 07:17
@Temurlock Temurlock force-pushed the sorting_workspace_members branch from ed3a875 to 4467bc7 Compare July 4, 2024 10:46
@Temurlock Temurlock requested a review from tgodzik July 4, 2024 12:37
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

Great work, so minor comments from me.

@Temurlock Temurlock force-pushed the sorting_workspace_members branch from 4467bc7 to e5fea0c Compare July 8, 2024 09:43
@Temurlock Temurlock requested a review from tgodzik July 8, 2024 12:39
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

LGTM!

@tgodzik tgodzik merged commit 34db21f into scalameta:main Jul 16, 2024
24 checks passed
tgodzik added a commit to scala/scala3 that referenced this pull request Aug 12, 2024
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.

4 participants