aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/lsp_ext.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rust-analyzer/src/lsp_ext.rs')
-rw-r--r--crates/rust-analyzer/src/lsp_ext.rs28
1 files changed, 16 insertions, 12 deletions
diff --git a/crates/rust-analyzer/src/lsp_ext.rs b/crates/rust-analyzer/src/lsp_ext.rs
index 173c23b9e..9381f75d3 100644
--- a/crates/rust-analyzer/src/lsp_ext.rs
+++ b/crates/rust-analyzer/src/lsp_ext.rs
@@ -4,7 +4,6 @@ use std::{collections::HashMap, path::PathBuf};
4 4
5use lsp_types::request::Request; 5use lsp_types::request::Request;
6use lsp_types::{Position, Range, TextDocumentIdentifier}; 6use lsp_types::{Position, Range, TextDocumentIdentifier};
7use rustc_hash::FxHashMap;
8use serde::{Deserialize, Serialize}; 7use serde::{Deserialize, Serialize};
9 8
10pub enum AnalyzerStatus {} 9pub enum AnalyzerStatus {}
@@ -121,25 +120,30 @@ pub struct RunnablesParams {
121 pub position: Option<Position>, 120 pub position: Option<Position>,
122} 121}
123 122
124// Must strictly correspond to the executable name 123#[derive(Deserialize, Serialize, Debug)]
124#[serde(rename_all = "camelCase")]
125pub struct Runnable {
126 pub label: String,
127 #[serde(skip_serializing_if = "Option::is_none")]
128 pub location: Option<lsp_types::LocationLink>,
129 pub kind: RunnableKind,
130 pub args: CargoRunnable,
131}
132
125#[derive(Serialize, Deserialize, Debug)] 133#[derive(Serialize, Deserialize, Debug)]
126#[serde(rename_all = "lowercase")] 134#[serde(rename_all = "lowercase")]
127pub enum RunnableKind { 135pub enum RunnableKind {
128 Cargo, 136 Cargo,
129 Rustc,
130 Rustup,
131} 137}
132 138
133#[derive(Deserialize, Serialize, Debug)] 139#[derive(Deserialize, Serialize, Debug)]
134#[serde(rename_all = "camelCase")] 140#[serde(rename_all = "camelCase")]
135pub struct Runnable { 141pub struct CargoRunnable {
136 pub range: Range, 142 pub workspace_root: Option<PathBuf>,
137 pub label: String, 143 // command, --package and --lib stuff
138 pub kind: RunnableKind, 144 pub cargo_args: Vec<String>,
139 pub args: Vec<String>, 145 // stuff after --
140 pub extra_args: Vec<String>, 146 pub executable_args: Vec<String>,
141 pub env: FxHashMap<String, String>,
142 pub cwd: Option<PathBuf>,
143} 147}
144 148
145pub enum InlayHints {} 149pub enum InlayHints {}