mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Code formatting
This commit is contained in:
parent
da7ec4b339
commit
b147e6eb95
3 changed files with 6 additions and 6 deletions
|
@ -14,7 +14,7 @@ use ra_syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, TokenAtOffs
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
display::{macro_label, rust_code_markup, rust_code_markup_with_doc, ShortLabel, ToNav},
|
display::{macro_label, rust_code_markup, rust_code_markup_with_doc, ShortLabel, ToNav},
|
||||||
FilePosition, RangeInfo, NavigationTarget,
|
FilePosition, NavigationTarget, RangeInfo,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
|
@ -308,7 +308,7 @@ mod tests {
|
||||||
|
|
||||||
fn assert_impl_action(action: &HoverAction, position: u32) {
|
fn assert_impl_action(action: &HoverAction, position: u32) {
|
||||||
let offset = match action {
|
let offset = match action {
|
||||||
HoverAction::Implementaion(pos) => pos.offset
|
HoverAction::Implementaion(pos) => pos.offset,
|
||||||
};
|
};
|
||||||
assert_eq!(offset, position.into());
|
assert_eq!(offset, position.into());
|
||||||
}
|
}
|
||||||
|
@ -1161,5 +1161,4 @@ fn func(foo: i32) { if true { <|>foo; }; }
|
||||||
);
|
);
|
||||||
assert_impl_action(&actions[0], 6);
|
assert_impl_action(&actions[0], 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ pub use crate::{
|
||||||
display::{file_structure, FunctionSignature, NavigationTarget, StructureNode},
|
display::{file_structure, FunctionSignature, NavigationTarget, StructureNode},
|
||||||
expand_macro::ExpandedMacro,
|
expand_macro::ExpandedMacro,
|
||||||
folding_ranges::{Fold, FoldKind},
|
folding_ranges::{Fold, FoldKind},
|
||||||
hover::{HoverResult, HoverAction, HoverConfig},
|
hover::{HoverAction, HoverConfig, HoverResult},
|
||||||
inlay_hints::{InlayHint, InlayHintsConfig, InlayKind},
|
inlay_hints::{InlayHint, InlayHintsConfig, InlayKind},
|
||||||
references::{Declaration, Reference, ReferenceAccess, ReferenceKind, ReferenceSearchResult},
|
references::{Declaration, Reference, ReferenceAccess, ReferenceKind, ReferenceSearchResult},
|
||||||
runnables::{Runnable, RunnableKind, TestId},
|
runnables::{Runnable, RunnableKind, TestId},
|
||||||
|
|
|
@ -11,7 +11,7 @@ use std::{ffi::OsString, path::PathBuf};
|
||||||
|
|
||||||
use lsp_types::ClientCapabilities;
|
use lsp_types::ClientCapabilities;
|
||||||
use ra_flycheck::FlycheckConfig;
|
use ra_flycheck::FlycheckConfig;
|
||||||
use ra_ide::{AssistConfig, CompletionConfig, InlayHintsConfig, HoverConfig};
|
use ra_ide::{AssistConfig, CompletionConfig, HoverConfig, InlayHintsConfig};
|
||||||
use ra_project_model::{CargoConfig, JsonProject, ProjectManifest};
|
use ra_project_model::{CargoConfig, JsonProject, ProjectManifest};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
|
@ -342,7 +342,8 @@ impl Config {
|
||||||
|
|
||||||
self.assist.allow_snippets(false);
|
self.assist.allow_snippets(false);
|
||||||
if let Some(experimental) = &caps.experimental {
|
if let Some(experimental) = &caps.experimental {
|
||||||
let get_bool = |index: &str| experimental.get(index).and_then(|it| it.as_bool()) == Some(true);
|
let get_bool =
|
||||||
|
|index: &str| experimental.get(index).and_then(|it| it.as_bool()) == Some(true);
|
||||||
|
|
||||||
let snippet_text_edit = get_bool("snippetTextEdit");
|
let snippet_text_edit = get_bool("snippetTextEdit");
|
||||||
self.assist.allow_snippets(snippet_text_edit);
|
self.assist.allow_snippets(snippet_text_edit);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue