Basic code intel always pops up definition panel with class and constructors when jumping to class #4225
Description
Basic code intel is currently annoying to use because it almost always pops up the definition panel on jump-to-definition.
One of these cases is when jumping to the class from an instantiation in languages where the constructor has the same name as the class:
The definition panel always pops up with the class and the constructors. There is an argument to be made when there are multiple constructors, but not when there is only one.
Possible solutions:
When the reference looks like an instantiation (has a new
token in front of it), it could filter the result by kind: CLASS.
Alternatively, when the API only returns one symbol of kind CLASS and one of kind METHOD where the method has a name of the class, constructor
, __construct
etc and the name of the class is a substring of the method's container name the method can be assumed to be the constructor that was invoked. It could always jump to that if there is only one.