display Doctest code lens before comment #4785
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
parent
36d9105d0e
commit
2732fdb595
@ -4,7 +4,6 @@
|
||||
use hir::{original_range, AssocItem, FieldSource, HasSource, InFile, ModuleSource};
|
||||
use ra_db::{FileId, SourceDatabase};
|
||||
use ra_ide_db::{defs::Definition, RootDatabase};
|
||||
use ra_syntax::ast::AstToken;
|
||||
use ra_syntax::{
|
||||
ast::{self, DocCommentsOwner, NameOwner},
|
||||
match_ast, AstNode, SmolStr,
|
||||
@ -159,13 +158,12 @@ pub(crate) fn from_doc_commented(
|
||||
) -> NavigationTarget {
|
||||
let name =
|
||||
named.value.name().map(|it| it.text().clone()).unwrap_or_else(|| SmolStr::new("_"));
|
||||
let focus_range = node.value.doc_comments().next().map(|it| it.syntax().text_range());
|
||||
let frange = original_range(db, node.map(|it| it.syntax()));
|
||||
|
||||
NavigationTarget::from_syntax(
|
||||
frange.file_id,
|
||||
name,
|
||||
focus_range,
|
||||
None,
|
||||
frange.range,
|
||||
node.value.syntax().kind(),
|
||||
)
|
||||
|
@ -427,9 +427,7 @@ fn foo() {}
|
||||
full_range: 22..64,
|
||||
name: "foo",
|
||||
kind: FN_DEF,
|
||||
focus_range: Some(
|
||||
22..29,
|
||||
),
|
||||
focus_range: None,
|
||||
container_name: None,
|
||||
description: None,
|
||||
docs: None,
|
||||
@ -494,9 +492,7 @@ fn foo() {}
|
||||
full_range: 51..105,
|
||||
name: "foo",
|
||||
kind: FN_DEF,
|
||||
focus_range: Some(
|
||||
51..58,
|
||||
),
|
||||
focus_range: None,
|
||||
container_name: None,
|
||||
description: None,
|
||||
docs: None,
|
||||
|
Loading…
Reference in New Issue
Block a user