hide type inlay hints
This commit is contained in:
parent
d7dfe93fc3
commit
05abfc77f5
@ -265,12 +265,15 @@ fn is_named_constructor(
|
|||||||
};
|
};
|
||||||
let path = expr.path()?;
|
let path = expr.path()?;
|
||||||
|
|
||||||
// If it exists, use qualifying segment as the constructor name.
|
let callable = sema.type_of_expr(&ast::Expr::PathExpr(expr))?.original.as_callable(sema.db);
|
||||||
// If not, use the last segment.
|
let callable_kind = callable.map(|it| it.kind());
|
||||||
let qual_seg = match path.qualifier() {
|
let qual_seg = match callable_kind {
|
||||||
Some(qual) => qual.segment(),
|
Some(hir::CallableKind::Function(_) | hir::CallableKind::TupleEnumVariant(_)) => {
|
||||||
None => path.segment(),
|
path.qualifier()?.segment()
|
||||||
|
}
|
||||||
|
_ => path.segment(),
|
||||||
}?;
|
}?;
|
||||||
|
|
||||||
let ctor_name = match qual_seg.kind()? {
|
let ctor_name = match qual_seg.kind()? {
|
||||||
ast::PathSegmentKind::Name(name_ref) => {
|
ast::PathSegmentKind::Name(name_ref) => {
|
||||||
match qual_seg.generic_arg_list().map(|it| it.generic_args()) {
|
match qual_seg.generic_arg_list().map(|it| it.generic_args()) {
|
||||||
@ -1348,6 +1351,13 @@ fn main() {
|
|||||||
//- minicore: try, option
|
//- minicore: try, option
|
||||||
use core::ops::ControlFlow;
|
use core::ops::ControlFlow;
|
||||||
|
|
||||||
|
mod x {
|
||||||
|
pub mod y { pub struct Foo; }
|
||||||
|
pub struct Foo;
|
||||||
|
pub enum AnotherEnum {
|
||||||
|
Variant()
|
||||||
|
};
|
||||||
|
}
|
||||||
struct Struct;
|
struct Struct;
|
||||||
struct TupleStruct();
|
struct TupleStruct();
|
||||||
|
|
||||||
@ -1378,6 +1388,8 @@ fn times2(value: i32) -> i32 {
|
|||||||
fn main() {
|
fn main() {
|
||||||
let enumb = Enum::Variant(0);
|
let enumb = Enum::Variant(0);
|
||||||
|
|
||||||
|
let strukt = x::Foo;
|
||||||
|
let strukt = x::y::Foo;
|
||||||
let strukt = Struct;
|
let strukt = Struct;
|
||||||
let strukt = Struct::new();
|
let strukt = Struct::new();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user