mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
chore(els): impl hover/jump for type specification
This commit is contained in:
parent
2005d0640d
commit
4137a07b70
10 changed files with 87 additions and 28 deletions
|
@ -1817,7 +1817,7 @@ pub struct SubrSignature {
|
|||
pub ident: Identifier,
|
||||
pub bounds: TypeBoundSpecs,
|
||||
pub params: Params,
|
||||
pub return_t_spec: Option<TypeSpec>,
|
||||
pub return_t_spec: Option<TypeSpecWithOp>,
|
||||
}
|
||||
|
||||
impl NestedDisplay for SubrSignature {
|
||||
|
@ -1869,7 +1869,7 @@ impl SubrSignature {
|
|||
ident: Identifier,
|
||||
bounds: TypeBoundSpecs,
|
||||
params: Params,
|
||||
return_t_spec: Option<TypeSpec>,
|
||||
return_t_spec: Option<TypeSpecWithOp>,
|
||||
) -> Self {
|
||||
Self {
|
||||
ident,
|
||||
|
@ -2014,6 +2014,13 @@ impl Signature {
|
|||
pub fn t_spec(&self) -> Option<&TypeSpec> {
|
||||
match self {
|
||||
Self::Var(v) => v.t_spec.as_ref().map(|t| &t.raw.t_spec),
|
||||
Self::Subr(s) => s.return_t_spec.as_ref().map(|t| &t.raw.t_spec),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn t_spec_with_op(&self) -> Option<&TypeSpecWithOp> {
|
||||
match self {
|
||||
Self::Var(v) => v.t_spec.as_ref(),
|
||||
Self::Subr(s) => s.return_t_spec.as_ref(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue