Skip to content

Commit 42df7cc

Browse files
bors[bot]kjeremy
andauthored
Merge #6313
6313: Latest proposed LSP 3.16.0 and refresh semantic tokens r=matklad a=kjeremy Needs: gluon-lang/lsp-types#183 Co-authored-by: kjeremy <[email protected]> Co-authored-by: Jeremy A. Kolb <[email protected]>
2 parents a0f1346 + 8982c06 commit 42df7cc

21 files changed

+77
-24
lines changed

Cargo.lock

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

crates/rust-analyzer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env_logger = { version = "0.8.1", default-features = false }
2121
itertools = "0.9.0"
2222
jod-thread = "0.1.0"
2323
log = "0.4.8"
24-
lsp-types = { version = "0.82.0", features = ["proposed"] }
24+
lsp-types = { version = "0.83.0", features = ["proposed"] }
2525
parking_lot = "0.11.0"
2626
pico-args = "0.3.1"
2727
oorandom = "11.1.2"

crates/rust-analyzer/src/caps.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub fn server_capabilities(client_caps: &ClientCapabilities) -> ServerCapabiliti
4848
references_provider: Some(OneOf::Left(true)),
4949
document_highlight_provider: Some(OneOf::Left(true)),
5050
document_symbol_provider: Some(OneOf::Left(true)),
51-
workspace_symbol_provider: Some(true),
51+
workspace_symbol_provider: Some(OneOf::Left(true)),
5252
code_action_provider: Some(code_action_provider),
5353
code_lens_provider: Some(CodeLensOptions { resolve_provider: Some(true) }),
5454
document_formatting_provider: Some(OneOf::Left(true)),
@@ -113,6 +113,7 @@ fn code_action_capabilities(client_caps: &ClientCapabilities) -> CodeActionProvi
113113
CodeActionKind::REFACTOR_INLINE,
114114
CodeActionKind::REFACTOR_REWRITE,
115115
]),
116+
resolve_provider: None,
116117
work_done_progress_options: Default::default(),
117118
})
118119
})

crates/rust-analyzer/src/config.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub struct Config {
4747
pub call_info_full: bool,
4848
pub lens: LensConfig,
4949
pub hover: HoverConfig,
50+
pub semantic_tokens_refresh: bool,
5051

5152
pub with_sysroot: bool,
5253
pub linked_projects: Vec<LinkedProject>,
@@ -193,6 +194,7 @@ impl Config {
193194
call_info_full: true,
194195
lens: LensConfig::default(),
195196
hover: HoverConfig::default(),
197+
semantic_tokens_refresh: false,
196198
linked_projects: Vec::new(),
197199
root_path,
198200
}
@@ -402,6 +404,14 @@ impl Config {
402404
self.client_caps.hover_actions = get_bool("hoverActions");
403405
self.client_caps.status_notification = get_bool("statusNotification");
404406
}
407+
408+
if let Some(workspace_caps) = caps.workspace.as_ref() {
409+
if let Some(refresh_support) =
410+
workspace_caps.semantic_tokens.as_ref().and_then(|it| it.refresh_support)
411+
{
412+
self.semantic_tokens_refresh = refresh_support;
413+
}
414+
}
405415
}
406416
}
407417

crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"trivially_copy_pass_by_ref",
2121
),
2222
),
23+
code_description: None,
2324
source: Some(
2425
"clippy",
2526
),
@@ -61,6 +62,7 @@
6162
],
6263
),
6364
tags: None,
65+
data: None,
6466
},
6567
fixes: [],
6668
},

crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
"E0277",
2121
),
2222
),
23+
code_description: None,
2324
source: Some(
2425
"rustc",
2526
),
2627
message: "can\'t compare `{integer}` with `&str`\nthe trait `std::cmp::PartialEq<&str>` is not implemented for `{integer}`",
2728
related_information: None,
2829
tags: None,
30+
data: None,
2931
},
3032
fixes: [],
3133
},

crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
Error,
1717
),
1818
code: None,
19+
code_description: None,
1920
source: Some(
2021
"rustc",
2122
),
@@ -41,6 +42,7 @@
4142
],
4243
),
4344
tags: None,
45+
data: None,
4446
},
4547
fixes: [],
4648
},
@@ -61,6 +63,7 @@
6163
Error,
6264
),
6365
code: None,
66+
code_description: None,
6467
source: Some(
6568
"rustc",
6669
),
@@ -86,6 +89,7 @@
8689
],
8790
),
8891
tags: None,
92+
data: None,
8993
},
9094
fixes: [],
9195
},

crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
"E0053",
2121
),
2222
),
23+
code_description: None,
2324
source: Some(
2425
"rustc",
2526
),
2627
message: "method `next` has an incompatible type for trait\nexpected type `fn(&mut ty::list_iter::ListIterator<\'list, M>) -> std::option::Option<&ty::Ref<M>>`\n found type `fn(&ty::list_iter::ListIterator<\'list, M>) -> std::option::Option<&\'list ty::Ref<M>>`",
2728
related_information: None,
2829
tags: None,
30+
data: None,
2931
},
3032
fixes: [],
3133
},

crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
"E0308",
2121
),
2222
),
23+
code_description: None,
2324
source: Some(
2425
"rustc",
2526
),
2627
message: "mismatched types\nexpected usize, found u32",
2728
related_information: None,
2829
tags: None,
30+
data: None,
2931
},
3032
fixes: [],
3133
},

crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"unused_variables",
2121
),
2222
),
23+
code_description: None,
2324
source: Some(
2425
"rustc",
2526
),
@@ -30,6 +31,7 @@
3031
Unnecessary,
3132
],
3233
),
34+
data: None,
3335
},
3436
fixes: [
3537
CodeAction {

0 commit comments

Comments
 (0)