diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-08-24 01:21:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-24 01:21:21 +0100 |
commit | 2ab4afc6b8e90f1315e0727c9b9c714c3667dc45 (patch) | |
tree | 05f07ba22d5d4a5f5120ab988320ad88ea20d542 /cli/bench | |
parent | bbd3a7e637b0223647405adf76b23092ab957157 (diff) |
refactor(lsp): changes for lsp_types 0.97.0 (#25169)
Diffstat (limited to 'cli/bench')
-rw-r--r-- | cli/bench/lsp.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cli/bench/lsp.rs b/cli/bench/lsp.rs index f2070eb21..b088865c6 100644 --- a/cli/bench/lsp.rs +++ b/cli/bench/lsp.rs @@ -4,9 +4,10 @@ use deno_core::serde::Deserialize; use deno_core::serde_json; use deno_core::serde_json::json; use deno_core::serde_json::Value; -use deno_core::url::Url; +use lsp_types::Uri; use std::collections::HashMap; use std::path::Path; +use std::str::FromStr; use std::time::Duration; use test_util::lsp::LspClientBuilder; use test_util::PathRef; @@ -91,7 +92,7 @@ fn bench_deco_apps_edits(deno_exe: &Path) -> Duration { .build(); client.initialize(|c| { c.set_workspace_folders(vec![lsp_types::WorkspaceFolder { - uri: Url::from_file_path(&apps).unwrap(), + uri: apps.uri_dir(), name: "apps".to_string(), }]); c.set_deno_enable(true); @@ -283,7 +284,7 @@ fn bench_find_replace(deno_exe: &Path) -> Duration { "textDocument/didChange", lsp::DidChangeTextDocumentParams { text_document: lsp::VersionedTextDocumentIdentifier { - uri: Url::parse(&file_name).unwrap(), + uri: Uri::from_str(&file_name).unwrap(), version: 2, }, content_changes: vec![lsp::TextDocumentContentChangeEvent { @@ -310,7 +311,7 @@ fn bench_find_replace(deno_exe: &Path) -> Duration { "textDocument/formatting", lsp::DocumentFormattingParams { text_document: lsp::TextDocumentIdentifier { - uri: Url::parse(&file_name).unwrap(), + uri: Uri::from_str(&file_name).unwrap(), }, options: lsp::FormattingOptions { tab_size: 2, |