Skip to content

Commit 9aba735

Browse files
committed
use ls-types instead of lsp-types
1 parent 7fe6f74 commit 9aba735

File tree

4 files changed

+58
-36
lines changed

4 files changed

+58
-36
lines changed

Cargo.lock

Lines changed: 51 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ license = "CECILL-2.1"
1212

1313
[dependencies]
1414
lsp-server = "0.7"
15-
lsp-types = "0.97"
15+
ls-types = "0.0"
1616
serde = "1"
1717
serde_json = "1"
1818

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
55
// TODO: check options for additional ideas <https://github.com/wakatime/wakatime-cli/blob/develop/USAGE.md#ini-config-file>
66

7-
// TODO: implement debounding ourselves to avoid wkcli roundtrips
7+
// TODO: implement debouncing ourselves to avoid wkcli roundtrips
88
// TODO: read wakatime config
99
// TODO: do not log when out of dev folder
1010

11+
use ls_types::{notification::Notification as _, request::Request as _, *};
1112
use lsp_server::{Connection, ExtractError, Message, Notification, Request, RequestId};
12-
use lsp_types::{notification::Notification as _, request::Request as _, *};
1313

1414
/// Open the Wakatime web dashboard in a browser
1515
const OPEN_DASHBOARD_ACTION: &str = "open_dashboard";
@@ -62,7 +62,7 @@ impl LanguageServer {
6262
info.name,
6363
info.version
6464
.as_ref()
65-
.map_or_else(|| "unknown", |version| version),
65+
.map_or_else(|| "unknown", |version| version.as_str()),
6666
// Plugin part
6767
self.user_agent,
6868
// Last part is the one parsed by `wakatime` servers
@@ -254,7 +254,7 @@ type CastResult<Payload, Type> = Result<Result<Payload, Type>, ExtractError<Type
254254

255255
fn try_cast_r<R>(req: Request) -> CastResult<(RequestId, R::Params), Request>
256256
where
257-
R: lsp_types::request::Request,
257+
R: ls_types::request::Request,
258258
R::Params: serde::de::DeserializeOwned,
259259
{
260260
match req.extract(R::METHOD) {
@@ -266,7 +266,7 @@ where
266266

267267
fn try_cast_n<N>(notif: Notification) -> CastResult<N::Params, Notification>
268268
where
269-
N: lsp_types::notification::Notification,
269+
N: ls_types::notification::Notification,
270270
N::Params: serde::de::DeserializeOwned,
271271
{
272272
match notif.extract(N::METHOD) {

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const USAGE: &str = concat!(
1515
);
1616

1717
fn main() -> Result<(), Box<dyn std::error::Error>> {
18-
// Easier to see in editor logs if the current developement version is loaded
18+
// Easier to see in editor logs if the current development version is loaded
1919
#[cfg(debug_assertions)]
2020
eprintln!("DEBUG VERSION");
2121

0 commit comments

Comments
 (0)