on master help sign in
Add an option to disable display of progress in status bar
commitbbefc1db63f7c3933adfd91fc404db9850af8399 authorwojciechkepka <wojtek.kepka@protonmail.com> dateFri 18 Jun 2021, 05:57 (5 years ago) parentd095ec1
3 files changed+24−2
book/src/configuration.md+8 helix-term/src/application.rs+6−2 helix-term/src/config.rs+10
book/src/configuration.md+8
@@ -1,5 +1,12 @@
11# Configuration
22
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+
310## Theme
411
512Use 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:
8794These 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.
8895
8996For 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 {
3939 callbacks: LspCallbacks,
4040
4141 lsp_progress: LspProgressMap,
42+ lsp_progress_enabled: bool,
4243}
4344
4445impl Application {
@@ -77,6 +78,7 @@ impl Application {
7778
7879 callbacks: FuturesUnordered::new(),
7980 lsp_progress: LspProgressMap::new(),
81+ lsp_progress_enabled: config.global.lsp_progress,
8082 };
8183
8284 Ok(app)
@@ -310,8 +312,10 @@ impl Application {
310312 self.lsp_progress.update(server_id, token, work);
311313 }
312314
313− self.editor.set_status(status);
314− self.render();
315+ if self.lsp_progress_enabled {
316+ self.editor.set_status(status);
317+ self.render();
318+ }
315319 }
316320 _ => unreachable!(),
317321 }
helix-term/src/config.rs+10
@@ -5,13 +5,20 @@ use serde::{de::Error as SerdeError, Deserialize, Serialize};
55
66use crate::keymap::{parse_keymaps, Keymaps};
77
8+#[derive(Default)]
9+pub struct GlobalConfig {
10+ pub lsp_progress: bool,
11+}
12+
813#[derive(Default)]
914pub struct Config {
15+ pub global: GlobalConfig,
1016 pub keymaps: Keymaps,
1117}
1218
1319#[derive(Serialize, Deserialize)]
1420struct TomlConfig {
21+ lsp_progress: Option<bool>,
1522 keys: Option<HashMap<String, HashMap<String, String>>>,
1623}
1724
@@ -22,6 +29,9 @@ impl<'de> Deserialize<'de> for Config {
2229 {
2330 let config = TomlConfig::deserialize(deserializer)?;
2431 Ok(Self {
32+ global: GlobalConfig {
33+ lsp_progress: config.lsp_progress.unwrap_or(true),
34+ },
2535 keymaps: config
2636 .keys
2737 .map(|r| parse_keymaps(&r))