mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Remove code duplication
This commit is contained in:
parent
3a839ea22e
commit
b169e1e5de
2 changed files with 7 additions and 18 deletions
|
@ -13,7 +13,8 @@ use syntax::{AstNode, SyntaxKind::*, SyntaxToken, TextRange, T};
|
|||
|
||||
use crate::{
|
||||
hover::hover_for_definition,
|
||||
moniker::{crate_for_file, def_to_moniker, MonikerResult},
|
||||
moniker::{def_to_moniker, MonikerResult},
|
||||
parent_module::crates_for,
|
||||
Analysis, Fold, HoverConfig, HoverDocFormat, HoverResult, InlayHint, InlayHintsConfig,
|
||||
TryToNav,
|
||||
};
|
||||
|
@ -99,7 +100,7 @@ fn all_modules(db: &dyn HirDatabase) -> Vec<Module> {
|
|||
|
||||
impl StaticIndex<'_> {
|
||||
fn add_file(&mut self, file_id: FileId) {
|
||||
let current_crate = crate_for_file(self.db, file_id);
|
||||
let current_crate = crates_for(self.db, file_id).pop().map(Into::into);
|
||||
let folds = self.analysis.folding_ranges(file_id).unwrap();
|
||||
let inlay_hints = self
|
||||
.analysis
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue