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

Errors stay stuck in Metals on VSCode when using mill-bsp #2665

Closed
carlosedp opened this issue Jul 19, 2023 · 1 comment
Closed

Errors stay stuck in Metals on VSCode when using mill-bsp #2665

carlosedp opened this issue Jul 19, 2023 · 1 comment
Labels
duplicate The issue is a duplicate of another one. Progress is tracked in another issue.

Comments

@carlosedp
Copy link
Contributor

carlosedp commented Jul 19, 2023

Using latest Mill and Metals versions on VSCode, sometimes errors stay stuck in VSCode and Problems tab while using Mill BSP.

image

As seen, the method nonsensemethod was added and removed but the error kept showing. After fixing the error usually I need to do a "Restart Build Server".

This is a followup from scalameta/metals#4652 and apparently only happens when using Mill. On Bloop it works fine and the error goes away when fixed.

I've captured a sample on screen here: https://streamable.com/f00gmh

Although the video is a couple weeks old, the error still persists with latest Metals and Mill:

Metals Java: 17.0.7 from GraalVM Community located at /Users/cdepaula/Library/Caches/Coursier/arc/https/github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.2/graalvm-ce-java17-darwin-amd64-22.3.2.tar.gz/graalvm-ce-java17-22.3.2/Contents/Home

Metals Server version: 1.0.0+2-3776cef9-SNAPSHOT

Below are listed the build targets for this workspace. One build target corresponds to one classpath. For example, normally one sbt project maps to two build targets: main and test.

Build definition is coming from mill.

Build server currently being used is mill-bsp v0.11.1. ([Reset](command:metals.reset-choice?%5B%22Build+server+selection%22%5D))

According to @tgodzik

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?

And the error goes away when forcing a new error.

Tomasz also mentioned after I sent some logs (attached to that issue):

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.

@lefou
Copy link
Member

lefou commented Jul 20, 2023

@lefou lefou added the duplicate The issue is a duplicate of another one. Progress is tracked in another issue. label Jul 20, 2023
@lefou lefou closed this as completed Jul 20, 2023
@lefou lefou modified the milestone: 0.11.2 Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate The issue is a duplicate of another one. Progress is tracked in another issue.
Projects
None yet
Development

No branches or pull requests

2 participants