on master help sign in
Move top level lsp config to editor.lsp (#1868)
7b3a3d5Gokul Soumya
book/src/configuration.md+8−10
@@ -43,6 +43,14 @@ hidden = false
43| `auto-info` | Whether to display infoboxes | `true` |
43| `auto-info` | Whether to display infoboxes | `true` |
44| `true-color` | Set to `true` to override automatic detection of terminal truecolor support in the event of a false negative. | `false` |
44| `true-color` | Set to `true` to override automatic detection of terminal truecolor support in the event of a false negative. | `false` |
45
45
46+### `[editor.lsp]` Section
47+
48+| Key | Description | Default |
49+| --- | ----------- | ------- |
50+| `display-messages` | Display LSP progress messages below statusline[^1] | `false` |
51+
52+[^1]: A progress spinner is always shown in the statusline beside the file path.
53+
46### `[editor.cursor-shape]` Section
54### `[editor.cursor-shape]` Section
47
55
48Defines the shape of cursor in each mode. Note that due to limitations
56Defines the shape of cursor in each mode. Note that due to limitations
@@ -126,13 +134,3 @@ Search specific options.
126|--|--|---------|
134|--|--|---------|
127| `smart-case` | Enable smart case regex searching (case insensitive unless pattern contains upper case characters) | `true` |
135| `smart-case` | Enable smart case regex searching (case insensitive unless pattern contains upper case characters) | `true` |
128| `wrap-around`| Whether the search should wrap after depleting the matches | `true` |
136| `wrap-around`| Whether the search should wrap after depleting the matches | `true` |
129−
130−
131−## LSP
132−
133−To display all language server messages in the status line add the following to your `config.toml`:
134−
135−```toml
136−[lsp]
137−display-messages = true
138−```
helix-term/src/application.rs+1−1
@@ -760,7 +760,7 @@ impl Application {
760 self.lsp_progress.update(server_id, token, work);
760 self.lsp_progress.update(server_id, token, work);
761 }
761 }
762
762
763− if self.config.load().lsp.display_messages {
763+ if self.config.load().editor.lsp.display_messages {
764 self.editor.set_status(status);
764 self.editor.set_status(status);
765 }
765 }
766 }
766 }
helix-term/src/config.rs−9
@@ -11,8 +11,6 @@ use toml::de::Error as TomlError;
11#[serde(deny_unknown_fields)]
11#[serde(deny_unknown_fields)]
12pub struct Config {
12pub struct Config {
13 pub theme: Option<String>,
13 pub theme: Option<String>,
14− #[serde(default)]
15− pub lsp: LspConfig,
16 #[serde(default = "default")]
14 #[serde(default = "default")]
17 pub keys: HashMap<Mode, Keymap>,
15 pub keys: HashMap<Mode, Keymap>,
18 #[serde(default)]
16 #[serde(default)]
@@ -23,7 +21,6 @@ impl Default for Config {
23 fn default() -> Config {
21 fn default() -> Config {
24 Config {
22 Config {
25 theme: None,
23 theme: None,
26− lsp: LspConfig::default(),
27 keys: default(),
24 keys: default(),
28 editor: helix_view::editor::Config::default(),
25 editor: helix_view::editor::Config::default(),
29 }
26 }
@@ -45,12 +42,6 @@ impl Display for ConfigLoadError {
45 }
42 }
46}
43}
47
44
48−#[derive(Debug, Default, Clone, PartialEq, Deserialize)]
49−#[serde(rename_all = "kebab-case", deny_unknown_fields)]
50−pub struct LspConfig {
51− pub display_messages: bool,
52−}
53−
54impl Config {
45impl Config {
55 pub fn load(config_path: PathBuf) -> Result<Config, ConfigLoadError> {
46 pub fn load(config_path: PathBuf) -> Result<Config, ConfigLoadError> {
56 match std::fs::read_to_string(config_path) {
47 match std::fs::read_to_string(config_path) {
helix-view/src/editor.rs+8
@@ -143,6 +143,13 @@ pub struct Config {
143 /// Search configuration.
143 /// Search configuration.
144 #[serde(default)]
144 #[serde(default)]
145 pub search: SearchConfig,
145 pub search: SearchConfig,
146+ pub lsp: LspConfig,
147+}
148+
149+#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
150+#[serde(rename_all = "kebab-case", deny_unknown_fields)]
151+pub struct LspConfig {
152+ pub display_messages: bool,
146}
153}
147
154
148#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
155#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
@@ -253,6 +260,7 @@ impl Default for Config {
253 cursor_shape: CursorShapeConfig::default(),
260 cursor_shape: CursorShapeConfig::default(),
254 true_color: false,
261 true_color: false,
255 search: SearchConfig::default(),
262 search: SearchConfig::default(),
263+ lsp: LspConfig::default(),
256 }
264 }
257 }
265 }
258}
266}