mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Remove dead code
This commit is contained in:
parent
7a39bc3ba2
commit
0aece75cdd
8 changed files with 40 additions and 55 deletions
|
@ -163,10 +163,7 @@ pub fn analysis_stats(
|
|||
if let Ok(src) = src {
|
||||
let original_file = src.file_id.original_file(db);
|
||||
let line_index = host.analysis().file_line_index(original_file).unwrap();
|
||||
let text_range = src.value.either(
|
||||
|it| it.syntax_node_ptr().range(),
|
||||
|it| it.syntax_node_ptr().range(),
|
||||
);
|
||||
let text_range = src.value.syntax_node_ptr().range();
|
||||
let (start, end) = (
|
||||
line_index.line_col(text_range.start()),
|
||||
line_index.line_col(text_range.end()),
|
||||
|
@ -192,12 +189,7 @@ pub fn analysis_stats(
|
|||
// FIXME: it might be nice to have a function (on Analysis?) that goes from Source<T> -> (LineCol, LineCol) directly
|
||||
// But also, we should just turn the type mismatches into diagnostics and provide these
|
||||
let root = db.parse_or_expand(src.file_id).unwrap();
|
||||
let node = src.map(|e| {
|
||||
e.either(
|
||||
|p| p.to_node(&root).syntax().clone(),
|
||||
|p| p.to_node(&root).syntax().clone(),
|
||||
)
|
||||
});
|
||||
let node = src.map(|e| e.to_node(&root).syntax().clone());
|
||||
let original_range = original_range(db, node.as_ref());
|
||||
let path = db.file_relative_path(original_range.file_id);
|
||||
let line_index =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue