mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
Fully document ra_lsp_server
This commit is contained in:
parent
1f142d79ed
commit
4d307ff802
8 changed files with 20 additions and 11 deletions
|
@ -1,10 +1,14 @@
|
||||||
//! FIXME: write short doc here
|
//! See `CargoTargetSpec`
|
||||||
|
|
||||||
use ra_ide::{FileId, RunnableKind, TestId};
|
use ra_ide::{FileId, RunnableKind, TestId};
|
||||||
use ra_project_model::{self, ProjectWorkspace, TargetKind};
|
use ra_project_model::{self, ProjectWorkspace, TargetKind};
|
||||||
|
|
||||||
use crate::{world::WorldSnapshot, Result};
|
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) struct CargoTargetSpec {
|
||||||
pub(crate) package: String,
|
pub(crate) package: String,
|
||||||
pub(crate) target: String,
|
pub(crate) target: String,
|
||||||
|
|
|
@ -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::{
|
use lsp_types::{
|
||||||
self, CreateFile, DiagnosticSeverity, DocumentChangeOperation, DocumentChanges, Documentation,
|
self, CreateFile, DiagnosticSeverity, DocumentChangeOperation, DocumentChanges, Documentation,
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
//! Book keeping for keeping diagnostics easily in sync with the client.
|
//! Book keeping for keeping diagnostics easily in sync with the client.
|
||||||
|
|
||||||
|
use std::{collections::HashMap, sync::Arc};
|
||||||
|
|
||||||
use lsp_types::{CodeActionOrCommand, Diagnostic, Range};
|
use lsp_types::{CodeActionOrCommand, Diagnostic, Range};
|
||||||
use ra_ide::FileId;
|
use ra_ide::FileId;
|
||||||
use std::{collections::HashMap, sync::Arc};
|
|
||||||
|
|
||||||
pub type CheckFixes = Arc<HashMap<FileId, Vec<Fix>>>;
|
pub type CheckFixes = Arc<HashMap<FileId, Vec<Fix>>>;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//! The main loop of `ra_lsp_server` responsible for dispatching LSP requests/replies and
|
//! The main loop of `ra_lsp_server` responsible for dispatching LSP
|
||||||
//! notifications back to the client.
|
//! requests/replies and notifications back to the client.
|
||||||
|
|
||||||
mod handlers;
|
mod handlers;
|
||||||
mod subscriptions;
|
mod subscriptions;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
//! This module is responsible for implementing handlers for Lanuage Server Protocol.
|
//! This module is responsible for implementing handlers for Language Server
|
||||||
//! The majority of requests are fulfilled by calling into the `ra_ide` crate.
|
//! Protocol. The majority of requests are fulfilled by calling into the
|
||||||
|
//! `ra_ide` crate.
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::hash_map::Entry,
|
collections::hash_map::Entry,
|
||||||
|
|
|
@ -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 ra_ide::FileId;
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//! The context or environment in which the language server functions.
|
//! The context or environment in which the language server functions. In our
|
||||||
//! In our server implementation this is know as the `WorldState`.
|
//! server implementation this is know as the `WorldState`.
|
||||||
//!
|
//!
|
||||||
//! Each tick provides an immutable snapshot of the state as `WorldSnapshot`.
|
//! Each tick provides an immutable snapshot of the state as `WorldSnapshot`.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue