Changes from review

This commit is contained in:
Zac Pullar-Strecker
2020-09-01 11:38:32 +12:00
parent 8c32bdea36
commit a14194b428
6 changed files with 14 additions and 47 deletions

View File

@@ -348,30 +348,10 @@ pub struct CommandLink {
pub tooltip: Option<String>,
}
pub enum OpenDocs {}
pub enum ExternalDocs {}
impl Request for OpenDocs {
type Params = OpenDocsParams;
type Result = DocumentationLink;
const METHOD: &'static str = "rust-analyzer/openDocs";
}
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct OpenDocsParams {
// TODO: I don't know the difference between these two methods of passing position.
#[serde(flatten)]
pub position: lsp_types::TextDocumentPositionParams,
// pub textDocument: lsp_types::TextDocumentIdentifier,
// pub position: lsp_types::Position,
}
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DocumentationLink {
pub remote: String, // TODO: Better API?
// #[serde(skip_serializing_if = "Option::is_none")]
// pub remote: Option<String>,
// #[serde(skip_serializing_if = "Option::is_none")]
// pub local: Option<String>
impl Request for ExternalDocs {
type Params = lsp_types::TextDocumentPositionParams;
type Result = Option<lsp_types::Url>;
const METHOD: &'static str = "experimental/externalDocs";
}