code formatting

This commit is contained in:
vsrs 2020-05-17 20:38:50 +03:00
parent dec2f3fa65
commit 3d445256fe
3 changed files with 22 additions and 20 deletions

View file

@ -244,35 +244,35 @@ impl Config {
pub fn update_caps(&mut self, caps: &ClientCapabilities) {
if let Some(doc_caps) = caps.text_document.as_ref() {
if let Some(value) = doc_caps.definition.as_ref().and_then(|it| it.link_support) {
self.client_caps.location_link = value;
}
self.client_caps.location_link = value;
}
if let Some(value) = doc_caps.folding_range.as_ref().and_then(|it| it.line_folding_only)
{
self.client_caps.line_folding_only = value
}
self.client_caps.line_folding_only = value
}
if let Some(value) = doc_caps
.document_symbol
.as_ref()
.and_then(|it| it.hierarchical_document_symbol_support)
{
self.client_caps.hierarchical_symbols = value
}
{
self.client_caps.hierarchical_symbols = value
}
if let Some(value) = doc_caps
.code_action
.as_ref()
.and_then(|it| Some(it.code_action_literal_support.is_some()))
{
self.client_caps.code_action_literals = value;
}
self.completion.allow_snippets(false);
{
self.client_caps.code_action_literals = value;
}
self.completion.allow_snippets(false);
if let Some(completion) = &doc_caps.completion {
if let Some(completion_item) = &completion.completion_item {
if let Some(value) = completion_item.snippet_support {
self.completion.allow_snippets(value);
if let Some(completion_item) = &completion.completion_item {
if let Some(value) = completion_item.snippet_support {
self.completion.allow_snippets(value);
}
}
}
}
}
if let Some(window_caps) = caps.window.as_ref() {
if let Some(value) = window_caps.work_done_progress {

View file

@ -826,16 +826,18 @@ pub fn handle_code_lens(
if world.config.lens.runnable() {
// Gather runnables
for runnable in world.analysis().runnables(file_id)? {
let (run_title, debugee ) = match &runnable.kind {
RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => ("▶️\u{fe0e}Run Test", true),
RunnableKind::DocTest { .. } => {
let (run_title, debugee) = match &runnable.kind {
RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => {
("▶️\u{fe0e}Run Test", true)
}
RunnableKind::DocTest { .. } => {
// cargo does not support -no-run for doctests
("▶️\u{fe0e}Run Doctest", false)
}
RunnableKind::Bench { .. } => {
// Nothing wrong with bench debugging
("Run Bench", true)
},
}
RunnableKind::Bin => {
// Do not suggest binary run on other target than binary
match &cargo_spec {

View file

@ -40,7 +40,7 @@ async function selectRunnable(ctx: Ctx, prevRunnable?: RunnableQuickPick, debugg
items.push(new RunnableQuickPick(r));
}
if( items.length === 0 ) {
if (items.length === 0) {
// it is the debug case, run always has at least 'cargo check ...'
// see crates\rust-analyzer\src\main_loop\handlers.rs, handle_runnables
vscode.window.showErrorMessage("There's no debug target!");