Skip to content

Commit 3d44525

Browse files
committed
code formatting
1 parent dec2f3f commit 3d44525

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -244,35 +244,35 @@ impl Config {
244244
pub fn update_caps(&mut self, caps: &ClientCapabilities) {
245245
if let Some(doc_caps) = caps.text_document.as_ref() {
246246
if let Some(value) = doc_caps.definition.as_ref().and_then(|it| it.link_support) {
247-
self.client_caps.location_link = value;
248-
}
247+
self.client_caps.location_link = value;
248+
}
249249
if let Some(value) = doc_caps.folding_range.as_ref().and_then(|it| it.line_folding_only)
250250
{
251-
self.client_caps.line_folding_only = value
252-
}
251+
self.client_caps.line_folding_only = value
252+
}
253253
if let Some(value) = doc_caps
254254
.document_symbol
255255
.as_ref()
256256
.and_then(|it| it.hierarchical_document_symbol_support)
257-
{
258-
self.client_caps.hierarchical_symbols = value
259-
}
257+
{
258+
self.client_caps.hierarchical_symbols = value
259+
}
260260
if let Some(value) = doc_caps
261261
.code_action
262262
.as_ref()
263263
.and_then(|it| Some(it.code_action_literal_support.is_some()))
264-
{
265-
self.client_caps.code_action_literals = value;
266-
}
267-
self.completion.allow_snippets(false);
264+
{
265+
self.client_caps.code_action_literals = value;
266+
}
267+
self.completion.allow_snippets(false);
268268
if let Some(completion) = &doc_caps.completion {
269-
if let Some(completion_item) = &completion.completion_item {
270-
if let Some(value) = completion_item.snippet_support {
271-
self.completion.allow_snippets(value);
269+
if let Some(completion_item) = &completion.completion_item {
270+
if let Some(value) = completion_item.snippet_support {
271+
self.completion.allow_snippets(value);
272+
}
272273
}
273274
}
274275
}
275-
}
276276

277277
if let Some(window_caps) = caps.window.as_ref() {
278278
if let Some(value) = window_caps.work_done_progress {

crates/rust-analyzer/src/main_loop/handlers.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,16 +826,18 @@ pub fn handle_code_lens(
826826
if world.config.lens.runnable() {
827827
// Gather runnables
828828
for runnable in world.analysis().runnables(file_id)? {
829-
let (run_title, debugee ) = match &runnable.kind {
830-
RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => ("▶️\u{fe0e}Run Test", true),
831-
RunnableKind::DocTest { .. } => {
829+
let (run_title, debugee) = match &runnable.kind {
830+
RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => {
831+
("▶️\u{fe0e}Run Test", true)
832+
}
833+
RunnableKind::DocTest { .. } => {
832834
// cargo does not support -no-run for doctests
833835
("▶️\u{fe0e}Run Doctest", false)
834836
}
835837
RunnableKind::Bench { .. } => {
836838
// Nothing wrong with bench debugging
837839
("Run Bench", true)
838-
},
840+
}
839841
RunnableKind::Bin => {
840842
// Do not suggest binary run on other target than binary
841843
match &cargo_spec {

editors/code/src/commands/runnables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function selectRunnable(ctx: Ctx, prevRunnable?: RunnableQuickPick, debugg
4040
items.push(new RunnableQuickPick(r));
4141
}
4242

43-
if( items.length === 0 ) {
43+
if (items.length === 0) {
4444
// it is the debug case, run always has at least 'cargo check ...'
4545
// see crates\rust-analyzer\src\main_loop\handlers.rs, handle_runnables
4646
vscode.window.showErrorMessage("There's no debug target!");

0 commit comments

Comments
 (0)