Fully document ra_lsp_server

This commit is contained in:
Aleksey Kladov 2020-02-18 12:25:26 +01:00
parent 1f142d79ed
commit 4d307ff802
8 changed files with 20 additions and 11 deletions

View file

@ -1,10 +1,14 @@
//! FIXME: write short doc here
//! See `CargoTargetSpec`
use ra_ide::{FileId, RunnableKind, TestId};
use ra_project_model::{self, ProjectWorkspace, TargetKind};
use crate::{world::WorldSnapshot, Result};
/// Abstract representation of Cargo target.
///
/// We use it to cook up the set of cli args we need to pass to Cargo to
/// build/test/run the target.
pub(crate) struct CargoTargetSpec {
pub(crate) package: String,
pub(crate) target: String,

View file

@ -1,4 +1,5 @@
//! Convenience module responsible for translating between rust-analyzer's types and LSP types.
//! Convenience module responsible for translating between rust-analyzer's types
//! and LSP types.
use lsp_types::{
self, CreateFile, DiagnosticSeverity, DocumentChangeOperation, DocumentChanges, Documentation,

View file

@ -1,7 +1,9 @@
//! Book keeping for keeping diagnostics easily in sync with the client.
use std::{collections::HashMap, sync::Arc};
use lsp_types::{CodeActionOrCommand, Diagnostic, Range};
use ra_ide::FileId;
use std::{collections::HashMap, sync::Arc};
pub type CheckFixes = Arc<HashMap<FileId, Vec<Fix>>>;

View file

@ -1,5 +1,5 @@
//! The main loop of `ra_lsp_server` responsible for dispatching LSP requests/replies and
//! notifications back to the client.
//! The main loop of `ra_lsp_server` responsible for dispatching LSP
//! requests/replies and notifications back to the client.
mod handlers;
mod subscriptions;

View file

@ -1,5 +1,6 @@
//! This module is responsible for implementing handlers for Lanuage Server Protocol.
//! The majority of requests are fulfilled by calling into the `ra_ide` crate.
//! This module is responsible for implementing handlers for Language Server
//! Protocol. The majority of requests are fulfilled by calling into the
//! `ra_ide` crate.
use std::{
collections::hash_map::Entry,

View file

@ -1,4 +1,4 @@
//! Datastructures that keep track of inflight requests.
//! Data structures that keep track of inflight requests.
use std::time::{Duration, Instant};

View file

@ -1,4 +1,5 @@
//! Keeps track of file subscriptions.
//! Keeps track of file subscriptions -- the set of currently opened files for
//! which we want to publish diagnostics, syntax highlighting, etc.
use ra_ide::FileId;
use rustc_hash::FxHashSet;

View file

@ -1,5 +1,5 @@
//! The context or environment in which the language server functions.
//! In our server implementation this is know as the `WorldState`.
//! The context or environment in which the language server functions. In our
//! server implementation this is know as the `WorldState`.
//!
//! Each tick provides an immutable snapshot of the state as `WorldSnapshot`.