From 2d131d63f92c932d8416367e530bc71300025c16 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 16 Feb 2019 14:43:59 +0300 Subject: document design guideline --- crates/ra_ide_api/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index d77a56ce8..1746b58ae 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs @@ -200,6 +200,12 @@ pub struct Analysis { db: salsa::Snapshot, } +// As a general design guideline, `Analysis` API are intended to be independent +// from the language server protocol. That is, when exposing some functionality +// we should think in terms of "what API makes most sense" and not in terms of +// "what types LSP uses". Although currently LSP is the only consumer of the +// API, the API should in theory be usable as a library, or via a different +// protocol. impl Analysis { /// Debug info about the current state of the analysis pub fn status(&self) -> String { -- cgit v1.2.3