internal/lsp: fix error formatting directive

protocol.Position doesn't implement String(), so don't use "%s"
formatting directive. We could implement String(), but it is generated
code, so its a bit iffy.

Change-Id: If21b5fee66c6e1bd59f19b520c7d36f0e648cb71
Reviewed-on: https://go-review.googlesource.com/c/tools/+/195042
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Muir Manders 2019-09-12 12:13:05 -07:00 committed by Rebecca Stambler
parent 96954830e1
commit f3d05f808b
1 changed files with 2 additions and 2 deletions

View File

@ -33,11 +33,11 @@ func Highlight(ctx context.Context, view View, uri span.URI, pos protocol.Positi
}
path, _ := astutil.PathEnclosingInterval(file, rng.Start, rng.Start)
if len(path) == 0 {
return nil, errors.Errorf("no enclosing position found for %s", pos)
return nil, errors.Errorf("no enclosing position found for %f:%f", pos.Line, pos.Character)
}
id, ok := path[0].(*ast.Ident)
if !ok {
return nil, errors.Errorf("%s is not an identifier", pos)
return nil, errors.Errorf("%f:%f is not an identifier", pos.Line, pos.Character)
}
var result []protocol.Range
if id.Obj != nil {