Skip to content

Commit

Permalink
fix null generics when hovering named constructors
Browse files Browse the repository at this point in the history
If we hover over a ValaMemberAccess that is a named constructor in an
OCE, we want to use the OCE's value_type as the parent data type to
resolve generic parameter types.
  • Loading branch information
Prince781 committed Sep 23, 2020
1 parent aeff742 commit 83536db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,9 @@ class Vls.Server : Object {
method_type_arguments = ma.get_type_arguments ();
}

if (expr.parent_node is Vala.ObjectCreationExpression)
data_type = ((Vala.ObjectCreationExpression)expr.parent_node).value_type;

// if data_type is the same as this variable's type, then this variable is not a member
// of the type
// (note: this avoids variable's generic type arguments being resolved to InvalidType)
Expand Down

0 comments on commit 83536db

Please sign in to comment.