GoToDefinition returns all declaration results (implicit/explicit) that are
in the same location, and the results are returned in arbitrary order.
Some LSP clients defaultly take the first result as the final result, which
might present a bad result (implicit decl) to users.
this patch ranks the result based on whether the declarations are
referenced explicitly/implicitly. We put explicit declarations first.
This also improve the "hover" (which just take the first result) feature
in some cases.