Scala Metals fails
See original GitHub issueScala Metals is a language server that communicates over JSON-RPC. It can be installed with
curl -Lo coursier https://git.io/coursier-cli && chmod +x coursier
./coursier bootstrap org.scalameta:metals_2.12:0.7.0 -o metals -f`
The contents of my servers.yml
:
langservers:
scala:
- /Users/marduk/metals
I launched Jupyter Lab as follows:
node miniconda3/share/jupyter/lab/staging/node_modules/jsonrpc-ws-proxy/dist/server.js --port 3000 --languageServers servers.yml
jupyter lab
I created a Scala notebook (using the Almond kernel) and in ~/Library/Caches/org.scalameta.metals/global.log
I got the following error:
INFO tracing is disabled for protocol LSP, to enable tracing of incoming and outgoing JSON messages create an empty file at /Users/marduk/Library/Caches/org.scalameta.metals/lsp.trace.json
INFO Starting Metals server with configuration: MetalsServerConfig(
bloop-protocol=BloopProtocol(auto),
glob-syntax=GlobSyntaxConfig(uri),
status-bar=StatusBarConfig(off),
slow-task=SlowTaskConfig(off),
execute-client-command=ExecuteClientCommandConfig(off),
show-message=ShowMessageConfig(on),
show-message-request=ShowMessageRequestConfig(on),
no-initialized=false,
compilers=PresentationCompilerConfigImpl(false,None,None,Map(scala/collection/mutable/ -> mutable., java/util/ -> ju.),Ascii,true,true,true,true,true,20,SECONDS),
http=false,
input-box=false,
icons=none,
statistics=StatisticsConfig(default)
)
INFO logging to file /.metals/metals.log
Sep 01, 2019 9:45:07 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.nio.file.AccessDeniedException: /.metals
So it seems that Metals cannot create the directory .metals
in the current workspace. I did some research and it appears that the workspace for the language server is set by jsonrpc-ws-proxy/dist/server.js
.
Metals works in all the major editors, but it would be awesome to have it available in JupyterLab. See Integrating a new editor for details.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Metals will not connect to sbt if compilation fails · Issue #2347
scala and added a val hi: String = 3 . Executed a metals.generate-bsp-config which created the .bsp/sbt.json and then attempted to connect.
Read more >Proxy and mirrors | Metals
ERROR Failed to connect with build server, no functionality will work. java.lang.RuntimeException: The server did not start, got FailedToOpenBspConnection
Read more >scalameta/metals - Gitter
Metals keeps trying to compile forever. I'm seeing this in the logs No progress update for 30 seconds caused bloop to cancel compilation...
Read more >Metals VS Code connection to build server failing
I've set up a Scala project with the metals extension and when importing the the build.sbt, this fails and im provided with the...
Read more >Problems building with Scala Metals and Chisel v3.4.0
I got this error in Scala Metals today. ERROR Unexpected error when compiling fiddlybob: 'Multiple phases want to run right after typer; followers: ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Since #92 has been merged, I just tried again using a dev build on master. I get a fully resolved path under $HOME now and Metals starts up fine! 🎉
Thanks for the fast fix! I guess this issue can be closed now.
Thank you all for the pointers! This is how
rootUri
looks in the init message:I tried starting jupyter lab from somewhere outside $HOME as suggested by @bollwyvl and it seems Metals is starting up normally. I can see it creating its startup files, there’s LSP communication in
lsp.trace.json
, and the status bar says "fully initialized.We still don’t get back anything really usable as most answers are empty.
But I assume that’s because Metals doesn’t support Scala script files yet and has nothing to do with jupyterlab-lsp.
So I guess fully resolving
rootPath
on the server (#91) should solve the issue here.