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

How to handle "Could not load snapshot text for XXX" warning? #7064

Open
tribbloid opened this issue Dec 24, 2024 · 5 comments
Open

How to handle "Could not load snapshot text for XXX" warning? #7064

tribbloid opened this issue Dec 24, 2024 · 5 comments

Comments

@tribbloid
Copy link

Describe the bug

When trying to compile a Scala 2 project:

https://github.com/tribbloid/prover-commons

I got a lot of errors like this:

image

2024.12.23 22:16:39 WARN  Could not load snapshot text for /home/peng/git/spookystuff/prover-commons/module/core/src/main/scala/ai/acyclic/prover/commons/graph/local/ops/AnyGraphUnary.scala

What does it mean? How to fix it?

Expected behavior

Should load snapshot text, or at least direct user on how to find it

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

1.4.2

Extra context or search terms

No response

@tribbloid
Copy link
Author

this problem is also encountered in IntelliJ IDEA + LSP4IJ plugin:


2024.12.27 17:58:36 WARN  Could not load snapshot text for /home/peng/git-template/scaffold-gradle-kts/core/src/main/scala/ai/acyclic/scaffold/Example.scala
2024.12.27 17:58:36 WARN  Could not load snapshot text for /home/peng/git-template/scaffold-gradle-kts/core/src/main/scala/ai/acyclic/scaffold/Example.scala
2024.12.27 17:58:36 WARN  Could not load snapshot text for /home/peng/git-template/scaffold-gradle-kts/core/src/main/scala/ai/acyclic/scaffold/Example.scala

could be easily reproduced on a sample project: https://github.com/tribbloid/scaffold-gradle-kts/tree/b421ae8cb778affaf3759a9b79b9462e161dd9ed

@tribbloid
Copy link
Author

LSP appears to have invoked gradle-bloop 1.6.2 before launching, could it be where problem come from?

@tgodzik
Copy link
Contributor

tgodzik commented Dec 30, 2024

That should not be the problem, this only happens if the currently compiled semanticdb is not generated from the current file.

My guess is that this might be caused by checking out a different branch and code not compiling anymore. In that case if the file was never opened we never did save the text used for semanticdb.

I need to make it more foolproof, since this logic seem quite flaky. This should go away once the code is fully compiled, but we do have some fallbacks so this should no longer be that big of an issue.

@tribbloid
Copy link
Author

ah that explained it, almost forgot that Scala 3 best effort compilation feature is not available for Scala 2

in this case it should be swept into the backlog

@tgodzik
Copy link
Contributor

tgodzik commented Dec 31, 2024

We should only print this warning if none of the fallbacks worked, or better yet create a report for the user to bring to us. The current warning is less than useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Triage
Development

No branches or pull requests

2 participants