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

scala metals (lsp) - dynamic root directory #24

Closed
gdiazlo opened this issue Oct 31, 2019 · 2 comments
Closed

scala metals (lsp) - dynamic root directory #24

gdiazlo opened this issue Oct 31, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@gdiazlo
Copy link

gdiazlo commented Oct 31, 2019

Following the instructions in https://scalameta.org/metals/docs/editors/new-editor.html, I have installed metals.

This language server uses the RootUri (RootDirectory in acme-lsp config) as the project starting point, supporting the addition of workspaces using the lsp messages.

I'm not sure if this is a common practice. This server works with multiple editor (vscode, emacs, vim, etc.). If it is, having a way to specify RootDirectory from cli instead the config file could come handy for acme-lsp.

@fhs
Copy link
Collaborator

fhs commented Oct 31, 2019

gopls treats rootUri as just another workspace folder. acme-lsp defaults to file:/// for rootUri and I haven't encountered any issues with that, which is why there is no flag for it. I don't mind adding a -rootdir flag if it's important for other language servers.

@fhs fhs added the enhancement New feature or request label Oct 31, 2019
@fhs fhs closed this as completed in c6a79a1 Nov 1, 2019
@gdiazlo
Copy link
Author

gdiazlo commented Nov 1, 2019

Thanks! I didn't have the time to answer! :) The flag comes handy, I can have now an Ametals script to be run from acme tag project folder:

#!/usr/bin/env bash
rootDir=$(pwd)
acme-lsp --rootdir $rootDir -v -server "(\.scala)|(\.sbt)$:metals" -workspaces "$rootDir:$1"

Still testing it, but now it starts and seems to work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants