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

Rust code intelligence #7

Open
beyang opened this Issue Jun 26, 2017 · 7 comments

Comments

Projects
None yet
7 participants
@beyang
Copy link
Member

beyang commented Jun 26, 2017

Support Rust on Sourcegraph.

@beyang beyang changed the title Rust support Rust code intelligence Jan 26, 2018

@chrismwendt

This comment has been minimized.

Copy link
Contributor

chrismwendt commented May 22, 2018

Experimental Rust support has been shipped in Sourcegraph 2.8! Check out the blog post https://about.sourcegraph.com/blog/code-intelligence-for-more-languages-and-lsp-language-server-protocol-support

demonstration of hovers from the Rust language server inside databricks/click

Thanks go to the rust-lang-nursery/rls project for providing the language server.

@sqs sqs added this to the December 2018 milestone Oct 25, 2018

@sqs

This comment has been minimized.

Copy link
Member

sqs commented Oct 25, 2018

Better Rust support is planned for December 2018. https://docs.sourcegraph.com/dev/roadmap#december-2018

@sqs sqs added roadmap and removed roadmap labels Nov 13, 2018

@nicksnyder nicksnyder modified the milestones: 3.0-preview.2, 3.0, Backlog Dec 14, 2018

@chrismwendt

This comment has been minimized.

Copy link
Contributor

chrismwendt commented Jan 23, 2019

We've since removed Rust support and don't have immediate plans to bring it back. There are two potential paths forward:

  • Improve the initialization time of RLS (needs to compile the entire project before providing code intelligence, can take minutes)
  • Wait for rust-analyzer to be able to replace RLS (years out)

Neither of these are particularly appealing since Sourcegraph is sensitive to initialization time (because analysis is performed on the fly) and we'd like to improve code intelligence on a time scale on the order of months.

@spacejam

This comment has been minimized.

Copy link

spacejam commented Jan 24, 2019

@chrismwendt rust-analyzer supports definition and reference look-up today, are there other bits of functionality that are important for sourcegraph that are currently missing? I'm having trouble pinpointing the sourcegraph code that formerly interacted with RLS in the public repos.

@matklad can shed light on the relative stability for specific APIs that you would like to use, but I believe that "years out" may not be accurate for stable implementations of sourcegraph's requirements.

sourcegraph is a cool tool and it would be a shame for the growing rust community to lose support :)

@matklad

This comment has been minimized.

Copy link

matklad commented Jan 24, 2019

"couple of years" might be a good estimate for 100% coverage of the Rust language, but some part of those 100% is already working today. For example, goto defenition for imports pretty much just works. So, if partial support of the Rust language is interesting, rust-analzyer can provide that.

can shed light on the relative stability for specific APIs

The "as a library API" is totally unstable, but we can ship a statically linked binary which talks LSP, and that is of course stable.

@LandKingdom

This comment has been minimized.

Copy link

LandKingdom commented Jan 24, 2019

I personally wouldn't mind waiting some time before being able to use the tool.

@chrismwendt

This comment has been minimized.

Copy link
Contributor

chrismwendt commented Jan 25, 2019

@spacejam The 3 main bits of functionality are hover tooltips, definitions, and references. It sounds like rust-analyzer would work pretty well since it already has support for 2 of those 3.

Now that code intelligence on Sourcegraph is provided by Sourcegraph extensions, anyone can build a Rust extension with the same functionality as other language extensions like Go, TypeScript, and Python.

Since Sourcegraph extensions are JavaScript bundles that run in the browser, they are constrained to communicate with a remote language server over HTTP or WebSockets. To satisfy this constraint, we've added WebSocket and zip archive fetching (to get the repository contents on disk) to the Go, TypeScript, and Python language servers. Rust would probably need similar functionality, but what's nice is that the extensions are free to choose how to do that - Sourcegraph does not mandate any particular transport or protocol be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment