Previously it'd ~always jump to the lexically first declaration, which was
often an unhelpful forward declaration.
- consult the index for definition and preferred declaration locations (query code shared with go-to-definition)
- when unwrapping to LSP, prefer definition to declaration This matches "go-to-definition", which is the most common go-to operation
nit: ResultIndex looks like an implementation detail of this function and the callers do not need it. SymbolID is already present as LocatedSymbol::ID so we can compute this map in this function itself.