原文自:internals.rust-lang.org
作者:jntrnr
@nrc and I have been hard at work on IDE support, turning the Rust Language Server demo weshowed at RustConf2.2k
into an actual project. Today, we're making our firstsource pre-alpha release1.8k
of the project.
We're excited about what the RLS project will mean for Rust development in the future. The RLS aims at being a self-contained, full-featured application for IDE support. By being self-contained, and following a simple protocol, all the core IDE functionality will be available to any editor.
At least... that's the theory. We still have a lot of work to get there. We need developers, testers, and people with expertise in various editors to help flesh out the support and make sure the experience feels good.
****The RLS is not yet ready for primetime** **. This early release may eat your hard drive or frighten your neighbors. We recommend only using the RLS with code you are making regular backups of. If you are still interested, you can get started by following theguide605
.
Where we need help
First, we're looking for people who want to write code and help flesh out the RLS. There are a growing list ofissues to tackle481
as well as a number of FIXMEs in the code.
If you're okay with living on the bleeding edge, we'd love to get testing feedback. Do features stop working in some cases? What were the steps that caused them to break?File an issue40
and let us know.
The RLS uses theLanguage Server Protocol1.1k
, a json-rpc protocol backed by Microsoft and Red Hat. It's a relatively young protocol. Currently, Eclipse and Visual Studio Code support this protocol, and it should be possible to add support to other editors. It just takes putting in the work.
What works
The current version supports the following features:
- errors as you type
- goto def
- find all refsrenamingtypes/docs/doc links on hover
- types and docs from the standard library
What doesn't work
Of course, not everything is roses. There are also some shortcomings:
- Analysis can be slow. This is especially true for initial analysis, which has to work its way through all your dependencies.
- Projects with dependencies that have custom build steps or compiler plugins aren't supported out of the box. To support them you need to enable the "slow, but more accurate" mode by removing the "-Zno-trans" command to the compiler in build.rs.
- Please use caution when using this. The RLS can make updates your code when doing tasks like rename/refactor. Always check that the RLS made edits that you expected. If not, file an issue so we can follow up.
Next steps
We're currently working towards an Alpha release, which is geared towards a broader audience. To get there, we've trackingtasks242
to help us reach the Alpha.
If you have any questions you can ping nrc or jntrnr on irc.mozilla.org