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: Further heuristic improvements #6658

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Aug 8, 2024

Couple of related improvements:

  • escape operators, they are escaped for semanticdb symbols ( otherwise ??? will not be found)
  • add standard Scala imports (needed for scala.Predef.???().)
  • also try and guess method with (). ending
  • check if the returned symbol is exactly the same as we were looking for (could not reproduce it 100% the same as I encountered in the wild, but it's close enough)

Couple of related improvements:
- escape operators, they are escaped for semanticdb symbols ( otherwise ??? will not be found)
- add standard Scala imports (needed for scala.Predef.`???`().)
- also try and guess method with (). ending
- check if the returned symbol is exactly the same as we were looking for (could not reproduce it 100% the same as I encountered in the wild, but it's close enough)
@tgodzik tgodzik requested a review from kasiaMarek August 8, 2024 16:41
@@ -56,7 +56,7 @@ class FallbackDefinitionProvider(
.value
if (isInSelectPosition) List(symbolPrefix + ".")
else if (isInTypePosition) List(symbolPrefix + "#")
else List(".", "#").map(ending => symbolPrefix + ending)
else List(".", "#", "().").map(ending => symbolPrefix + ending)
Copy link
Contributor

Choose a reason for hiding this comment

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

You could possibly improve by finding all overridden method symbols using the same strategy as ScaladocDefinitionProvider#findAllOverLoadedMethods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will work on a follow up next week, thanks!

@tgodzik tgodzik merged commit b7b3ef5 into scalameta:main Aug 20, 2024
20 of 22 checks passed
@tgodzik tgodzik deleted the fix-wrong-heuristic branch August 29, 2024 15:36
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