diff options
Diffstat (limited to 'crates/rust-analyzer/src/lsp_ext.rs')
-rw-r--r-- | crates/rust-analyzer/src/lsp_ext.rs | 28 |
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 | ||
5 | use lsp_types::request::Request; | 5 | use lsp_types::request::Request; |
6 | use lsp_types::{Position, Range, TextDocumentIdentifier}; | 6 | use lsp_types::{Position, Range, TextDocumentIdentifier}; |
7 | use rustc_hash::FxHashMap; | ||
8 | use serde::{Deserialize, Serialize}; | 7 | use serde::{Deserialize, Serialize}; |
9 | 8 | ||
10 | pub enum AnalyzerStatus {} | 9 | pub 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")] | ||
125 | pub 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")] |
127 | pub enum RunnableKind { | 135 | pub 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")] |
135 | pub struct Runnable { | 141 | pub 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 | ||
145 | pub enum InlayHints {} | 149 | pub enum InlayHints {} |