Skip to content

Commit c5c332f

Browse files
fmt
1 parent f2ce44c commit c5c332f

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

crates/ide-completion/src/completions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! This module defines an accumulator for completions which are going to be presented to user.
22
33
pub(crate) mod attribute;
4-
pub(crate) mod dot;
54
pub(crate) mod doctest;
5+
pub(crate) mod dot;
66
pub(crate) mod env_vars;
77
pub(crate) mod expr;
88
pub(crate) mod extern_abi;

crates/ide-completion/src/completions/doctest.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ use base_db::{
44
CrateGraphBuilder, DependencyBuilder, LibraryRoots, LocalRoots, SourceDatabase, SourceRoot,
55
all_crates,
66
};
7-
use hir::{
8-
ChangeWithProcMacros, HasAttrs, InFile, Semantics,
9-
db::DefDatabase,
10-
};
7+
use hir::{ChangeWithProcMacros, HasAttrs, InFile, Semantics, db::DefDatabase};
118
use ide_db::{
12-
FxHashMap,
13-
FilePosition, RootDatabase,
9+
FilePosition, FxHashMap, RootDatabase,
1410
defs::Definition,
1511
range_mapper::RangeMapper,
1612
rust_doc::is_rust_fence,
@@ -19,18 +15,15 @@ use ide_db::{
1915
use syntax::{
2016
AstNode, AstToken,
2117
SyntaxKind::{ASSOC_ITEM_LIST, ITEM_LIST, SOURCE_FILE},
22-
SyntaxNode, SyntaxToken, TextRange, TextSize,
23-
ast,
24-
match_ast,
18+
SyntaxNode, SyntaxToken, TextRange, TextSize, ast, match_ast,
2519
};
2620

2721
use crate::{CompletionConfig, CompletionItem};
2822

2923
const RUSTDOC_FENCE_LENGTH: usize = 3;
3024
const RUSTDOC_FENCES: [&str; 2] = ["```", "~~~"];
3125
const DOCTEST_WRAPPER_NAME: &str = "__ra_doctest_completion";
32-
const DOCTEST_WRAPPER_PREFIX: &str =
33-
"\n#[allow(dead_code)]\nfn __ra_doctest_completion() {\n";
26+
const DOCTEST_WRAPPER_PREFIX: &str = "\n#[allow(dead_code)]\nfn __ra_doctest_completion() {\n";
3427
const DOCTEST_WRAPPER_SUFFIX: &str = "\n}\n";
3528

3629
pub(crate) fn complete_doctest(
@@ -44,8 +37,9 @@ pub(crate) fn complete_doctest(
4437
let file = sema.parse(editioned_file_id).syntax().clone();
4538
let token = file.token_at_offset(position.offset).left_biased()?;
4639

47-
let analysis =
48-
hir::attach_db_allow_change(db, || DoctestCompletionAnalysis::new(&sema, position.file_id, token))?;
40+
let analysis = hir::attach_db_allow_change(db, || {
41+
DoctestCompletionAnalysis::new(&sema, position.file_id, token)
42+
})?;
4943
let doctest_offset = analysis.map_offset_down(position.offset)?;
5044

5145
let completions = hir::attach_db_allow_change(&analysis.db, || {

0 commit comments

Comments
 (0)