on master help sign in
lsp: Make base request methods take &self instead of &mut self.
ae8a9e5Blaž Hrastnik
Cargo.lock+45−39
@@ -29,9 +29,9 @@ checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
29
29
30[[package]]
30[[package]]
31name = "arrayvec"
31name = "arrayvec"
32−version = "0.5.1"
32+version = "0.5.2"
33source = "registry+https://github.com/rust-lang/crates.io-index"
33source = "registry+https://github.com/rust-lang/crates.io-index"
34−checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"
34+checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
35
35
36[[package]]
36[[package]]
37name = "async-channel"
37name = "async-channel"
@@ -118,7 +118,7 @@ checksum = "4c8cea09c1fb10a317d1b5af8024eeba256d6554763e85ecd90ff8df31c7bbda"
118dependencies = [
118dependencies = [
119 "async-io",
119 "async-io",
120 "blocking",
120 "blocking",
121− "cfg-if",
121+ "cfg-if 0.1.10",
122 "event-listener",
122 "event-listener",
123 "futures-lite",
123 "futures-lite",
124 "once_cell",
124 "once_cell",
@@ -208,6 +208,12 @@ version = "0.1.10"
208source = "registry+https://github.com/rust-lang/crates.io-index"
208source = "registry+https://github.com/rust-lang/crates.io-index"
209checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
209checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
210
210
211+[[package]]
212+name = "cfg-if"
213+version = "1.0.0"
214+source = "registry+https://github.com/rust-lang/crates.io-index"
215+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
216+
211[[package]]
217[[package]]
212name = "chrono"
218name = "chrono"
213version = "0.4.19"
219version = "0.4.19"
@@ -267,15 +273,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
267checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
273checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
268dependencies = [
274dependencies = [
269 "autocfg",
275 "autocfg",
270− "cfg-if",
276+ "cfg-if 0.1.10",
271 "lazy_static",
277 "lazy_static",
272]
278]
273
279
274[[package]]
280[[package]]
275name = "crossterm"
281name = "crossterm"
276−version = "0.18.0"
282+version = "0.18.1"
277source = "registry+https://github.com/rust-lang/crates.io-index"
283source = "registry+https://github.com/rust-lang/crates.io-index"
278−checksum = "c2fcdc3c9cf8ee446222e8ee8691a6d21b563b8fe1a64b1873080db7b5b23cf0"
284+checksum = "cef9149b29071d44c9fb98fd9c27fcf74405bbdb761889ad6a03f36be93b0b15"
279dependencies = [
285dependencies = [
280 "bitflags",
286 "bitflags",
281 "crossterm_winapi",
287 "crossterm_winapi",
@@ -290,9 +296,9 @@ dependencies = [
290
296
291[[package]]
297[[package]]
292name = "crossterm_winapi"
298name = "crossterm_winapi"
293−version = "0.6.1"
299+version = "0.6.2"
294source = "registry+https://github.com/rust-lang/crates.io-index"
300source = "registry+https://github.com/rust-lang/crates.io-index"
295−checksum = "057b7146d02fb50175fd7dbe5158f6097f33d02831f43b4ee8ae4ddf67b68f5c"
301+checksum = "c2265c3f8e080075d9b6417aa72293fc71662f34b4af2612d8d1b074d29510db"
296dependencies = [
302dependencies = [
297 "winapi",
303 "winapi",
298]
304]
@@ -303,7 +309,7 @@ version = "2.0.2"
303source = "registry+https://github.com/rust-lang/crates.io-index"
309source = "registry+https://github.com/rust-lang/crates.io-index"
304checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3"
310checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3"
305dependencies = [
311dependencies = [
306− "cfg-if",
312+ "cfg-if 0.1.10",
307 "dirs-sys",
313 "dirs-sys",
308]
314]
309
315
@@ -360,15 +366,15 @@ checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed"
360
366
361[[package]]
367[[package]]
362name = "futures-core"
368name = "futures-core"
363−version = "0.3.6"
369+version = "0.3.7"
364source = "registry+https://github.com/rust-lang/crates.io-index"
370source = "registry+https://github.com/rust-lang/crates.io-index"
365−checksum = "d674eaa0056896d5ada519900dbf97ead2e46a7b6621e8160d79e2f2e1e2784b"
371+checksum = "18eaa56102984bed2c88ea39026cff3ce3b4c7f508ca970cedf2450ea10d4e46"
366
372
367[[package]]
373[[package]]
368name = "futures-io"
374name = "futures-io"
369−version = "0.3.6"
375+version = "0.3.7"
370source = "registry+https://github.com/rust-lang/crates.io-index"
376source = "registry+https://github.com/rust-lang/crates.io-index"
371−checksum = "5fc94b64bb39543b4e432f1790b6bf18e3ee3b74653c5449f63310e9a74b123c"
377+checksum = "6e1798854a4727ff944a7b12aa999f58ce7aa81db80d2dfaaf2ba06f065ddd2b"
372
378
373[[package]]
379[[package]]
374name = "futures-lite"
380name = "futures-lite"
@@ -387,9 +393,9 @@ dependencies = [
387
393
388[[package]]
394[[package]]
389name = "futures-macro"
395name = "futures-macro"
390−version = "0.3.6"
396+version = "0.3.7"
391source = "registry+https://github.com/rust-lang/crates.io-index"
397source = "registry+https://github.com/rust-lang/crates.io-index"
392−checksum = "f57ed14da4603b2554682e9f2ff3c65d7567b53188db96cb71538217fc64581b"
398+checksum = "e36fccf3fc58563b4a14d265027c627c3b665d7fed489427e88e7cc929559efe"
393dependencies = [
399dependencies = [
394 "proc-macro-hack",
400 "proc-macro-hack",
395 "proc-macro2",
401 "proc-macro2",
@@ -399,18 +405,18 @@ dependencies = [
399
405
400[[package]]
406[[package]]
401name = "futures-task"
407name = "futures-task"
402−version = "0.3.6"
408+version = "0.3.7"
403source = "registry+https://github.com/rust-lang/crates.io-index"
409source = "registry+https://github.com/rust-lang/crates.io-index"
404−checksum = "4dd26820a9f3637f1302da8bceba3ff33adbe53464b54ca24d4e2d4f1db30f94"
410+checksum = "96d502af37186c4fef99453df03e374683f8a1eec9dcc1e66b3b82dc8278ce3c"
405dependencies = [
411dependencies = [
406 "once_cell",
412 "once_cell",
407]
413]
408
414
409[[package]]
415[[package]]
410name = "futures-util"
416name = "futures-util"
411−version = "0.3.6"
417+version = "0.3.7"
412source = "registry+https://github.com/rust-lang/crates.io-index"
418source = "registry+https://github.com/rust-lang/crates.io-index"
413−checksum = "8a894a0acddba51a2d49a6f4263b1e64b8c579ece8af50fa86503d52cd1eea34"
419+checksum = "abcb44342f62e6f3e8ac427b8aa815f724fd705dfad060b18ac7866c15bb8e34"
414dependencies = [
420dependencies = [
415 "futures-core",
421 "futures-core",
416 "futures-macro",
422 "futures-macro",
@@ -428,7 +434,7 @@ version = "0.1.15"
428source = "registry+https://github.com/rust-lang/crates.io-index"
434source = "registry+https://github.com/rust-lang/crates.io-index"
429checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
435checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
430dependencies = [
436dependencies = [
431− "cfg-if",
437+ "cfg-if 0.1.10",
432 "libc",
438 "libc",
433 "wasi 0.9.0+wasi-snapshot-preview1",
439 "wasi 0.9.0+wasi-snapshot-preview1",
434]
440]
@@ -553,11 +559,11 @@ dependencies = [
553
559
554[[package]]
560[[package]]
555name = "instant"
561name = "instant"
556−version = "0.1.7"
562+version = "0.1.8"
557source = "registry+https://github.com/rust-lang/crates.io-index"
563source = "registry+https://github.com/rust-lang/crates.io-index"
558−checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66"
564+checksum = "cb1fc4429a33e1f80d41dc9fea4d108a88bec1de8053878898ae448a0b52f613"
559dependencies = [
565dependencies = [
560− "cfg-if",
566+ "cfg-if 1.0.0",
561]
567]
562
568
563[[package]]
569[[package]]
@@ -596,9 +602,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
596
602
597[[package]]
603[[package]]
598name = "libc"
604name = "libc"
599−version = "0.2.79"
605+version = "0.2.80"
600source = "registry+https://github.com/rust-lang/crates.io-index"
606source = "registry+https://github.com/rust-lang/crates.io-index"
601−checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743"
607+checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614"
602
608
603[[package]]
609[[package]]
604name = "lock_api"
610name = "lock_api"
@@ -615,14 +621,14 @@ version = "0.4.11"
615source = "registry+https://github.com/rust-lang/crates.io-index"
621source = "registry+https://github.com/rust-lang/crates.io-index"
616checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
622checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
617dependencies = [
623dependencies = [
618− "cfg-if",
624+ "cfg-if 0.1.10",
619]
625]
620
626
621[[package]]
627[[package]]
622name = "lsp-types"
628name = "lsp-types"
623−version = "0.82.0"
629+version = "0.83.0"
624source = "registry+https://github.com/rust-lang/crates.io-index"
630source = "registry+https://github.com/rust-lang/crates.io-index"
625−checksum = "db895abb8527cf59e3de893ab2acf52cf904faeb65e60ea6f373e11fe86464e8"
631+checksum = "25e0bd4b95038f2c23bda332ba0ca684e8dda765db1f9bdb63dc4c3e01f3b456"
626dependencies = [
632dependencies = [
627 "base64",
633 "base64",
628 "bitflags",
634 "bitflags",
@@ -691,9 +697,9 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
691
697
692[[package]]
698[[package]]
693name = "ntapi"
699name = "ntapi"
694−version = "0.3.4"
700+version = "0.3.6"
695source = "registry+https://github.com/rust-lang/crates.io-index"
701source = "registry+https://github.com/rust-lang/crates.io-index"
696−checksum = "7a31937dea023539c72ddae0e3571deadc1414b300483fa7aaec176168cfa9d2"
702+checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
697dependencies = [
703dependencies = [
698 "winapi",
704 "winapi",
699]
705]
@@ -762,7 +768,7 @@ version = "0.8.0"
762source = "registry+https://github.com/rust-lang/crates.io-index"
768source = "registry+https://github.com/rust-lang/crates.io-index"
763checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
769checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
764dependencies = [
770dependencies = [
765− "cfg-if",
771+ "cfg-if 0.1.10",
766 "cloudabi",
772 "cloudabi",
767 "instant",
773 "instant",
768 "libc",
774 "libc",
@@ -785,18 +791,18 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
785
791
786[[package]]
792[[package]]
787name = "pin-project"
793name = "pin-project"
788−version = "0.4.27"
794+version = "1.0.1"
789source = "registry+https://github.com/rust-lang/crates.io-index"
795source = "registry+https://github.com/rust-lang/crates.io-index"
790−checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15"
796+checksum = "ee41d838744f60d959d7074e3afb6b35c7456d0f61cad38a24e35e6553f73841"
791dependencies = [
797dependencies = [
792 "pin-project-internal",
798 "pin-project-internal",
793]
799]
794
800
795[[package]]
801[[package]]
796name = "pin-project-internal"
802name = "pin-project-internal"
797−version = "0.4.27"
803+version = "1.0.1"
798source = "registry+https://github.com/rust-lang/crates.io-index"
804source = "registry+https://github.com/rust-lang/crates.io-index"
799−checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895"
805+checksum = "81a4ffa594b66bff340084d4081df649a7dc049ac8d7fc458d8e628bfbbb2f86"
800dependencies = [
806dependencies = [
801 "proc-macro2",
807 "proc-macro2",
802 "quote",
808 "quote",
@@ -821,7 +827,7 @@ version = "2.0.2"
821source = "registry+https://github.com/rust-lang/crates.io-index"
827source = "registry+https://github.com/rust-lang/crates.io-index"
822checksum = "a2a7bc6b2a29e632e45451c941832803a18cce6781db04de8a04696cdca8bde4"
828checksum = "a2a7bc6b2a29e632e45451c941832803a18cce6781db04de8a04696cdca8bde4"
823dependencies = [
829dependencies = [
824− "cfg-if",
830+ "cfg-if 0.1.10",
825 "libc",
831 "libc",
826 "log",
832 "log",
827 "wepoll-sys",
833 "wepoll-sys",
@@ -1034,7 +1040,7 @@ version = "0.3.15"
1034source = "registry+https://github.com/rust-lang/crates.io-index"
1040source = "registry+https://github.com/rust-lang/crates.io-index"
1035checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44"
1041checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44"
1036dependencies = [
1042dependencies = [
1037− "cfg-if",
1043+ "cfg-if 0.1.10",
1038 "libc",
1044 "libc",
1039 "redox_syscall",
1045 "redox_syscall",
1040 "winapi",
1046 "winapi",
@@ -1042,9 +1048,9 @@ dependencies = [
1042
1048
1043[[package]]
1049[[package]]
1044name = "syn"
1050name = "syn"
1045−version = "1.0.46"
1051+version = "1.0.48"
1046source = "registry+https://github.com/rust-lang/crates.io-index"
1052source = "registry+https://github.com/rust-lang/crates.io-index"
1047−checksum = "5ad5de3220ea04da322618ded2c42233d02baca219d6f160a3e9c87cda16c942"
1053+checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac"
1048dependencies = [
1054dependencies = [
1049 "proc-macro2",
1055 "proc-macro2",
1050 "quote",
1056 "quote",
helix-lsp/Cargo.toml+1−1
@@ -10,7 +10,7 @@ edition = "2018"
10helix-core = { path = "../helix-core" }
10helix-core = { path = "../helix-core" }
11helix-view = { path = "../helix-view" }
11helix-view = { path = "../helix-view" }
12
12
13−lsp-types = { version = "0.82", features = ["proposed"] }
13+lsp-types = { version = "0.83", features = ["proposed"] }
14smol = "1.2"
14smol = "1.2"
15url = "2"
15url = "2"
16pathdiff = "0.2"
16pathdiff = "0.2"
helix-lsp/src/client.rs+11−17
@@ -9,6 +9,7 @@ use helix_core::{ChangeSet, Transaction};
9use helix_view::Document;
9use helix_view::Document;
10
10
11// use std::collections::HashMap;
11// use std::collections::HashMap;
12+use std::sync::atomic::{AtomicU64, Ordering};
12
13
13use jsonrpc_core as jsonrpc;
14use jsonrpc_core as jsonrpc;
14use lsp_types as lsp;
15use lsp_types as lsp;
@@ -29,7 +30,7 @@ pub struct Client {
29 outgoing: Sender<Payload>,
30 outgoing: Sender<Payload>,
30 pub incoming: Receiver<Call>,
31 pub incoming: Receiver<Call>,
31
32
32− pub request_counter: u64,
33+ pub request_counter: AtomicU64,
33
34
34 capabilities: Option<lsp::ServerCapabilities>,
35 capabilities: Option<lsp::ServerCapabilities>,
35 // TODO: handle PublishDiagnostics Version
36 // TODO: handle PublishDiagnostics Version
@@ -61,17 +62,16 @@ impl Client {
61 outgoing,
62 outgoing,
62 incoming,
63 incoming,
63
64
64− request_counter: 0,
65+ request_counter: AtomicU64::new(0),
65
66
66 capabilities: None,
67 capabilities: None,
67 // diagnostics: HashMap::new(),
68 // diagnostics: HashMap::new(),
68 }
69 }
69 }
70 }
70
71
71− fn next_request_id(&mut self) -> jsonrpc::Id {
72+ fn next_request_id(&self) -> jsonrpc::Id {
73+ let id = self.request_counter.fetch_add(1, Ordering::Relaxed);
72− let id = jsonrpc::Id::Num(self.request_counter);
74+ jsonrpc::Id::Num(id)
73− self.request_counter += 1;
74− id
75 }
75 }
76
76
77 fn to_params(value: Value) -> Result<jsonrpc::Params> {
77 fn to_params(value: Value) -> Result<jsonrpc::Params> {
@@ -88,10 +88,7 @@ impl Client {
88 }
88 }
89
89
90 /// Execute a RPC request on the language server.
90 /// Execute a RPC request on the language server.
91− pub async fn request<R: lsp::request::Request>(
91+ pub async fn request<R: lsp::request::Request>(&self, params: R::Params) -> Result<R::Result>
92− &mut self,
93− params: R::Params,
94− ) -> Result<R::Result>
95 where
92 where
96 R::Params: serde::Serialize,
93 R::Params: serde::Serialize,
97 R::Result: core::fmt::Debug, // TODO: temporary
94 R::Result: core::fmt::Debug, // TODO: temporary
@@ -128,10 +125,7 @@ impl Client {
128 }
125 }
129
126
130 /// Send a RPC notification to the language server.
127 /// Send a RPC notification to the language server.
131− pub async fn notify<R: lsp::notification::Notification>(
128+ pub async fn notify<R: lsp::notification::Notification>(&self, params: R::Params) -> Result<()>
132− &mut self,
133− params: R::Params,
134− ) -> Result<()>
135 where
129 where
136 R::Params: serde::Serialize,
130 R::Params: serde::Serialize,
137 {
131 {
@@ -153,7 +147,7 @@ impl Client {
153
147
154 /// Reply to a language server RPC call.
148 /// Reply to a language server RPC call.
155 pub async fn reply(
149 pub async fn reply(
156− &mut self,
150+ &self,
157 id: jsonrpc::Id,
151 id: jsonrpc::Id,
158 result: core::result::Result<Value, jsonrpc::Error>,
152 result: core::result::Result<Value, jsonrpc::Error>,
159 ) -> Result<()> {
153 ) -> Result<()> {
@@ -212,11 +206,11 @@ impl Client {
212 Ok(())
206 Ok(())
213 }
207 }
214
208
215− pub async fn shutdown(&mut self) -> Result<()> {
209+ pub async fn shutdown(&self) -> Result<()> {
216 self.request::<lsp::request::Shutdown>(()).await
210 self.request::<lsp::request::Shutdown>(()).await
217 }
211 }
218
212
219− pub async fn exit(&mut self) -> Result<()> {
213+ pub async fn exit(&self) -> Result<()> {
220 self.notify::<lsp::notification::Exit>(()).await
214 self.notify::<lsp::notification::Exit>(()).await
221 }
215 }
222
216
helix-term/src/application.rs+13−10
@@ -8,6 +8,8 @@ use helix_view::{
8 Document, Editor, Theme, View,
8 Document, Editor, Theme, View,
9};
9};
10
10
11+use log::{debug, info};
12+
11use std::{
13use std::{
12 borrow::Cow,
14 borrow::Cow,
13 io::{self, stdout, Stdout, Write},
15 io::{self, stdout, Stdout, Write},
@@ -46,7 +48,7 @@ pub struct Application<'a> {
46
48
47 keymap: Keymaps,
49 keymap: Keymaps,
48 executor: &'a smol::Executor<'a>,
50 executor: &'a smol::Executor<'a>,
49− lsp: helix_lsp::Client,
51+ language_server: helix_lsp::Client,
50}
52}
51
53
52struct Renderer {
54struct Renderer {
@@ -370,7 +372,7 @@ impl<'a> Application<'a> {
370 editor.open(file, terminal.size)?;
372 editor.open(file, terminal.size)?;
371 }
373 }
372
374
373− let lsp = helix_lsp::Client::start(&executor, "rust-analyzer", &[]);
375+ let language_server = helix_lsp::Client::start(&executor, "rust-analyzer", &[]);
374
376
375 let mut app = Self {
377 let mut app = Self {
376 editor,
378 editor,
@@ -381,7 +383,7 @@ impl<'a> Application<'a> {
381 //
383 //
382 keymap: keymap::default(),
384 keymap: keymap::default(),
383 executor,
385 executor,
384− lsp,
386+ language_server,
385 };
387 };
386
388
387 Ok(app)
389 Ok(app)
@@ -415,11 +417,11 @@ impl<'a> Application<'a> {
415 let mut reader = EventStream::new();
417 let mut reader = EventStream::new();
416
418
417 // initialize lsp
419 // initialize lsp
418− let res = self.lsp.initialize().await;
420+ self.language_server.initialize().await.unwrap();
419− let res = self
421+ self.language_server
420− .lsp
421 .text_document_did_open(&self.editor.view().unwrap().doc)
422 .text_document_did_open(&self.editor.view().unwrap().doc)
422− .await;
423+ .await
424+ .unwrap();
423
425
424 self.render();
426 self.render();
425
427
@@ -433,8 +435,8 @@ impl<'a> Application<'a> {
433 event = reader.next().fuse() => {
435 event = reader.next().fuse() => {
434 self.handle_terminal_events(event).await
436 self.handle_terminal_events(event).await
435 }
437 }
436− call = self.lsp.incoming.next().fuse() => {
438+ call = self.language_server.incoming.next().fuse() => {
437− self.handle_lsp_message(call).await
439+ self.handle_language_server_message(call).await
438 }
440 }
439 }
441 }
440 }
442 }
@@ -566,7 +568,7 @@ impl<'a> Application<'a> {
566 };
568 };
567 }
569 }
568
570
569− pub async fn handle_lsp_message(&mut self, call: Option<helix_lsp::Call>) {
571+ pub async fn handle_language_server_message(&mut self, call: Option<helix_lsp::Call>) {
570 use helix_lsp::{Call, Notification};
572 use helix_lsp::{Call, Notification};
571 match call {
573 match call {
572 Some(Call::Notification(helix_lsp::jsonrpc::Notification {
574 Some(Call::Notification(helix_lsp::jsonrpc::Notification {
@@ -605,6 +607,7 @@ impl<'a> Application<'a> {
605
607
606 view.doc.diagnostics = diagnostics;
608 view.doc.diagnostics = diagnostics;
607
609
610+ // TODO: we want to process all the events in queue, then render. publishDiagnostic tends to send a whole bunch of events
608 self.render();
611 self.render();
609 }
612 }
610 }
613 }
helix-view/src/commands.rs+2
@@ -404,6 +404,8 @@ fn append_changes_to_history(view: &mut View) {
404 let old_state = std::mem::replace(&mut view.doc.old_state, view.doc.state.clone());
404 let old_state = std::mem::replace(&mut view.doc.old_state, view.doc.state.clone());
405 // TODO: take transaction by value?
405 // TODO: take transaction by value?
406 view.doc.history.commit_revision(&transaction, &old_state);
406 view.doc.history.commit_revision(&transaction, &old_state);
407+
408+ // TODO: notify LSP of changes
407}
409}
408
410
409pub fn normal_mode(view: &mut View, _count: usize) {
411pub fn normal_mode(view: &mut View, _count: usize) {