Expand description
Implementation of the LSP for rust-analyzer.
This crate takes Rust-specific analysis results from ide and translates into LSP types.
It also is the root of all state. world module defines the bulk of the
state, and main_loop module defines the rules for modifying it.
The cli submodule implements some batch-processing analysis, primarily as
a debugging aid.
ModulesΒ§
- cli
- Various batch processing tasks, intended primarily for debugging.
- command π
- Utilities for running a cargo command like
cargo checkorcargo testin a separate thread and parse its stdout/stderr. - config
- Config used by the language server.
- diagnostics π
- Book keeping for keeping diagnostics easily in sync with the client.
- discover π
- Infrastructure for lazy project discovery. Currently only support rust-project.json discovery via a custom discover command.
- flycheck π
- Flycheck provides the functionality needed to run
cargo checkto provide LSP diagnostics based on the output of the command. - global_
state π - The context or environment in which the language server functions. In our
server implementation this is know as the
WorldState. - handlers π
- line_
index π - Enhances
ide::LineIndexwith additional info required to convert offsets into lsp positions. - lsp
- Custom LSP definitions and protocol conversions.
- main_
loop π - The main loop of
rust-analyzerresponsible for dispatching LSP requests/replies and notifications back to the client. - mem_
docs π - In-memory document information.
- op_
queue π - Bookkeeping to make sure only one long-running operation is being executed at a time.
- reload π
- Project loading & configuration updates.
- target_
spec π - See
TargetSpec - task_
pool π - A thin wrapper around [
stdx::thread::Pool] which threads a sender through spawned jobs. It is used incrate::global_state::GlobalStatethroughout the main loop. - test_
runner π - This module provides the functionality needed to run
cargo testin a background thread and report the result of each test in a channel. - tracing
- version π
- Code for representing rust-analyzerβs release version number.
ConstantsΒ§
- MINIMUM_
SUPPORTED_ TOOLCHAIN_ VERSION - Any toolchain less than this version will likely not work with rust-analyzer built from this revision.
FunctionsΒ§
- from_
json - main_
loop - server_
capabilities - version
- Returns information about cargoβs version.
- ws_
to_ crate_ graph