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: use pc for go to def when stale semanticdb #7028

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kasiaMarek
Copy link
Contributor

resolves: #7027

@kasiaMarek kasiaMarek marked this pull request as ready for review December 19, 2024 10:47
@kasiaMarek kasiaMarek requested a review from tgodzik December 19, 2024 10:47
): Future[DefinitionResult] =
for {
fromCompiler <-
if (path.isScalaFilename && !isAmmonnite(path))
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we just keep the current order for Ammonite? With this change we would not use compiler for Ammonite, right?

I wonder if we could just adjust tests to take that into account?

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 can also fix it and map generated Ammonite files to source files like we do for Scala CLI, if we want to still have Ammonite support.

Reordering is only half of a fix since for local symbols using pc will lead to generated sources. But I can also do that, if don't know where we are with Ammonite support.

Copy link
Contributor

Choose a reason for hiding this comment

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

I raised the topic on discord again and will start pushing it. In the meantime I don't think we want to work on any fixes, which we will be removing in the future.

So if it's too much work let's just leave it as is then.

private var fallbackDefn: Option[DefinitionResult] = None
private var nonLocalGuesses: List[String] = List.empty

private var fundScaladocDef = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private var fundScaladocDef = false
private var foundScaladocDef = false

@@ -233,7 +233,7 @@ class DefinitionLspSuite
|package a
|object B/*L1*/ {
| def main/*L2*/() = {
| println/*Predef.scala*/(A/*;A.scala:2;A.scala:3*/("John"))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the idea here was to show both object and case class. Any idea why this changed?

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.

Incorrect go to def when stale SemanticDB
2 participants