Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(cli/lsp): migrate from lspower back to tower-lsp #14059

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
98bbf95
WIP
CGQAQ Mar 21, 2022
b6a0f2b
format
CGQAQ Mar 21, 2022
6a9581a
maybe use execute_command to replace request_else?
CGQAQ Mar 21, 2022
734d46b
fix tests
CGQAQ Mar 21, 2022
45e522e
fix tests
CGQAQ Mar 21, 2022
d062da6
fix tests
CGQAQ Mar 21, 2022
8e464ef
fix tests, again
CGQAQ Mar 21, 2022
99965d7
Update cli/bench/lsp.rs
CGQAQ Mar 21, 2022
279c7ff
Update cli/lsp/analysis.rs
CGQAQ Mar 21, 2022
f4eb740
Update cli/lsp/client.rs
CGQAQ Mar 21, 2022
a3d1f4d
Update cli/lsp/code_lens.rs
CGQAQ Mar 21, 2022
779b1e5
Update cli/lsp/completions.rs
CGQAQ Mar 21, 2022
fe8a5ae
Update cli/tests/integration/lsp_tests.rs
CGQAQ Mar 21, 2022
22e221a
Update cli/tests/integration/lsp_tests.rs
CGQAQ Mar 21, 2022
df92968
Update cli/lsp/config.rs
CGQAQ Mar 21, 2022
ff51a93
Update cli/lsp/documents.rs
CGQAQ Mar 21, 2022
25b30a7
Update cli/lsp/lsp_custom.rs
CGQAQ Mar 21, 2022
556584b
Update cli/lsp/refactor.rs
CGQAQ Mar 21, 2022
023f911
Update cli/lsp/registries.rs
CGQAQ Mar 21, 2022
8e4d9c9
Update cli/lsp/text.rs
CGQAQ Mar 21, 2022
bba7786
Update cli/lsp/tsc.rs
CGQAQ Mar 21, 2022
5ff13c3
revert some changes
CGQAQ Mar 21, 2022
49fb703
Merge branch 'tower-lsp' of github.com:CGQAQ/deno into tower-lsp
CGQAQ Mar 21, 2022
c9d57e6
revert all changes from lsp to lsp_types
CGQAQ Mar 21, 2022
32c1027
revert all changes from lsp to lsp_types
CGQAQ Mar 21, 2022
9c8a47f
Merge branch 'main' into tower-lsp
bartlomieju Mar 29, 2022
eb84f2e
update tokio-util
bartlomieju Mar 29, 2022
cd12224
change tower-lsp from 0.15.1 to 0.16.0
CGQAQ Mar 29, 2022
1d653ce
Merge remote-tracking branch 'origin/tower-lsp' into tower-lsp
CGQAQ Mar 29, 2022
076c48c
change tower-lsp from 0.15.1 to 0.16.0
CGQAQ Mar 29, 2022
811322e
fix build error
CGQAQ Mar 29, 2022
ed45ce3
format
CGQAQ Mar 29, 2022
6207878
fix lint
CGQAQ Mar 29, 2022
6ef097d
fix tests
CGQAQ Mar 29, 2022
ca4759f
retrigger ci
CGQAQ Mar 29, 2022
455a670
fix bench
CGQAQ Mar 29, 2022
2a5c737
Revert "fix bench"
CGQAQ Mar 30, 2022
017f8cf
ignore null value
CGQAQ Mar 30, 2022
4096a9f
Merge branch 'main' into tower-lsp
CGQAQ Mar 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
256 changes: 175 additions & 81 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ import_map = "=0.9.0"
jsonc-parser = { version = "=0.19.0", features = ["serde"] }
libc = "=0.2.106"
log = { version = "=0.4.14", features = ["serde"] }
lspower = "=1.4.0"
node_resolver = "=0.1.1"
notify = "=5.0.0-pre.12"
num-format = "=0.4.0"
Expand All @@ -95,6 +94,7 @@ text-size = "=1.1.0"
text_lines = "=0.4.1"
tokio = { version = "=1.14", features = ["full"] }
tokio-util = "=0.6.9"
tower-lsp = "=0.15.1"
typed-arena = "2.0.1"
uuid = { version = "=0.8.2", features = ["v4", "serde"] }
walkdir = "=2.3.2"
Expand Down
24 changes: 12 additions & 12 deletions cli/bench/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use deno_core::serde_json;
use deno_core::serde_json::json;
use deno_core::serde_json::Value;
use deno_core::url::Url;
use lspower::lsp;
use std::collections::HashMap;
use std::path::Path;
use std::time::Duration;
use test_util::lsp::LspClient;
use test_util::lsp::LspResponseError;
use tower_lsp::lsp_types;
CGQAQ marked this conversation as resolved.
Show resolved Hide resolved

static FIXTURE_CODE_LENS_TS: &str = include_str!("testdata/code_lens.ts");
static FIXTURE_DB_TS: &str = include_str!("testdata/db.ts");
Expand Down Expand Up @@ -163,7 +163,7 @@ fn bench_code_lens(deno_exe: &Path) -> Result<Duration, AnyError> {
assert_eq!(method, "textDocument/publishDiagnostics");

let (maybe_res, maybe_err) = client
.write_request::<_, _, Vec<lsp::CodeLens>>(
.write_request::<_, _, Vec<lsp_types::CodeLens>>(
"textDocument/codeLens",
json!({
"textDocument": {
Expand All @@ -179,7 +179,7 @@ fn bench_code_lens(deno_exe: &Path) -> Result<Duration, AnyError> {

for code_lens in res {
let (maybe_res, maybe_err) = client
.write_request::<_, _, lsp::CodeLens>("codeLens/resolve", code_lens)
.write_request::<_, _, lsp_types::CodeLens>("codeLens/resolve", code_lens)
.unwrap();
assert!(maybe_err.is_none());
assert!(maybe_res.is_some());
Expand Down Expand Up @@ -226,18 +226,18 @@ fn bench_find_replace(deno_exe: &Path) -> Result<Duration, AnyError> {
let file_name = format!("file:///a/file_{}.ts", i);
client.write_notification(
"textDocument/didChange",
lsp::DidChangeTextDocumentParams {
text_document: lsp::VersionedTextDocumentIdentifier {
lsp_types::DidChangeTextDocumentParams {
text_document: lsp_types::VersionedTextDocumentIdentifier {
uri: Url::parse(&file_name).unwrap(),
version: 2,
},
content_changes: vec![lsp::TextDocumentContentChangeEvent {
range: Some(lsp::Range {
start: lsp::Position {
content_changes: vec![lsp_types::TextDocumentContentChangeEvent {
range: Some(lsp_types::Range {
start: lsp_types::Position {
line: 0,
character: 13,
},
end: lsp::Position {
end: lsp_types::Position {
line: 0,
character: 16,
},
Expand All @@ -253,11 +253,11 @@ fn bench_find_replace(deno_exe: &Path) -> Result<Duration, AnyError> {
let file_name = format!("file:///a/file_{}.ts", i);
let (maybe_res, maybe_err) = client.write_request::<_, _, Value>(
"textDocument/formatting",
lsp::DocumentFormattingParams {
text_document: lsp::TextDocumentIdentifier {
lsp_types::DocumentFormattingParams {
text_document: lsp_types::TextDocumentIdentifier {
uri: Url::parse(&file_name).unwrap(),
},
options: lsp::FormattingOptions {
options: lsp_types::FormattingOptions {
tab_size: 2,
insert_spaces: true,
..Default::default()
Expand Down
Loading