on master help sign in
Add an option to disable display of progress in status bar
bbefc1dwojciechkepka
book/src/configuration.md+8
@@ -1,5 +1,12 @@
1# Configuration
1# Configuration
2
2
3+## LSP
4+
5+To disable language server progress report from being displayed in the status bar add this option to your `config.toml`:
6+```toml
7+lsp_progress = false
8+```
9+
3## Theme
10## Theme
4
11
5Use a custom theme by placing a theme.toml in your config directory (i.e ~/.config/helix/theme.toml). The default theme.toml can be found [here](https://github.com/helix-editor/helix/blob/master/theme.toml), and user submitted themes [here](https://github.com/helix-editor/helix/blob/master/contrib/themes).
12Use a custom theme by placing a theme.toml in your config directory (i.e ~/.config/helix/theme.toml). The default theme.toml can be found [here](https://github.com/helix-editor/helix/blob/master/theme.toml), and user submitted themes [here](https://github.com/helix-editor/helix/blob/master/contrib/themes).
@@ -87,3 +94,4 @@ Possible keys:
87These keys match [tree-sitter scopes](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme). We half-follow the common scopes from [macromates language grammars](https://macromates.com/manual/en/language_grammars) with some differences.
94These keys match [tree-sitter scopes](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme). We half-follow the common scopes from [macromates language grammars](https://macromates.com/manual/en/language_grammars) with some differences.
88
95
89For a given highlight produced, styling will be determined based on the longest matching theme key. So it's enough to provide function to highlight `function.macro` and `function.builtin` as well, but you can use more specific scopes to highlight specific cases differently.
96For a given highlight produced, styling will be determined based on the longest matching theme key. So it's enough to provide function to highlight `function.macro` and `function.builtin` as well, but you can use more specific scopes to highlight specific cases differently.
97+
helix-term/src/application.rs+6−2
@@ -39,6 +39,7 @@ pub struct Application {
39 callbacks: LspCallbacks,
39 callbacks: LspCallbacks,
40
40
41 lsp_progress: LspProgressMap,
41 lsp_progress: LspProgressMap,
42+ lsp_progress_enabled: bool,
42}
43}
43
44
44impl Application {
45impl Application {
@@ -77,6 +78,7 @@ impl Application {
77
78
78 callbacks: FuturesUnordered::new(),
79 callbacks: FuturesUnordered::new(),
79 lsp_progress: LspProgressMap::new(),
80 lsp_progress: LspProgressMap::new(),
81+ lsp_progress_enabled: config.global.lsp_progress,
80 };
82 };
81
83
82 Ok(app)
84 Ok(app)
@@ -310,8 +312,10 @@ impl Application {
310 self.lsp_progress.update(server_id, token, work);
312 self.lsp_progress.update(server_id, token, work);
311 }
313 }
312
314
315+ if self.lsp_progress_enabled {
313− self.editor.set_status(status);
316+ self.editor.set_status(status);
314− self.render();
317+ self.render();
318+ }
315 }
319 }
316 _ => unreachable!(),
320 _ => unreachable!(),
317 }
321 }
helix-term/src/config.rs+10
@@ -5,13 +5,20 @@ use serde::{de::Error as SerdeError, Deserialize, Serialize};
5
5
6use crate::keymap::{parse_keymaps, Keymaps};
6use crate::keymap::{parse_keymaps, Keymaps};
7
7
8+#[derive(Default)]
9+pub struct GlobalConfig {
10+ pub lsp_progress: bool,
11+}
12+
8#[derive(Default)]
13#[derive(Default)]
9pub struct Config {
14pub struct Config {
15+ pub global: GlobalConfig,
10 pub keymaps: Keymaps,
16 pub keymaps: Keymaps,
11}
17}
12
18
13#[derive(Serialize, Deserialize)]
19#[derive(Serialize, Deserialize)]
14struct TomlConfig {
20struct TomlConfig {
21+ lsp_progress: Option<bool>,
15 keys: Option<HashMap<String, HashMap<String, String>>>,
22 keys: Option<HashMap<String, HashMap<String, String>>>,
16}
23}
17
24
@@ -22,6 +29,9 @@ impl<'de> Deserialize<'de> for Config {
22 {
29 {
23 let config = TomlConfig::deserialize(deserializer)?;
30 let config = TomlConfig::deserialize(deserializer)?;
24 Ok(Self {
31 Ok(Self {
32+ global: GlobalConfig {
33+ lsp_progress: config.lsp_progress.unwrap_or(true),
34+ },
25 keymaps: config
35 keymaps: config
26 .keys
36 .keys
27 .map(|r| parse_keymaps(&r))
37 .map(|r| parse_keymaps(&r))