metals
metals copied to clipboard
Metals 1.2.1 VS Code compile timeout
Describe the bug
We are working in a dev container in Visual Studio Code and the Metals extension and since the latest update the compilation does not work any more in VS Code. A error will not be detected in the editor anymore.
As far I can see, the compilation runs into a timeout.
A downgrade to 1.2.0 in the VS Code settings fixes the problem.
Expected behavior
When I have an error in the code, I expect it to be highlighted as an error by VS Code.
Operating system
Windows
Editor/Extension
VS Code
Version of Metals
v1.2.1
Extra context or search terms
No response
Thanks for reporting. Could you send us contents of .metals/metals.log
file? There should be more information about what is failing.
It might be connected to https://github.com/scalameta/metals/issues/6104. You can try switching to latest snapshot by changing the Server Version
in vscode settings to 1.2.1+8-c133c945-SNAPSHOT
which should solve the problem, or downgrade to 1.2.0.
I could not see an difference when using Server Version 1.2.1+8-c133c945-SNAPSHOT
. However with 1.2.0
everything works as expected. For the moment we will use 1.2.0
.
metals.log
2024.02.14 11:07:02 INFO Started: Metals version 1.2.1 in folders '/workspaces/**projectpath**' for client Visual Studio Code 1.86.1.
11:07:03.088 [pool-1-thread-4] INFO org.flywaydb.core.internal.license.VersionPrinter -- Flyway Community Edition 9.22.3 by Redgate
11:07:03.093 [pool-1-thread-4] INFO org.flywaydb.core.internal.license.VersionPrinter -- See release notes here: https://rd.gt/416ObMi
11:07:03.093 [pool-1-thread-4] INFO org.flywaydb.core.internal.license.VersionPrinter --
11:07:03.097 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Scanning for classpath resources at 'classpath:db/callback' ...
11:07:03.098 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Determining location urls for classpath:db/callback using ClassLoader sun.misc.Launcher$AppClassLoader@7852e922 ...
11:07:03.098 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Unable to resolve location classpath:db/callback.
11:07:03.098 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Scanning for classpath resources at 'classpath:db/migration' ...
11:07:03.099 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Determining location urls for classpath:db/migration using ClassLoader sun.misc.Launcher$AppClassLoader@7852e922 ...
11:07:03.099 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Scanning URL: jar:file:/root/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scalameta/metals_2.13/1.2.1/metals_2.13-1.2.1.jar!/db/migration
11:07:03.103 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Found resource: db/migration/
11:07:03.104 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Found resource: db/migration/V1__Create_tables.sql
11:07:03.104 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Found resource: db/migration/V2__Server_discovery.sql
11:07:03.104 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Found resource: db/migration/V3__Jar_symbols.sql
11:07:03.105 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Found resource: db/migration/V4__Fingerprints.sql
11:07:03.105 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner -- Scanning for classes at classpath:db/migration
11:07:03.108 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/ (filename: )
11:07:03.109 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.resource.ResourceNameValidator -- Validating V2__Server_discovery.sql
11:07:03.110 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.resource.ResourceNameValidator -- Validating V1__Create_tables.sql
11:07:03.110 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.resource.ResourceNameValidator -- Validating V4__Fingerprints.sql
11:07:03.111 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.resource.ResourceNameValidator -- Validating V3__Jar_symbols.sql
11:07:03.258 [pool-1-thread-4] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:h2:file:/workspaces/**projectpath**/.metals/metals (H2 2.2)
11:07:03.258 [pool-1-thread-4] DEBUG org.flywaydb.core.FlywayExecutor -- Driver: H2 JDBC Driver 2.2.224 (2023-09-17)
11:07:03.259 [pool-1-thread-4] DEBUG org.flywaydb.core.FlywayExecutor -- DDL Transactions Supported: false
11:07:03.260 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.schemahistory.SchemaHistoryFactory -- Schemas:
11:07:03.261 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.schemahistory.SchemaHistoryFactory -- Default schema: null
11:07:03.266 [pool-1-thread-4] WARN org.flywaydb.core.internal.database.base.Database -- Flyway upgrade recommended: H2 2.2.224 is newer than this version of Flyway and support has not been tested. The latest supported version of H2 is 2.2.220.
11:07:03.268 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory -- Scanning for SQL callbacks ...
11:07:03.268 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/ (filename: )
11:07:03.279 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.command.DbValidate -- Validating migrations ...
11:07:03.285 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/ (filename: )
11:07:03.293 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/V2__Server_discovery.sql (filename: V2__Server_discovery.sql)
11:07:03.293 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/V1__Create_tables.sql (filename: V1__Create_tables.sql)
11:07:03.294 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/V4__Fingerprints.sql (filename: V4__Fingerprints.sql)
11:07:03.294 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/ (filename: )
11:07:03.294 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/V3__Jar_symbols.sql (filename: V3__Jar_symbols.sql)
11:07:03.296 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/V2__Server_discovery.sql (filename: V2__Server_discovery.sql)
11:07:03.296 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/V1__Create_tables.sql (filename: V1__Create_tables.sql)
11:07:03.297 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/V4__Fingerprints.sql (filename: V4__Fingerprints.sql)
11:07:03.297 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/ (filename: )
11:07:03.297 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.scanner.Scanner -- Filtering out resource: db/migration/V3__Jar_symbols.sql (filename: V3__Jar_symbols.sql)
11:07:03.308 [pool-1-thread-4] INFO org.flywaydb.core.internal.command.DbValidate -- Successfully validated 4 migrations (execution time 00:00.027s)
11:07:03.311 [pool-1-thread-4] DEBUG org.flywaydb.core.internal.command.DbSchemas -- Skipping creation of existing schema: "PUBLIC"
11:07:03.319 [pool-1-thread-4] INFO org.flywaydb.core.internal.command.DbMigrate -- Current version of schema "PUBLIC": 4
11:07:03.323 [pool-1-thread-4] INFO org.flywaydb.core.internal.command.DbMigrate -- Schema "PUBLIC" is up to date. No migration necessary.
11:07:03.344 [pool-1-thread-4] DEBUG org.flywaydb.core.FlywayExecutor -- Memory usage: 35 of 134M
2024.02.14 11:07:04 INFO skipping build import with status 'Installed'
2024.02.14 11:07:04 INFO Attempting to connect to the build server...
2024.02.14 11:07:04 INFO Bloop uses /usr/local/openjdk-8 defined at /root/.bloop/bloop.json
2024.02.14 11:07:06 INFO tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at /workspaces/**projectpath**/.metals/bsp.trace.json or /root/.cache/metals/bsp.trace.json
2024.02.14 11:07:06 INFO Attempting to connect to the build server...
2024.02.14 11:07:06 INFO Bloop uses /usr/local/openjdk-8 defined at /root/.bloop/bloop.json
2024.02.14 11:07:06 INFO Attempting to connect to the build server...
2024.02.14 11:07:06 INFO Bloop uses /usr/local/openjdk-8 defined at /root/.bloop/bloop.json
2024.02.14 11:07:06 INFO tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at /workspaces/**projectpath**/project/project/.metals/bsp.trace.json or /root/.cache/metals/bsp.trace.json
2024.02.14 11:07:07 INFO tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at /workspaces/**projectpath**/project/.metals/bsp.trace.json or /root/.cache/metals/bsp.trace.json
2024.02.14 11:07:07 INFO time: Connected to build server in 3s
2024.02.14 11:07:07 INFO Connected to Build server: Bloop v1.5.15
2024.02.14 11:07:06 INFO time: Imported build in 0.3s
2024.02.14 11:07:12 INFO time: indexed workspace in 5.37s
2024.02.14 11:08:16 INFO running '/usr/bin/sbt -Dbloop.export-jar-classifiers=sources bloopInstall'
2024.02.14 11:08:17 INFO [info] welcome to sbt 1.9.7 (Oracle Corporation Java 1.8.0_332)
2024.02.14 11:08:17 INFO [info] loading settings for project myproject-build-build-build from metals.sbt ...
2024.02.14 11:08:18 INFO [info] loading project definition from /workspaces/**projectpath**/project/project/project
2024.02.14 11:08:19 INFO [info] loading settings for project myproject-build-build from metals.sbt ...
2024.02.14 11:08:19 INFO [info] loading project definition from /workspaces/**projectpath**/project/project
2024.02.14 11:08:21 INFO [success] Generated .bloop/myproject-build-build.json
2024.02.14 11:08:21 INFO [success] Total time: 2 s, completed Feb 14, 2024 11:08:21 AM
2024.02.14 11:08:21 INFO [info] loading settings for project myproject-build from metals.sbt,plugins.sbt ...
2024.02.14 11:08:22 INFO [info] loading project definition from /workspaces/**projectpath**/project
2024.02.14 11:08:22 INFO [success] Generated .bloop/myproject-build.json
2024.02.14 11:08:22 INFO [success] Total time: 1 s, completed Feb 14, 2024 11:08:23 AM
2024.02.14 11:08:24 INFO [info] loading settings for project myproject from build.sbt ...
2024.02.14 11:08:24 INFO [info] set current project to myproject (in build file:/workspaces/**projectpath**/)
2024.02.14 11:08:26 INFO [success] Generated .bloop/myproject.json
2024.02.14 11:08:26 INFO [success] Generated .bloop/myproject-test.json
2024.02.14 11:08:26 INFO [success] Total time: 2 s, completed Feb 14, 2024 11:08:26 AM
2024.02.14 11:08:26 INFO time: ran 'sbt bloopInstall' in 10s
2024.02.14 11:08:26 INFO Disconnecting from Bloop session...
2024.02.14 11:08:27 INFO Shut down connection with build server.
2024.02.14 11:08:27 INFO Shut down connection with build server.
2024.02.14 11:08:26 INFO Shut down connection with build server.
2024.02.14 11:08:26 INFO Attempting to connect to the build server...
2024.02.14 11:08:26 INFO Bloop uses /usr/local/openjdk-8 defined at /root/.bloop/bloop.json
2024.02.14 11:08:26 INFO tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at /workspaces/**projectpath**/.metals/bsp.trace.json or /root/.cache/metals/bsp.trace.json
2024.02.14 11:08:26 INFO Attempting to connect to the build server...
2024.02.14 11:08:26 INFO Bloop uses /usr/local/openjdk-8 defined at /root/.bloop/bloop.json
2024.02.14 11:08:26 INFO Attempting to connect to the build server...
2024.02.14 11:08:26 INFO Bloop uses /usr/local/openjdk-8 defined at /root/.bloop/bloop.json
2024.02.14 11:08:26 INFO tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at /workspaces/**projectpath**/project/project/.metals/bsp.trace.json or /root/.cache/metals/bsp.trace.json
2024.02.14 11:08:27 INFO tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at /workspaces/**projectpath**/project/.metals/bsp.trace.json or /root/.cache/metals/bsp.trace.json
2024.02.14 11:08:27 INFO time: Connected to build server in 0.35s
2024.02.14 11:08:27 INFO Connected to Build server: Bloop v1.5.15
2024.02.14 11:08:27 INFO time: Imported build in 0.22s
2024.02.14 11:08:31 INFO time: indexed workspace in 3.57s
Feb 14, 2024 11:50:04 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 22
Feb 14, 2024 11:50:10 AM org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint notify
INFO: Unsupported notification method: $/setTrace
Does it happen on a specific project? What is the Scala version you are using? Could you maybe turn on verbose compilation setting and send us that? Looks like the compilation never triggers.
Maybe the issue is the version of Bloop? You can test out by setting the Bloop version setting to the previous one 1.5.13
Hi, sorry for my late delay, some urgent topics came in.
Scala version: 2.12.15 I tried a downgrade of Bloop to 1.5.13 with a Metals 1.2.2 and it fixes the problem (if you ignore the warning of VS Code telling that I should upgrade bloop)
I have two workarounds for the moment (Downgrade Bloop to 1.5.13
or downgrade Metals to 1.2.0
)
But it would still be nice if they would work together again as provided by the VS Code Metals extension.
However should this behavior be reported to the VS Code Metals Project?
Are you able to provide any details about the project? A reproduction would probably be best
I will try to reproduce the problem in a dummy project which I can share with you. However I think it will take some days until I get the time for it.
Sorry I did not manage to create the test case.
However the problem seems to be resolved with Metals 1.3 and Bloop 1.5.17