From 4ef5cd9a89fd5ee02ae655ba08486087af9ffcf4 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sat, 21 Dec 2019 15:27:38 -0500 Subject: [PATCH] Add some module docs --- crates/ra_lsp_server/src/caps.rs | 2 +- crates/ra_lsp_server/src/conv.rs | 2 +- crates/ra_lsp_server/src/main_loop.rs | 3 ++- crates/ra_lsp_server/src/main_loop/handlers.rs | 3 ++- crates/ra_lsp_server/src/main_loop/pending_requests.rs | 2 +- crates/ra_lsp_server/src/main_loop/subscriptions.rs | 2 +- crates/ra_lsp_server/src/markdown.rs | 2 +- crates/ra_lsp_server/src/req.rs | 2 +- crates/ra_lsp_server/src/world.rs | 5 ++++- 9 files changed, 14 insertions(+), 9 deletions(-) diff --git a/crates/ra_lsp_server/src/caps.rs b/crates/ra_lsp_server/src/caps.rs index d812ff7ca2a..eeca67ee190 100644 --- a/crates/ra_lsp_server/src/caps.rs +++ b/crates/ra_lsp_server/src/caps.rs @@ -1,4 +1,4 @@ -//! FIXME: write short doc here +//! Advertizes the capabilities of the LSP Server. use lsp_types::{ CodeActionProviderCapability, CodeLensOptions, CompletionOptions, diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 5561f6270b6..e93d4ea33d5 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs @@ -1,4 +1,4 @@ -//! FIXME: write short doc here +//! Convenience module responsible for translating between rust-analyzer's types and LSP types. use lsp_types::{ self, CreateFile, DiagnosticSeverity, DocumentChangeOperation, DocumentChanges, Documentation, diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 9e207415e63..81fd08c910f 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -1,4 +1,5 @@ -//! FIXME: write short doc here +//! The main loop of `ra_lsp_server` responsible for dispatching LSP requests/replies and +//! notifications back to the client. mod handlers; mod subscriptions; diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 5e3b1a73f01..39eb3df3e55 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -1,4 +1,5 @@ -//! FIXME: write short doc here +//! This module is responsible for implementing handlers for Lanuage Server Protocol. +//! The majority of requests are fulfilled by calling into the `ra_ide` crate. use std::{fmt::Write as _, io::Write as _}; diff --git a/crates/ra_lsp_server/src/main_loop/pending_requests.rs b/crates/ra_lsp_server/src/main_loop/pending_requests.rs index e7ea7aa5b84..2d221346418 100644 --- a/crates/ra_lsp_server/src/main_loop/pending_requests.rs +++ b/crates/ra_lsp_server/src/main_loop/pending_requests.rs @@ -1,4 +1,4 @@ -//! FIXME: write short doc here +//! Datastructures that keep track of inflight requests. use std::time::{Duration, Instant}; diff --git a/crates/ra_lsp_server/src/main_loop/subscriptions.rs b/crates/ra_lsp_server/src/main_loop/subscriptions.rs index 609b2adcc99..b0bae90f5c1 100644 --- a/crates/ra_lsp_server/src/main_loop/subscriptions.rs +++ b/crates/ra_lsp_server/src/main_loop/subscriptions.rs @@ -1,4 +1,4 @@ -//! FIXME: write short doc here +//! Keeps track of file subscriptions. use ra_ide::FileId; use rustc_hash::FxHashSet; diff --git a/crates/ra_lsp_server/src/markdown.rs b/crates/ra_lsp_server/src/markdown.rs index f51fc4ade39..76bef45ccc2 100644 --- a/crates/ra_lsp_server/src/markdown.rs +++ b/crates/ra_lsp_server/src/markdown.rs @@ -1,4 +1,4 @@ -//! FIXME: write short doc here +//! Transforms markdown pub(crate) fn format_docs(src: &str) -> String { let mut processed_lines = Vec::new(); diff --git a/crates/ra_lsp_server/src/req.rs b/crates/ra_lsp_server/src/req.rs index 2a22b655ce1..b34e6f9b89b 100644 --- a/crates/ra_lsp_server/src/req.rs +++ b/crates/ra_lsp_server/src/req.rs @@ -1,4 +1,4 @@ -//! FIXME: write short doc here +//! Defines `rust-analyzer` specific custom messages. use lsp_types::{Location, Position, Range, TextDocumentIdentifier, Url}; use rustc_hash::FxHashMap; diff --git a/crates/ra_lsp_server/src/world.rs b/crates/ra_lsp_server/src/world.rs index f89b23089e0..5e53b027855 100644 --- a/crates/ra_lsp_server/src/world.rs +++ b/crates/ra_lsp_server/src/world.rs @@ -1,4 +1,7 @@ -//! FIXME: write short doc here +//! 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`. use std::{ path::{Path, PathBuf},