Skip to content

Commit ded64a5

Browse files
authored
Merge pull request sourcegraph#103 from sourcegraph/sg/fix-500
textDocument/xdefinition: do not return "nil" AND no error.
2 parents be81d2a + 85a71bb commit ded64a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

langserver/definition.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (h *LangHandler) handleXDefinition(ctx context.Context, conn JSONRPC2Conn,
3232
// Invalid nodes means we tried to click on something which is
3333
// not an ident (eg comment/string/etc). Return no locations.
3434
if _, ok := err.(*invalidNodeError); ok {
35-
return nil, nil
35+
return []symbolLocationInformation{}, nil
3636
}
3737
return nil, err
3838
}
@@ -51,7 +51,7 @@ func (h *LangHandler) handleXDefinition(ctx context.Context, conn JSONRPC2Conn,
5151
//
5252
// TODO(sqs): find a way to actually emit builtin locations
5353
// (pointing to builtin/builtin.go).
54-
return nil, nil
54+
return []symbolLocationInformation{}, nil
5555
}
5656
}
5757
if len(nodes) == 0 {

0 commit comments

Comments
 (0)