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

Incorrect errors reported by Metals #4652

Closed
bertlebee opened this issue Nov 18, 2022 · 40 comments
Closed

Incorrect errors reported by Metals #4652

bertlebee opened this issue Nov 18, 2022 · 40 comments

Comments

@bertlebee
Copy link

Describe the bug

Metals sometimes reports "errors" that sbt doesn't. Note that this doesn't only happen with a project that compiles cleanly, but it's most obvious then.

(apologies for the pic, couldn't seem to get this in text form)
image

sbt:root> clean;compile
[success] Total time: 0 s, completed Nov 18, 2022, 12:04:15 PM
[info] compiling 1 Scala source to /home/rob/code/lsp/modules/plugin/target/scala-3.2.0/classes ...
[info] compiling 17 Scala sources to /home/rob/code/lsp/libs/zio-jsonrpc/js/target/scala-3.2.0/classes ...
[info] compiling 17 Scala sources to /home/rob/code/lsp/libs/zio-jsonrpc/jvm/target/scala-3.2.0/classes ...
[info] compiling 17 Scala sources to /home/rob/code/lsp/libs/zio-lsp/jvm/target/scala-3.2.0/classes ...
[info] compiling 17 Scala sources to /home/rob/code/lsp/libs/zio-lsp/js/target/scala-3.2.0/classes ...
[info] compiling 11 Scala sources to /home/rob/code/lsp/modules/server/target/scala-3.2.0/classes ...
[info] compiling 1 Scala source to /home/rob/code/lsp/modules/vscode/target/scala-3.2.0/classes ...
[success] Total time: 10 s, completed Nov 18, 2022, 12:04:24 PM

from metals.log

Nov 18, 2022 11:54:08 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 60407
2022.11.18 11:55:33 INFO  compiling ziolspjs (1 scala source)�[0m
2022.11.18 11:55:33 INFO  time: compiled zioLspJS in 0.13s�[0m
2022.11.18 11:55:34 WARN  Could not load snapshot text for /home/rob/code/lsp/libs/zio-lsp/shared/src/main/scala/zio/lsp/LspProtocol.scala�[0m
2022.11.18 11:55:36 WARN  Could not load snapshot text for /home/rob/code/lsp/libs/zio-lsp/shared/src/main/scala/zio/lsp/LspProtocol.scala�[0m
2022.11.18 11:55:37 WARN  Could not load snapshot text for /home/rob/code/lsp/libs/zio-lsp/shared/src/main/scala/zio/lsp/LspProtocol.scala�[0m
2022.11.18 11:55:38 WARN  Could not load snapshot text for /home/rob/code/lsp/libs/zio-lsp/shared/src/main/scala/zio/lsp/LspProtocol.scala�[0m
2022.11.18 11:55:38 WARN  Could not load snapshot text for /home/rob/code/lsp/libs/zio-lsp/shared/src/main/scala/zio/lsp/LspProtocol.scala�[0m
2022.11.18 11:55:40 WARN  Could not load snapshot text for /home/rob/code/lsp/libs/zio-lsp/shared/src/main/scala/zio/lsp/LspProtocol.scala�[0m
2022.11.18 11:55:41 WARN  Could not load snapshot text for /home/rob/code/lsp/libs/zio-lsp/shared/src/main/scala/zio/lsp/LspProtocol.scala�[0m
2022.11.18 11:55:41 INFO  compiling ziolspjs (1 scala source)�[0m
2022.11.18 11:55:41 WARN  Could not load snapshot text for /home/rob/code/lsp/libs/zio-lsp/shared/src/main/scala/zio/lsp/LspProtocol.scala�[0m
2022.11.18 11:55:41 INFO  time: compiled zioLspJS in 0.3s�[0m
2022.11.18 11:56:41 INFO  compiling ziolspjs (1 scala source)�[0m
2022.11.18 11:56:41 INFO  time: compiled zioLspJS in 0.34s�[0m
2022.11.18 11:57:22 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 11:57:22 INFO  time: compiled zioJsonRpcJS in 0.22s�[0m
2022.11.18 11:57:50 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 11:57:50 INFO  time: compiled zioJsonRpcJS in 0.24s�[0m
2022.11.18 11:57:57 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 11:57:57 INFO  time: compiled zioJsonRpcJS in 0.23s�[0m
Nov 18, 2022 11:58:00 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 61079
2022.11.18 11:58:01 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 11:58:01 WARN  Could not load snapshot text for /home/rob/code/lsp/libs/zio-jsonrpc/shared/src/main/scala/sls/jsonrpc/JsonRpc.scala�[0m
2022.11.18 11:58:01 INFO  time: compiled zioJsonRpcJS in 0.3s�[0m
2022.11.18 11:59:55 INFO  compiling ziolspjs (3 scala sources)�[0m
2022.11.18 11:59:56 INFO  time: compiled zioLspJS in 1.04s�[0m
2022.11.18 12:00:36 WARN  Name doesn't match for JsonRpc at Range(15,44,15,48)�[0m
2022.11.18 12:00:36 WARN  Name doesn't match for JsonRpc at Range(16,11,16,15)�[0m
2022.11.18 12:00:37 INFO  compiling ziojsonrpcjs (17 scala sources)�[0m
2022.11.18 12:00:38 INFO  time: compiled zioJsonRpcJS in 1.67s�[0m
2022.11.18 12:00:38 INFO  compiling ziolspjs (17 scala sources)�[0m
2022.11.18 12:00:40 INFO  time: compiled zioLspJS in 1.15s�[0m
Nov 18, 2022 12:00:56 PM scala.meta.internal.metals.Docstrings indexSymbol
SEVERE: file:///home/rob/code/lsp/libs/zio-jsonrpc/shared/src/main/scala/sls/jsonrpc/JsonRpc.scala
java.nio.file.NoSuchFileException: /home/rob/code/lsp/libs/zio-jsonrpc/shared/src/main/scala/sls/jsonrpc/JsonRpc.scala
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
	at java.base/java.nio.file.Files.readAllBytes(Files.java:3288)
	at scala.meta.internal.io.PlatformFileIO$.slurp(PlatformFileIO.scala:45)
	at scala.meta.internal.io.FileIO$.slurp(FileIO.scala:24)
	at scala.meta.internal.mtags.CommonMtagsEnrichments$XtensionAbsolutePath.toInput(CommonMtagsEnrichments.scala:529)
	at scala.meta.internal.metals.Docstrings.indexSymbolDefinition(Docstrings.scala:123)
	at scala.meta.internal.metals.Docstrings.indexSymbol(Docstrings.scala:107)
	at scala.meta.internal.metals.Docstrings.documentation(Docstrings.scala:44)
	at scala.meta.internal.metals.MetalsSymbolSearch.documentation(MetalsSymbolSearch.scala:42)
	at scala.meta.internal.mtags.MtagsEnrichments$.symbolDocumentation(MtagsEnrichments.scala:193)
	at scala.meta.internal.pc.HoverProvider$.$anonfun$1(HoverProvider.scala:106)
	at scala.collection.immutable.List.flatMap(List.scala:293)
	at scala.meta.internal.pc.HoverProvider$.hover(HoverProvider.scala:106)
	at scala.meta.internal.pc.ScalaPresentationCompiler.hover$$anonfun$1(ScalaPresentationCompiler.scala:266)
	at scala.meta.internal.pc.CompilerAccess.withSharedCompiler(CompilerAccess.scala:137)
	at scala.meta.internal.pc.CompilerAccess.withNonInterruptableCompiler$$anonfun$1(CompilerAccess.scala:125)
	at scala.meta.internal.pc.CompilerAccess.onCompilerJobQueue$$anonfun$1(CompilerAccess.scala:197)
	at scala.meta.internal.pc.CompilerJobQueue$Job.run(CompilerJobQueue.scala:152)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

2022.11.18 12:01:28 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:01:28 INFO  time: compiled zioJsonRpcJS in 0.14s�[0m
2022.11.18 12:01:51 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:01:51 INFO  time: compiled zioJsonRpcJS in 0.15s�[0m
2022.11.18 12:01:58 INFO  compiling ziojsonrpcjvm (16 scala sources)�[0m
2022.11.18 12:02:00 INFO  time: compiled zioJsonRpcJVM in 1.33s�[0m
2022.11.18 12:02:00 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:02:00 INFO  compiling ziolspjvm (16 scala sources)�[0m
2022.11.18 12:02:00 INFO  time: compiled zioJsonRpcJS in 0.14s�[0m
2022.11.18 12:02:08 INFO  compiling server (1 scala source)�[0m
2022.11.18 12:02:08 INFO  time: compiled zioLspJVM in 7.98s�[0m
2022.11.18 12:02:08 INFO  time: compiled server in 0.4s�[0m
2022.11.18 12:02:08 INFO  compiling plugin (1 scala source)�[0m
2022.11.18 12:02:08 INFO  compiling ziojsonrpcjvm (1 scala source)�[0m
2022.11.18 12:02:08 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:02:08 INFO  time: compiled plugin in 0.17s�[0m
2022.11.18 12:02:08 INFO  time: compiled zioJsonRpcJS in 0.19s�[0m
2022.11.18 12:02:08 INFO  compiling ziolspjvm (1 scala source)�[0m
2022.11.18 12:02:08 INFO  time: compiled zioJsonRpcJVM in 0.2s�[0m
2022.11.18 12:02:08 INFO  time: compiled zioLspJVM in 0.19s�[0m
2022.11.18 12:02:29 INFO  compiling server (1 scala source)�[0m
2022.11.18 12:02:29 INFO  time: compiled server in 55ms�[0m
2022.11.18 12:03:12 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:03:12 INFO  time: compiled zioJsonRpcJS in 0.16s�[0m
2022.11.18 12:03:12 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:03:12 INFO  time: compiled zioJsonRpcJS in 0.14s�[0m
2022.11.18 12:03:12 INFO  compiling plugin (1 scala source)�[0m
2022.11.18 12:03:12 INFO  compiling ziojsonrpcjvm (1 scala source)�[0m
2022.11.18 12:03:12 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:03:12 INFO  time: compiled plugin in 0.16s�[0m
2022.11.18 12:03:12 INFO  time: compiled zioJsonRpcJS in 0.2s�[0m
2022.11.18 12:03:12 INFO  compiling ziolspjvm (1 scala source)�[0m
2022.11.18 12:03:12 INFO  time: compiled zioJsonRpcJVM in 0.21s�[0m
2022.11.18 12:03:12 INFO  compiling server (1 scala source)�[0m
2022.11.18 12:03:12 INFO  time: compiled zioLspJVM in 0.19s�[0m
2022.11.18 12:03:12 INFO  time: compiled server in 0.14s�[0m
2022.11.18 12:03:34 INFO  compiling ziojsonrpcjvm (1 scala source)�[0m
2022.11.18 12:03:34 INFO  time: compiled zioJsonRpcJVM in 0.24s�[0m
2022.11.18 12:03:34 INFO  compiling server (1 scala source)�[0m
2022.11.18 12:03:34 INFO  time: compiled server in 55ms�[0m
2022.11.18 12:03:34 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:03:34 INFO  time: compiled zioJsonRpcJS in 0.2s�[0m
2022.11.18 12:03:37 INFO  compiling server (1 scala source)�[0m
2022.11.18 12:03:37 INFO  time: compiled server in 62ms�[0m
2022.11.18 12:03:37 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:03:37 INFO  time: compiled zioJsonRpcJS in 0.17s�[0m
2022.11.18 12:03:37 INFO  compiling plugin (1 scala source)�[0m
2022.11.18 12:03:37 INFO  compiling ziojsonrpcjvm (1 scala source)�[0m
2022.11.18 12:03:37 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:03:37 INFO  time: compiled plugin in 0.13s�[0m
2022.11.18 12:03:37 INFO  time: compiled zioJsonRpcJS in 0.17s�[0m
2022.11.18 12:03:37 INFO  compiling ziolspjvm (1 scala source)�[0m
2022.11.18 12:03:37 INFO  time: compiled zioJsonRpcJVM in 0.21s�[0m
2022.11.18 12:03:37 INFO  compiling server (1 scala source)�[0m
2022.11.18 12:03:37 INFO  time: compiled zioLspJVM in 0.19s�[0m
2022.11.18 12:03:37 INFO  time: compiled server in 60ms�[0m
2022.11.18 12:04:09 INFO  compiling server (1 scala source)�[0m
2022.11.18 12:04:09 INFO  time: compiled server in 0.22s�[0m
2022.11.18 12:04:15 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:04:15 INFO  time: compiled zioJsonRpcJS in 0.18s�[0m
2022.11.18 12:04:15 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:04:15 INFO  time: compiled zioJsonRpcJS in 0.16s�[0m
2022.11.18 12:04:15 INFO  compiling plugin (1 scala source)�[0m
2022.11.18 12:04:15 INFO  compiling ziojsonrpcjvm (1 scala source)�[0m
2022.11.18 12:04:15 INFO  compiling ziojsonrpcjs (1 scala source)�[0m
2022.11.18 12:04:15 INFO  time: compiled plugin in 0.13s�[0m
2022.11.18 12:04:15 INFO  time: compiled zioJsonRpcJS in 0.15s�[0m
2022.11.18 12:04:15 INFO  compiling ziolspjvm (1 scala source)�[0m
2022.11.18 12:04:15 INFO  time: compiled zioJsonRpcJVM in 0.2s�[0m
2022.11.18 12:04:15 INFO  compiling server (1 scala source)�[0m
2022.11.18 12:04:15 INFO  time: compiled zioLspJVM in 0.17s�[0m
2022.11.18 12:04:15 INFO  time: compiled server in 0.14s�[0m
Nov 18, 2022 12:19:04 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 61352

happily I had lsp tracing enabled at the time - here's the diagnostics info being sent
lsp trace.zip

Expected behavior

errors reported in metals should be the same as those reported by sbt. If sbt can compile the whole project, there should be no reported errors.

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

0.11.9

Extra context or search terms

I've listed linux as the OS - this is ubuntu running in WSL.

Metals Doctor
Build server currently being used is Bloop v1.5.4.

Metals Java: 17.0.4.1 from Eclipse Adoptium located at /home/rob/.sdkman/candidates/java/17.0.4.1-tem

Metals Server version: 0.11.9

Answers to @ckipp01's questions from discord
Are you using Bloop or are you using sbt as a build server?
Bloop

Does it happen after you change your build definition?
No changes to build definition for a few days

Does the build import work after that?
Didn't change the build so didn't try it

Just understanding your flow and what you're hitting on is helpful
I added some helper methods to some case objects that serve as type tags to safely recover the type information they're holding on to. This took a few attempts to get right.

As part of this I used "rename symbol" (JsonRpc to JsonRpcMethod). It looks like most of the errors relate to this except for those in "HelloWorldSpec.scala" which is a nothing file from the g8 template which has never changed. I guess it's possible that the text doc sync is not handling this properly, resulting in metals having out of date file contents. I don't recall if I had recently renamed anything last time I encountered this.

@tgodzik
Copy link
Contributor

tgodzik commented Nov 21, 2022

Thanks for reporting! Does it help to run clean compile in this case (Metals: Recompile workspace)? There is a possibility that the Zinc integration in Bloop or even Zinc itself has an issue. Metals: Recompile workspace would be the same as clean;compile command in sbt

Is the repo publicly available and could we try to reproduce your steps?

@bertlebee
Copy link
Author

bertlebee commented Nov 22, 2022

Hi @tgodzik, it's not public yet but will be by the end of the year. I didn't try Metals: recompile workspace so I'm not sure sorry - my usual approach to "Metals" (by which I also mean anything in the toolchain behind it like Bloop) not working is "restart build server" followed by killall -9 java if it's still not working. In this case "restart build server" did the trick.

@bertlebee
Copy link
Author

Managed it again, this time after a(nother) compiler crash. This time I used Metals: recompile workspace as you suggested and it didn't fix the errors. Would this rule out a Zinc issue?
image
Restart Build Server was successful in clearing out the error again.

commit hash for compiling code (for when the repo is public):
a1492d54d0b5a688328178a18b07ac58ee7abeb3

libs/zio-lsp/shared/src/main/scala/zio/lsp/LspProtocol.scala:51 has a comment noting how to trigger the compiler crash (though I'm not sure it's related to this issue).

@tgodzik
Copy link
Contributor

tgodzik commented Nov 22, 2022

ZIO stuff is usually pretty complicated (I found a number of Metals bugs in the codebases related to the ecosystem), so this might be something to take a closer look into with a proper reproduction.

You could also try using sbt BSP with Metals: Switch build server command, which will use sbt directly underneath.

@bertlebee
Copy link
Author

sorry, I missed this reply. "ZIO stuff is usually pretty complicated" might explain why we're constantly experiencing compiler crashes with scala 3 where others seem to have limited issues... though I'm not sure I entirely agree with this characterisation. Most of the apparent complexity (zio-sql aside) in the zio ecosystem falls into a few basic patterns which pretty much amount to sacrificing ourselves to the boilerplate gods to provide a better user experience. It's confusing at first glance but once you wrap your head around the patterns it all becomes much clearer. There's a video here explaining some of them https://www.youtube.com/watch?v=48fpPffgnMo - some of it's pretty basic (e.g. <:<) but skipping through that video may help you decipher ZIO stuff a bit easier.

I'll give the SBT build server a go and see if it happens again - I generally prefer to use bloop because it's heaps faster (particularly when I'm using sbt in the command line at the same time!).

@tgodzik
Copy link
Contributor

tgodzik commented Nov 30, 2022

I just meant that I feel like ZIO is using the type system heavily more than some other libraries (just my opinion) and that's why we're seeing more bugs pop up there. That's a good thing though 😅 since we want those bugs to show up sooner or later.

Thanks for the video, I will take a look!

@bertlebee
Copy link
Author

notice some more weirdness - I was getting a type error showing up with a very unexpected type in metals. There was no error for this in SBT. Unfortunately I didn't capture this immediately, but here's a screenshot from a little down the debugging path. This Handled type showing up in the hover hasn't existed for many compile cycles now. The correct type is shown in the summon error message (this is a handy little trick I use when metals hover doesn't work).

image
side note - I take your point about the types :D

I tried "clean compile workspace" which didn't change anything. Restarting the build server cleared the error but now I'm not getting hover at x. I tried using "Insert type annotation" for x which causes an internal error (see details).

[Error - 10:37:41 AM] Request workspace/executeCommand failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: scala.concurrent.Future$$anon$2: Future.filter predicate is not satisfied
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347)
	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:708)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
	at scala.meta.internal.metals.CancelTokens$.$anonfun$future$1(CancelTokens.scala:40)
	at scala.meta.internal.metals.CancelTokens$.$anonfun$future$1$adapted(CancelTokens.scala:38)
	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: scala.concurrent.Future$$anon$2: Future.filter predicate is not satisfied

This was using bloop still - I swapped the build server over to sbt, but this got stuck importing the build. I restarted vscode and got this error:
image

details shows a semanticdb issue
image

used killall java -9, imported build using metals, same semanticdb error

swapped back to bloop; semanticdb issues disappeared. still no hover for x, trying to insert type annotation causes the same internal error.

perhaps this should be a new issue but it at least started off as incorrect errors reported by metals :)

commit a3ebb92c45c9cff45ebd716a4c808c4c692276e8

@tgodzik
Copy link
Contributor

tgodzik commented Dec 2, 2022

semanticdb error might pop up if the sbt-metals plugin has issues enabling it. Might be good to see what the target has defined there (you can click on the name to see summary) and whether it's not flaky

As for the hover, that might be an issue in the compiler, since insert type annotation also uses it. There should be some more info in .metals/metals.log

@bertlebee
Copy link
Author

Still getting the same issues. Now using sbt as the build server. cc @ckipp01
image

there are a bunch of errors like this, all the same. The type did have 4 params, but I deleted one.
sbt compiles fine (a few unrelated warnings)

@ckipp01
Copy link
Member

ckipp01 commented Jan 30, 2023

Ah thanks for the extra info @robmwalsh. This one I'm very interested in, because if sbt is reporting an incorrect error over BSP (or stale I guess) but just a normal sbt compile works fine, then something is definitely off. Is there any way at all you can minimize this so that I can reproduce it? I'm assuming this is still in the private repo?

@bertlebee
Copy link
Author

It's very inconsistent. If I restart the build server, all is well again.
I suspect the issue may be that metals does not tell vscode to clear the diagnostics in some circumstances (as is required by the language server spec https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_publishDiagnostics )

@ckipp01
Copy link
Member

ckipp01 commented Jan 30, 2023

I suspect the issue may be that metals does not tell vscode to clear the diagnostics in some circumstances (as is required by the language server spec https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_publishDiagnostics )

Sure, but even before that it's the actual build server that let's Metals know if we should clear them or not. Metals really doesn't do much here apart from forwarding the information that the build server provides. For example you can see the format (that you're probably familiar with in LSP) in BSP here. If we get a reset as true, then we should be clearing. What I'd be curious in your situation is if that is indeed happening. For example you can create a bsp.trace.json in your .metals/ dir and after a restart it will pipe the trace messages into that. I'd be curious when this is happening if your build server is sending a build/publishDiagnostics with reset or not. I have an inkling that it's not.

@bertlebee
Copy link
Author

I did suffer another compiler crash today so I guess that's a possibility, but I deleted the param after the crash, so I don't think its likely.

@bertlebee
Copy link
Author

I've created the BSP and LSP traces, I'll have a look for the reset flag in both next time it happens - thanks for the suggestion

@bertlebee
Copy link
Author

bertlebee commented Jan 30, 2023

I'd be curious when this is happening if your build server is sending a build/publishDiagnostics with reset or not. I have an inkling that it's not.

It seems it is, but not always when it needs to.

I had this happen again and did some digging through the bsp logs. Here's the reported diagnostic (when last reported):

[Trace - 07:42:04 PM] Received notification 'build/publishDiagnostics'
Params: {
  "textDocument": {
    "uri": "file:///home/rob/code/lsp/libs/zio-lsp/shared/src/main/scala/zio/lsp/internal/LspReader.scala"
  },
  "buildTarget": {
    "uri": "file:/home/rob/code/lsp/#zioLspJS/Compile"
  },
  "diagnostics": [
    {
      "range": {
        "start": {
          "line": 34,
          "character": 60
        },
        "end": {
          "line": 34,
          "character": 73
        }
      },
      "severity": 1,
      "code": "6",
      "source": "sbt",
      "message": "Not found: type JsonRpcReader"
    }
  ],
  "reset": true
}

and then...
nothing (as in no more build/publishDiagnostics messages for this file after this until I ran "Clean compile workspace")

Clean Compile workspace triggered this: which reset the diagnostics as expected.

[Trace - 07:51:38 PM] Received notification 'build/publishDiagnostics'
Params: {
  "textDocument": {
    "uri": "file:///home/rob/code/lsp/libs/zio-lsp/shared/src/main/scala/zio/lsp/internal/LspReader.scala"
  },
  "buildTarget": {
    "uri": "file:/home/rob/code/lsp/#zioLspJS/Compile"
  },
  "diagnostics": [],
  "reset": true
}

The interesting thing here is that the build target is home/rob/code/lsp/#zioLspJS - this is a cross-built project. There's another build target file:/home/rob/code/lsp/#zioLspJVM/Compile - for which there are no build/publishDiagnostics .. and this is the case for any crossbuilt project - only JS, no JVM. Perhaps it doesn't matter too much if the behaviour is consistent, but this is the sort of weirdness that I could see triggering something like this. At the very least, it suggests that the build isn't modelled correctly.

@ckipp01
Copy link
Member

ckipp01 commented Jan 30, 2023

Ah, I think part of this is probably related to scalameta/metals-feature-requests#13 which we've honestly just never tackled yet. sbt projects suffer from this more than Mill projects for example.

From looking at the trace it's not fully clear why there wouldn't be more diagnostics being reported from the build server, but as you can imagine, there's not a lot Metals can do if the build server isn't reporting anything. It's also sort of impossible to really debug this on our side without some type of reproduction, especially seeing that the issue seems to stem from the actual build server not reporting what is expected here.

@bertlebee
Copy link
Author

Perhaps the problem is in BSP4J since I'm getting stale diagnostics with both bloop & sbt. I'll swap back to bloop and see if the bsp trace shows similar behaviour next time.

@bertlebee
Copy link
Author

Bloop is now consistently reporting errors that just shouldn't exist.

image

All of this compiles fine with SBT. All the errors are from another project (in the same repo) that this project depends on.

None of these errors appear when using SBT as a build server, but I have had this problem with SBT as a build server.

So now we're down to some combination of:

  • metals doesn't handle cross building properly
  • sbt doesn't report errors via bsp correctly
  • bloop doesn't report errors via bsp correctly
  • bsp4j doesn't handle error reporting correctly

It's all just too complicated 🥲

@tgodzik
Copy link
Contributor

tgodzik commented Jan 31, 2023

  • metals doesn't handle cross building properly

This is the most likely scenario especially with different Scala versions. Native/JS should work mostly ok, though might also suffer from some undercompilation somtimes.

I am curious, how is the other project using the same sources? Would be able to reproduce some skeleton of the dependencies between projects look like?

@bertlebee
Copy link
Author

@tgodzik https://github.com/robmwalsh/buildsketch

Here's a rather cut down build.sbt file and the plugins etc that I'm using
This is fairly typical of zio builds (based on the zio project seed)
Apologies for the BuildHelper file (it's part of the seed :/ there's an sbt plugin that will replace it eventually)

What's not typical is it's all scala 3 at this stage (3.2.1 at the moment, though I have been using nightlies at times), using JS and JVM platforms (no native, though I may add this at some point).There's no platform-specific code in these projects, so all the sources are in shared folders.

I'm not sure how much the crossbuild is affecting this particular issue - a plausible scenario is that a build server reports errors against a JS build target, then tells it to clear errors for a JVM build target. I've got no idea how metals translates bsp diagnostics to lsp diagnostics, so I guess anything is possible, but I'd expect this would be more likely to cause issues where there's platform specific sources.

@tgodzik
Copy link
Contributor

tgodzik commented Feb 10, 2023

Thanks for the repro! I will take a look at it!

@ghostdogpr
Copy link

ghostdogpr commented May 2, 2023

I'm running into similar issues on a large project. I can't share it unfortunately, but I can describe what I observe.

Let's say I do an initial compile, no errors reported but 50 "unused import" messages. I then start removing those imports one by one. If I do it slowly, no problem. But if I do it fast (which is normal), I'm modifying code while the project is compiling. When I do that, at some point it becomes out of sync: some imports that I removed are still reported as problems.

From that point, I can't find a nice way to "recover" except doing a clean compile which I don't want to do because it takes 10 minutes on that project. Is there a way to make it synced again? Sbt or bloop compile in a separate terminal doesn't have any impact on what I see in VS Code. What's worse is that I can't even clean compile only the current module, VS Code only offers to do it on the whole project.

Note that my example is trivial but it gets much worse when it's errors, and I'm constantly triggering it because the project is slow to compile so I'm constantly modifying code while it compiles.

Thanks in advance if you have any suggestions 😄

@kpodsiad
Copy link
Member

kpodsiad commented May 2, 2023

What's worse is that I can't even clean compile only the current module, VS Code only offers to do it on the whole project.

This should be relatively easy to implement and expose to users. I was thinking about doing it few times when bloop went crazy, but unfortunately I'm a power user who uses bloop cli so I don't need UI for invalidating one module :|
Anyway, @ghostdogpr can you create an issue for that?

@ghostdogpr
Copy link

I'm a power user who uses bloop cli so I don't need UI for invalidating one module :|

Even if you use bloop cli (which I tried too), how does that get synced with the UI? (= how does the UI stop showing your code as red, when you re-trigger a build with bloop? Whatever I did in bloop did not impact VS Code so I'm curious.)

@bertlebee
Copy link
Author

I'm a power user who uses bloop cli so I don't need UI for invalidating one module :|

Even if you use bloop cli (which I tried too), how does that get synced with the UI? (= how does the UI stop showing your code as red, when you re-trigger a build with bloop? Whatever I did in bloop did not impact VS Code so I'm curious.)

The trick to using bloop is... Don't! Using sbt as the BSP server has been a far better experience for me (except for bsp compilation blocking sbt cli)

@kpodsiad
Copy link
Member

kpodsiad commented May 2, 2023

@ghostdogpr bloop clean foo & bloop compile foo and then some change&save in vscode should do the trick, but after reading your message I'm not so sure about it anymore, I wasn't in such situation in a while and I don't remember details :/

The trick to using bloop is... Don't!

Unfortunately, this is true. Using sbt definitely saves you from pain which bloop is inflicting 😢 But bloop is really fast and I can't resist that speed.

@ghostdogpr
Copy link

@kpodsiad I did that but the change&save didn't trigger a re-sync of the incorrect "problems", they just stayed there.

@tgodzik
Copy link
Contributor

tgodzik commented May 2, 2023

This is a curious case, the issue might be connected to the fact that we don't run multiple compiles at the same time. Do you have automatic save enabled maybe?

@ghostdogpr
Copy link

This is a curious case, the issue might be connected to the fact that we don't run multiple compiles at the same time. Do you have automatic save enabled maybe?

I do save instantly after each modification.

@ghostdogpr
Copy link

Because the project is large and takes time to compile, I'm always modifying files while compilation is going on (there are a lot of messages about deduplicating compilation in the output). It does look like this is what's causing Metals to be out of sync.

@bertlebee
Copy link
Author

This is a curious case, the issue might be connected to the fact that we don't run multiple compiles at the same time. Do you have automatic save enabled maybe?

@tgodzik are any diagnostics reported from the presentation compiler? these may clash with those being reported via bsp.

@ghostdogpr I've found that restarting the build server is the only way to clear out all the errors and get things to resync. sometimes you need to be more forceful with restarting (killall java -9)

@tgodzik
Copy link
Contributor

tgodzik commented May 4, 2023

are any diagnostics reported from the presentation compiler? these may clash with those being reported via bsp.

We don't report errors from the presentation compiler to limit the amount of errors while writing code, that might not compiler. We rely on errors from the compiler via BSP.

I've found that restarting the build server is the only way to clear out all the errors and get things to resync. sometimes you need to be more forceful with restarting (killall java -9)

I want to look into this, since this seems a bigger issue than I thought.

@carlosedp
Copy link

carlosedp commented Jun 23, 2023

This is a repro capture I did... happens mostly using mill-bsp:

https://streamable.com/f00gmh

@tgodzik
Copy link
Contributor

tgodzik commented Jun 29, 2023

Metals needs to get empty diagnostics for a file to clear the errors, so this might be an issue with Mill. Otherwise we would need to keep that information inside Metals, which I would prefer to avoid, since that might cause some unexpected issues.

If you do another error inside that file does it remove the old one? Does the situation with stale errors happens often when fixing all of them?

@carlosedp
Copy link

carlosedp commented Jun 29, 2023

Yes, forcing another error somewhere else does indeed clean the previous one that was stuck.

Here's metals.log file from the moment I switched to mill-bsp, forced an error, removed that error by commenting it out and making another error that cleaned the previous one:

2023.06.29 12:15:01 INFO  mill version 0.11.1 detected to use as a bsp server.
2023.06.29 12:15:03 INFO  Creating BSP connection file: /Users/cdepaula/repos/scala/zio-channel/.bsp/mill-bsp.json
2023.06.29 12:15:03 INFO  time: ran 'mill-bsp bspConfig' in 1.52s
2023.06.29 12:15:03 INFO  Disconnecting from Bloop session...
2023.06.29 12:15:03 INFO  Shut down connection with build server.
2023.06.29 12:15:03 INFO  Attempting to connect to the build server...
2023.06.29 12:15:03 INFO  Running BSP server List(/Users/cdepaula/repos/scala/zio-channel/.metals/millw, --bsp, --disable-ticker, --color, false, --jobs, 1)
2023.06.29 12:15:03 INFO  tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at /Users/cdepaula/repos/scala/zio-channel/.metals/bsp.trace.json or /Users/cdepaula/Library/Caches/org.scalameta.metals/bsp.trace.json
2023.06.29 12:15:03 INFO  BSP server: Mill in BSP mode, version 0.11.1, Thu Jun 29 12:15:03 BRT 2023
2023.06.29 12:15:03 INFO  BSP server: Running in BSP mode with hardcoded startSession command
2023.06.29 12:15:03 INFO  BSP server: Trying to load BSP server...
2023.06.29 12:15:03 INFO  BSP server: Reading worker classpath from file: /Users/cdepaula/repos/scala/zio-channel/.bsp/mill-bsp-0.11.1.resources
2023.06.29 12:15:03 INFO  BSP server: BSP server started
2023.06.29 12:15:03 INFO  time: Connected to build server in 0.72s
2023.06.29 12:15:03 INFO  Connected to Build server: mill-bsp v0.11.1
2023.06.29 12:15:05 INFO  BSP server: BSP/startSession: Starting BSP session
2023.06.29 12:15:05 INFO  BSP server: [#00] MyAliases
2023.06.29 12:15:05 INFO  BSP server: [#00] clean
2023.06.29 12:15:05 INFO  BSP server: [#00] examples
2023.06.29 12:15:05 INFO  BSP server: [#00] init
2023.06.29 12:15:05 INFO  BSP server: [#00] inspect
2023.06.29 12:15:05 INFO  BSP server: [#00] path
2023.06.29 12:15:05 INFO  BSP server: [#00] plan
2023.06.29 12:15:05 INFO  BSP server: [#00] resolve
2023.06.29 12:15:05 INFO  BSP server: [#00] scoverage
2023.06.29 12:15:05 INFO  BSP server: [#00] show
2023.06.29 12:15:05 INFO  BSP server: [#00] showNamed
2023.06.29 12:15:05 INFO  BSP server: [#00] shutdown
2023.06.29 12:15:05 INFO  BSP server: [#00] version
2023.06.29 12:15:05 INFO  BSP server: [#00] visualize
2023.06.29 12:15:05 INFO  BSP server: [#00] visualizePlan
2023.06.29 12:15:05 INFO  BSP server: [#00] zio-channel
2023.06.29 12:15:07 INFO  BSP server: [info] compiling 2 Scala sources to /Users/cdepaula/repos/scala/zio-channel/out/zio-channel/jvm/scoverage/compile.dest/classes ...
2023.06.29 12:15:11 INFO  BSP server: [info] done compiling
2023.06.29 12:15:11 INFO  BSP server: [info] compiling 2 Scala sources to /Users/cdepaula/repos/scala/zio-channel/out/zio-channel/js/compile.dest/classes ...
2023.06.29 12:15:15 INFO  BSP server: [info] done compiling
2023.06.29 12:15:15 INFO  BSP server: [info] compiling 2 Scala sources to /Users/cdepaula/repos/scala/zio-channel/out/zio-channel/jvm/compile.dest/classes ...
2023.06.29 12:15:17 INFO  BSP server: [info] done compiling
2023.06.29 12:15:17 INFO  BSP server: [info] compiling 2 Scala sources to /Users/cdepaula/repos/scala/zio-channel/out/zio-channel/native/compile.dest/classes ...
2023.06.29 12:15:22 INFO  BSP server: [info] done compiling
2023.06.29 12:15:23 INFO  time: Imported build in 19s
2023.06.29 12:15:30 WARN  unexpected dependency: /Users/cdepaula/.cache/mill/download/0.11.1
2023.06.29 12:15:30 INFO  time: indexed workspace in 7.89s
2023.06.29 12:15:31 INFO  compiling target examples
2023.06.29 12:15:31 INFO  BSP server: [info] compiling 6 Scala sources to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:15:32 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/compile.dest/classes ...
2023.06.29 12:15:34 INFO  BSP server: [info] done compiling
2023.06.29 12:15:34 INFO  time: compiled examples in 3.02s
2023.06.29 12:15:34 INFO  BSP server: [info] compiling 3 Scala sources to /Users/cdepaula/repos/scala/zio-channel/out/zio-channel/js/test/compile.dest/classes ...
2023.06.29 12:15:34 INFO  compiling target examples
2023.06.29 12:15:34 INFO  BSP server: [info] compiling 6 Scala sources to /Users/cdepaula/repos/scala/zio-channel/out/examples/semanticDbData.dest/classes ...
2023.06.29 12:15:38 INFO  BSP server: [info] done compiling
2023.06.29 12:15:38 INFO  BSP server: [info] compiling 3 Scala sources to /Users/cdepaula/repos/scala/zio-channel/out/zio-channel/native/test/compile.dest/classes ...
2023.06.29 12:15:44 INFO  BSP server: [info] done compiling
2023.06.29 12:15:44 INFO  time: compiled examples in 9.73s
2023.06.29 12:15:44 INFO  compiling target examples
2023.06.29 12:15:44 INFO  time: compiled examples in 0.32s
2023.06.29 12:15:46 INFO  BSP server: [info] done compiling
2023.06.29 12:15:46 INFO  BSP server: [info] compiling 3 Scala sources to /Users/cdepaula/repos/scala/zio-channel/out/zio-channel/jvm/test/compile.dest/classes ...
2023.06.29 12:15:49 INFO  BSP server: [info] done compiling
2023.06.29 12:15:49 INFO  compiling target mill-build/
2023.06.29 12:15:49 INFO  time: compiled mill-build/ in 82ms
2023.06.29 12:15:49 INFO  compiling target mill-build/
2023.06.29 12:15:49 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/semanticDbData.dest/classes ...
2023.06.29 12:15:50 INFO  BSP server: [info] done compiling
2023.06.29 12:15:57 INFO  time: compiled mill-build/ in 7.38s
2023.06.29 12:15:57 INFO  BSP server: [info] done compiling
2023.06.29 12:15:58 INFO  compiling target examples
2023.06.29 12:15:58 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:16:00 INFO  BSP server: [error] -- [E008] Not Found Error: /Users/cdepaula/repos/scala/zio-channel/examples/src/sample4.scala:22:15 
2023.06.29 12:16:00 INFO  BSP server: [error] 22 |      _   <- s.receive.tap(x => Console.printLine(s"Received $x")).fork
2023.06.29 12:16:00 INFO  BSP server: [error]    |             ^^^^^^^^^
2023.06.29 12:16:00 INFO  BSP server: [error]    | value receive is not a member of Either[zio.channel.ChannelStatus, Int]
2023.06.29 12:16:00 INFO  time: compiled examples in 1.39s
2023.06.29 12:16:00 INFO  BSP server: [error] one error found
2023.06.29 12:16:00 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:16:01 INFO  BSP server: [error] -- [E008] Not Found Error: /Users/cdepaula/repos/scala/zio-channel/examples/src/sample4.scala:22:15 
2023.06.29 12:16:01 INFO  BSP server: [error] 22 |      _   <- s.receive.tap(x => Console.printLine(s"Received $x")).fork
2023.06.29 12:16:01 INFO  BSP server: [error]    |             ^^^^^^^^^
2023.06.29 12:16:01 INFO  BSP server: [error]    | value receive is not a member of Either[zio.channel.ChannelStatus, Int]
2023.06.29 12:16:01 INFO  BSP server: [error] one error found
2023.06.29 12:16:01 INFO  BSP server: Jun 29, 2023 12:16:01 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
2023.06.29 12:16:01 INFO  BSP server: SEVERE: Internal error: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:01 INFO  BSP server: java.util.concurrent.CompletionException: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347)
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:708)
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
2023.06.29 12:16:01 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:670)
2023.06.29 12:16:01 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1$adapted(MillBuildServer.scala:658)
2023.06.29 12:16:01 INFO  BSP server: 	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
2023.06.29 12:16:01 INFO  BSP server: Caused by: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:01 INFO  BSP server: 	at mill.eval.Evaluator.$anonfun$evalOrThrow$default$1$1(Evaluator.scala:41)
2023.06.29 12:16:01 INFO  BSP server: 	at mill.eval.EvaluatorImpl$EvalOrThrow.apply(EvaluatorImpl.scala:66)
2023.06.29 12:16:01 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completableTasks$1(MillBuildServer.scala:627)
2023.06.29 12:16:01 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:661)
2023.06.29 12:16:01 INFO  BSP server: 	... 8 more
2023.06.29 12:16:01 INFO  BSP server: 
2023.06.29 12:16:01 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:16:01 INFO  Failed to run request with params ScalaMainClassesResult
org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(Thread.java:833)

2023.06.29 12:16:01 INFO  BSP server: [error] -- [E008] Not Found Error: /Users/cdepaula/repos/scala/zio-channel/examples/src/sample4.scala:22:15 
2023.06.29 12:16:01 INFO  BSP server: [error] 22 |      _   <- s.receive.tap(x => Console.printLine(s"Received $x")).fork
2023.06.29 12:16:01 INFO  BSP server: [error]    |             ^^^^^^^^^
2023.06.29 12:16:01 INFO  BSP server: [error]    | value receive is not a member of Either[zio.channel.ChannelStatus, Int]
2023.06.29 12:16:01 INFO  BSP server: [error] one error found
2023.06.29 12:16:01 INFO  BSP server: Jun 29, 2023 12:16:02 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
2023.06.29 12:16:01 INFO  BSP server: SEVERE: Internal error: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:01 INFO  BSP server: java.util.concurrent.CompletionException: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:02 INFO  mill-bsp should support `buildTarget/jvmRunEnvironment`, but it fails.
org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(Thread.java:833)

2023.06.29 12:16:01 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
2023.06.29 12:16:02 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347)
2023.06.29 12:16:02 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:708)
2023.06.29 12:16:02 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
2023.06.29 12:16:02 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
2023.06.29 12:16:02 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:670)
2023.06.29 12:16:02 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1$adapted(MillBuildServer.scala:658)
2023.06.29 12:16:02 INFO  BSP server: 	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
2023.06.29 12:16:02 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
2023.06.29 12:16:02 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
2023.06.29 12:16:02 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
2023.06.29 12:16:02 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
2023.06.29 12:16:02 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
2023.06.29 12:16:02 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
2023.06.29 12:16:02 INFO  BSP server: Caused by: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:02 INFO  BSP server: 	at mill.eval.Evaluator.$anonfun$evalOrThrow$default$1$1(Evaluator.scala:41)
2023.06.29 12:16:02 INFO  BSP server: 	at mill.eval.EvaluatorImpl$EvalOrThrow.apply(EvaluatorImpl.scala:66)
2023.06.29 12:16:02 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completableTasks$1(MillBuildServer.scala:627)
2023.06.29 12:16:02 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:661)
2023.06.29 12:16:02 INFO  BSP server: 	... 8 more
2023.06.29 12:16:02 INFO  BSP server: 
2023.06.29 12:16:07 INFO  compiling target examples
2023.06.29 12:16:07 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:16:07 INFO  BSP server: [info] done compiling
2023.06.29 12:16:07 INFO  time: compiled examples in 0.72s
2023.06.29 12:16:45 INFO  compiling target examples
2023.06.29 12:16:45 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:16:45 INFO  BSP server: [error] -- [E008] Not Found Error: /Users/cdepaula/repos/scala/zio-channel/examples/src/sample4.scala:23:15 
2023.06.29 12:16:45 INFO  BSP server: [error] 23 |      _   <- s.blabla
2023.06.29 12:16:45 INFO  BSP server: [error]    |             ^^^^^^^^
2023.06.29 12:16:45 INFO  BSP server: [error]    |  value blabla is not a member of Either[zio.channel.ChannelStatus, Int]
2023.06.29 12:16:45 INFO  BSP server: [error] one error found
2023.06.29 12:16:46 INFO  time: compiled examples in 1s
2023.06.29 12:16:46 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:16:47 INFO  BSP server: [error] -- [E008] Not Found Error: /Users/cdepaula/repos/scala/zio-channel/examples/src/sample4.scala:23:15 
2023.06.29 12:16:47 INFO  BSP server: [error] 23 |      _   <- s.blabla
2023.06.29 12:16:47 INFO  BSP server: [error]    |             ^^^^^^^^
2023.06.29 12:16:47 INFO  BSP server: [error]    |  value blabla is not a member of Either[zio.channel.ChannelStatus, Int]
2023.06.29 12:16:47 INFO  BSP server: [error] one error found
2023.06.29 12:16:47 INFO  BSP server: Jun 29, 2023 12:16:47 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
2023.06.29 12:16:47 INFO  BSP server: SEVERE: Internal error: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:47 INFO  BSP server: java.util.concurrent.CompletionException: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:708)
2023.06.29 12:16:47 INFO  Failed to run request with params ScalaMainClassesResult
org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(Thread.java:833)

2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
2023.06.29 12:16:47 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:670)
2023.06.29 12:16:47 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1$adapted(MillBuildServer.scala:658)
2023.06.29 12:16:47 INFO  BSP server: 	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
2023.06.29 12:16:47 INFO  BSP server: Caused by: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:47 INFO  BSP server: 	at mill.eval.Evaluator.$anonfun$evalOrThrow$default$1$1(Evaluator.scala:41)
2023.06.29 12:16:47 INFO  BSP server: 	at mill.eval.EvaluatorImpl$EvalOrThrow.apply(EvaluatorImpl.scala:66)
2023.06.29 12:16:47 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completableTasks$1(MillBuildServer.scala:627)
2023.06.29 12:16:47 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:661)
2023.06.29 12:16:47 INFO  BSP server: 	... 8 more
2023.06.29 12:16:47 INFO  BSP server: 
2023.06.29 12:16:47 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:16:47 INFO  BSP server: [error] -- [E008] Not Found Error: /Users/cdepaula/repos/scala/zio-channel/examples/src/sample4.scala:23:15 
2023.06.29 12:16:47 INFO  BSP server: [error] 23 |      _   <- s.blabla
2023.06.29 12:16:47 INFO  BSP server: [error]    |             ^^^^^^^^
2023.06.29 12:16:47 INFO  BSP server: [error]    |  value blabla is not a member of Either[zio.channel.ChannelStatus, Int]
2023.06.29 12:16:47 INFO  BSP server: [error] one error found
2023.06.29 12:16:47 INFO  BSP server: Jun 29, 2023 12:16:48 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
2023.06.29 12:16:47 INFO  BSP server: SEVERE: Internal error: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:47 INFO  BSP server: java.util.concurrent.CompletionException: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347)
2023.06.29 12:16:47 INFO  mill-bsp should support `buildTarget/jvmRunEnvironment`, but it fails.
org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(Thread.java:833)

2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:708)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
2023.06.29 12:16:47 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:670)
2023.06.29 12:16:47 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1$adapted(MillBuildServer.scala:658)
2023.06.29 12:16:47 INFO  BSP server: 	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
2023.06.29 12:16:47 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
2023.06.29 12:16:47 INFO  BSP server: Caused by: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:16:47 INFO  BSP server: 	at mill.eval.Evaluator.$anonfun$evalOrThrow$default$1$1(Evaluator.scala:41)
2023.06.29 12:16:47 INFO  BSP server: 	at mill.eval.EvaluatorImpl$EvalOrThrow.apply(EvaluatorImpl.scala:66)
2023.06.29 12:16:47 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completableTasks$1(MillBuildServer.scala:627)
2023.06.29 12:16:47 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:661)
2023.06.29 12:16:47 INFO  BSP server: 	... 8 more
2023.06.29 12:16:47 INFO  BSP server: 
2023.06.29 12:16:52 INFO  compiling target examples
2023.06.29 12:16:52 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:16:52 INFO  BSP server: [info] done compiling
2023.06.29 12:16:52 INFO  time: compiled examples in 0.62s
2023.06.29 12:16:52 INFO  compiling target examples
2023.06.29 12:16:52 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/semanticDbData.dest/classes ...
2023.06.29 12:16:54 INFO  BSP server: [info] done compiling
2023.06.29 12:16:54 INFO  time: compiled examples in 1.52s
2023.06.29 12:17:13 INFO  compiling target examples
2023.06.29 12:17:13 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:17:13 INFO  BSP server: [error] -- [E008] Not Found Error: /Users/cdepaula/repos/scala/zio-channel/examples/src/sample4.scala:24:19 
2023.06.29 12:17:13 INFO  BSP server: [error] 24 |      _   <- chan2.closed2
2023.06.29 12:17:13 INFO  BSP server: [error]    |             ^^^^^^^^^^^^^
2023.06.29 12:17:13 INFO  BSP server: [error]    |value closed2 is not a member of zio.channel.Channel[Int] - did you mean chan2.close?
2023.06.29 12:17:13 INFO  BSP server: [error] one error found
2023.06.29 12:17:13 INFO  time: compiled examples in 0.89s
2023.06.29 12:17:13 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:17:15 INFO  BSP server: [error] -- [E008] Not Found Error: /Users/cdepaula/repos/scala/zio-channel/examples/src/sample4.scala:24:19 
2023.06.29 12:17:15 INFO  BSP server: [error] 24 |      _   <- chan2.closed2
2023.06.29 12:17:15 INFO  BSP server: [error]    |             ^^^^^^^^^^^^^
2023.06.29 12:17:15 INFO  BSP server: [error]    |value closed2 is not a member of zio.channel.Channel[Int] - did you mean chan2.close?
2023.06.29 12:17:15 INFO  BSP server: [error] one error found
2023.06.29 12:17:15 INFO  BSP server: Jun 29, 2023 12:17:15 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
2023.06.29 12:17:15 INFO  BSP server: SEVERE: Internal error: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:17:15 INFO  BSP server: java.util.concurrent.CompletionException: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:708)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
2023.06.29 12:17:15 INFO  mill-bsp should support `buildTarget/jvmRunEnvironment`, but it fails.
org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(Thread.java:833)

2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
2023.06.29 12:17:15 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:670)
2023.06.29 12:17:15 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1$adapted(MillBuildServer.scala:658)
2023.06.29 12:17:15 INFO  BSP server: 	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
2023.06.29 12:17:15 INFO  BSP server: Caused by: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:17:15 INFO  BSP server: 	at mill.eval.Evaluator.$anonfun$evalOrThrow$default$1$1(Evaluator.scala:41)
2023.06.29 12:17:15 INFO  BSP server: 	at mill.eval.EvaluatorImpl$EvalOrThrow.apply(EvaluatorImpl.scala:66)
2023.06.29 12:17:15 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completableTasks$1(MillBuildServer.scala:627)
2023.06.29 12:17:15 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:661)
2023.06.29 12:17:15 INFO  BSP server: 	... 8 more
2023.06.29 12:17:15 INFO  BSP server: 
2023.06.29 12:17:15 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:17:15 INFO  BSP server: [error] -- [E008] Not Found Error: /Users/cdepaula/repos/scala/zio-channel/examples/src/sample4.scala:24:19 
2023.06.29 12:17:15 INFO  BSP server: [error] 24 |      _   <- chan2.closed2
2023.06.29 12:17:15 INFO  BSP server: [error]    |             ^^^^^^^^^^^^^
2023.06.29 12:17:15 INFO  BSP server: [error]    |value closed2 is not a member of zio.channel.Channel[Int] - did you mean chan2.close?
2023.06.29 12:17:15 INFO  BSP server: [error] one error found
2023.06.29 12:17:15 INFO  BSP server: Jun 29, 2023 12:17:16 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
2023.06.29 12:17:15 INFO  BSP server: SEVERE: Internal error: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:17:15 INFO  BSP server: java.util.concurrent.CompletionException: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:347)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:708)
2023.06.29 12:17:16 INFO  Failed to run request with params ScalaMainClassesResult
org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Internal error.
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(Thread.java:833)

2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162)
2023.06.29 12:17:15 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:670)
2023.06.29 12:17:15 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1$adapted(MillBuildServer.scala:658)
2023.06.29 12:17:15 INFO  BSP server: 	at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
2023.06.29 12:17:15 INFO  BSP server: 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
2023.06.29 12:17:15 INFO  BSP server: Caused by: java.lang.Exception: Failure during task evaluation: examples.compile Compilation failed
2023.06.29 12:17:15 INFO  BSP server: 	at mill.eval.Evaluator.$anonfun$evalOrThrow$default$1$1(Evaluator.scala:41)
2023.06.29 12:17:15 INFO  BSP server: 	at mill.eval.EvaluatorImpl$EvalOrThrow.apply(EvaluatorImpl.scala:66)
2023.06.29 12:17:15 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completableTasks$1(MillBuildServer.scala:627)
2023.06.29 12:17:15 INFO  BSP server: 	at mill.bsp.worker.MillBuildServer.$anonfun$completable$1(MillBuildServer.scala:661)
2023.06.29 12:17:15 INFO  BSP server: 	... 8 more
2023.06.29 12:17:15 INFO  BSP server: 
2023.06.29 12:18:07 INFO  compiling target examples
2023.06.29 12:18:07 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/compile.dest/classes ...
2023.06.29 12:18:07 INFO  BSP server: [info] done compiling
2023.06.29 12:18:07 INFO  time: compiled examples in 0.57s
2023.06.29 12:18:07 INFO  compiling target examples
2023.06.29 12:18:07 INFO  BSP server: [info] compiling 1 Scala source to /Users/cdepaula/repos/scala/zio-channel/out/examples/semanticDbData.dest/classes ...
2023.06.29 12:18:09 INFO  BSP server: [info] done compiling
2023.06.29 12:18:09 INFO  time: compiled examples in 1.08s

@carlosedp
Copy link

carlosedp commented Jun 29, 2023

I've collected the metals.log, bsp and lsp traces to this zip... my environment variables have been replaced with XXXXX due to containing tokens and etc...

Logs.zip

Cc. @lolgab @lefou

@tgodzik
Copy link
Contributor

tgodzik commented Jun 30, 2023

I don't see any empty diagnostics being sent, so I think that's the issue with stale errors. When everything is fixed Mill should send empty diagnostics with reset set to true.

@carlosedp
Copy link

Worth opening an issue on Mill about this error staying stuck?

@lefou
Copy link
Contributor

lefou commented Jul 20, 2023

@tgodzik
Copy link
Contributor

tgodzik commented Dec 7, 2023

Looks like this is now fixed in Mill! 🎉

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

No branches or pull requests

7 participants