Skip to content

Commit

Permalink
fix cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
zhihaopan committed Jul 1, 2024
1 parent 34df485 commit 92217e6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions components/jump_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ const (
var ErrSymbolNotFound = errors.New("symbol not found")

func JumpDefine(ctx context.Context, req *defines.DefinitionParams) (result *[]defines.LocationLink, err error) {
if !view.IsProtoFile(req.TextDocument.Uri) {
return nil, nil
}
symbols, err := findSymbolDefinition(ctx, &req.TextDocumentPositionParams)
if err != nil {
return nil, err
Expand Down Expand Up @@ -89,14 +86,16 @@ func locationFromSymbols(symbols []SymbolDefinition) (result []defines.LocationL
}

func findSymbolDefinition(ctx context.Context, position *defines.TextDocumentPositionParams) (result []SymbolDefinition, err error) {

if view.IsProtoFile(position.TextDocument.Uri) {
return JumpProtoDefine(ctx, position)
}

if view.IsPbHeader(position.TextDocument.Uri) {
return JumpPbHeaderDefine(ctx, position)
}

if !view.IsProtoFile(position.TextDocument.Uri) {
return nil, nil
}
return nil, ErrSymbolNotFound
}

Expand Down

0 comments on commit 92217e6

Please sign in to comment.