mirror of
https://github.com/golang/go
synced 2024-11-18 16:44:43 -07:00
internal/lsp: fix typo on 'textDocument/foldingRange' method
LSP specification define 'foldingRange', not 'foldingRanges'. Just trims end of 's' and rename interface method name. ref: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/specification.md#folding-range-request-leftwards_arrow_with_hook Change-Id: Ie2a91f6c0bdd99b8ae9000ba87c24118b264b934 Reviewed-on: https://go-review.googlesource.com/c/tools/+/173079 Reviewed-by: Rebecca Stambler <rstambler@golang.org> Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
15d5d381ff
commit
61c0d37527
@ -49,7 +49,7 @@ type Server interface {
|
||||
RangeFormatting(context.Context, *DocumentRangeFormattingParams) ([]TextEdit, error)
|
||||
OnTypeFormatting(context.Context, *DocumentOnTypeFormattingParams) ([]TextEdit, error)
|
||||
Rename(context.Context, *RenameParams) ([]WorkspaceEdit, error)
|
||||
FoldingRanges(context.Context, *FoldingRangeParams) ([]FoldingRange, error)
|
||||
FoldingRange(context.Context, *FoldingRangeParams) ([]FoldingRange, error)
|
||||
}
|
||||
|
||||
func serverHandler(log xlog.Logger, server Server) jsonrpc2.Handler {
|
||||
@ -454,7 +454,7 @@ func serverHandler(log xlog.Logger, server Server) jsonrpc2.Handler {
|
||||
sendParseError(ctx, log, conn, r, err)
|
||||
return
|
||||
}
|
||||
resp, err := server.FoldingRanges(ctx, ¶ms)
|
||||
resp, err := server.FoldingRange(ctx, ¶ms)
|
||||
if err := conn.Reply(ctx, r, resp, err); err != nil {
|
||||
log.Errorf(ctx, "%v", err)
|
||||
}
|
||||
@ -714,9 +714,9 @@ func (s *serverDispatcher) Rename(ctx context.Context, params *RenameParams) ([]
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (s *serverDispatcher) FoldingRanges(ctx context.Context, params *FoldingRangeParams) ([]FoldingRange, error) {
|
||||
func (s *serverDispatcher) FoldingRange(ctx context.Context, params *FoldingRangeParams) ([]FoldingRange, error) {
|
||||
var result []FoldingRange
|
||||
if err := s.Conn.Call(ctx, "textDocument/foldingRanges", params, &result); err != nil {
|
||||
if err := s.Conn.Call(ctx, "textDocument/foldingRange", params, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
|
@ -242,8 +242,8 @@ func (s *Server) Rename(context.Context, *protocol.RenameParams) ([]protocol.Wor
|
||||
return nil, notImplemented("Rename")
|
||||
}
|
||||
|
||||
func (s *Server) FoldingRanges(context.Context, *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error) {
|
||||
return nil, notImplemented("FoldingRanges")
|
||||
func (s *Server) FoldingRange(context.Context, *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error) {
|
||||
return nil, notImplemented("FoldingRange")
|
||||
}
|
||||
|
||||
func notImplemented(method string) *jsonrpc2.Error {
|
||||
|
Loading…
Reference in New Issue
Block a user