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

Add Scala support via Metals (Scala LSP) #6982

Closed
wants to merge 1 commit into from

Conversation

hmemcpy
Copy link
Contributor

@hmemcpy hmemcpy commented Jan 29, 2024

The Scala language support!
This uses the official Metals LSP server.

(this is still WIP because I need to download the LSP binary, and make sure all the brackets are correctly highlighted/inserted)

image

Copy link

cla-bot bot commented Jan 29, 2024

We require contributors to sign our Contributor License Agreement, and we don't have @hmemcpy on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@hmemcpy
Copy link
Contributor Author

hmemcpy commented Jan 29, 2024

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 29, 2024
Copy link

cla-bot bot commented Jan 29, 2024

The cla-bot has been summoned, and re-checked this pull request!

@bishabosha
Copy link

I also have a branch here https://github.com/bishabosha/zed/tree/feature-add-scala where I use coursier to bootstrap metals, however projects are not being recognised so I think we need some more custom hooks

@maxdeviant maxdeviant changed the title Scala support via Metals (Scala LSP) Add Scala support via Metals (Scala LSP) Jan 29, 2024
@hmemcpy
Copy link
Contributor Author

hmemcpy commented Jan 29, 2024

Ah, looks like there's another PR coming soon with those features implemented. So I'm closing this!

@hmemcpy hmemcpy closed this Jan 29, 2024
@hmemcpy hmemcpy deleted the scala-support branch January 29, 2024 14:00
@bishabosha
Copy link

bishabosha commented Jan 30, 2024

On my side it really seems like Zed is not receiving LSP requests from the client, only notifications (doing a lot of print debugging) - or at least it registers a handler for workspace/configuration, but it seems it never process the request, even though Metals logs show it being sent.

@mprihoda
Copy link
Contributor

mprihoda commented Feb 4, 2024

@bishabosha I figured out the problem with the LSP communication - the code in lsp.rs expects int as request's id, but the spec allows int or string and Metals uses strings.

I made a quick and dirty effort to implement it, successfully, Metals seems to be correctly building and reporting errors now, but my Rust knowledge is basically none, so I'd need someone to take a look at it.

The code is in my fork, if anyone would be willing to take a look:

https://github.com/mprihoda/zed/tree/wip/zed-scala

Not ready for a pull request yet.

@bishabosha
Copy link

Nice, super glad you found that! perhaps we can all collab on one fork?

@mprihoda
Copy link
Contributor

mprihoda commented Feb 8, 2024

I just made #7568 to gather feedback.

And sure, pooling our efforts into one fork might make things faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants