Skip to content

Commit

Permalink
KLS: Don't discard an unresolved empty location during remapping.
Browse files Browse the repository at this point in the history
This is a follow-up to #2944. In addition to not throwing away empty spans from
the service, also ensure that when those spans are not discarded when they
don't get moved by remapping.
  • Loading branch information
M. J. Fromberger committed Aug 19, 2018
1 parent ba00741 commit 85efc37
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions kythe/go/languageserver/languageserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,9 @@ func (ls *Server) TextDocumentDefinition(params lsp.TextDocumentPositionParams)
return []lsp.Location{loc}, nil
}

// There definition range doesn't exist anymore
return []lsp.Location{}, nil
// Their definition range doesn't exist anymore, or hasn't moved.
// Fall through and return the original location Kythe reported.
}

log.Printf("Unable to map definition to local location")
// We don't how to map it so we just return the location from Kythe
return []lsp.Location{*l}, nil
}

Expand Down

0 comments on commit 85efc37

Please sign in to comment.