internal/lsp: remove SelectionRange and textDocument/selectionRange

These are the latest changes to vscode-languageserver-node brought to Go.

Change-Id: I88d0b384356964c358cb2c51ea3b79cb6b51b434
Reviewed-on: https://go-review.googlesource.com/c/tools/+/178357
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Peter Weinberger 2019-05-21 07:54:00 -04:00
parent 38d8bcfa38
commit 991f294999
3 changed files with 27 additions and 105 deletions

View File

@ -1,7 +1,7 @@
// Package protocol contains data types and code for LSP jsonrpcs // Package protocol contains data types and code for LSP jsonrpcs
// generated automatically from vscode-languageserver-node // generated automatically from vscode-languageserver-node
// commit: 54f6caacea8aa0cf9f45527153d993010c1cc793 // commit: c1e8923f8ea3b1f9c61dadf97448244d9ffbf7ae
// last fetched Fri Apr 05 2019 10:16:07 GMT-0400 (Eastern Daylight Time) // last fetched Tue May 21 2019 07:36:27 GMT-0400 (Eastern Daylight Time)
package protocol package protocol
// Code generated (see typescript/README.md) DO NOT EDIT. // Code generated (see typescript/README.md) DO NOT EDIT.
@ -155,43 +155,6 @@ type FoldingRangeParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"` TextDocument TextDocumentIdentifier `json:"textDocument"`
} }
// SelectionRangeProviderOptions is
type SelectionRangeProviderOptions struct {
}
/*SelectionRange defined:
* Represents a selection range
*/
type SelectionRange struct {
/*Range defined:
* Range of the selection.
*/
Range Range `json:"range"`
/*Kind defined:
* Describes the kind of the selection range such as `statemet' or 'declaration'. See
* [SelectionRangeKind](#SelectionRangeKind) for an enumeration of standardized kinds.
*/
Kind string `json:"kind"`
}
/*SelectionRangeParams defined:
* A parameter literal used in selection range requests.
*/
type SelectionRangeParams struct {
/*TextDocument defined:
* The text document.
*/
TextDocument TextDocumentIdentifier `json:"textDocument"`
/*Positions defined:
* The positions inside the text document.
*/
Positions []Position `json:"positions"`
}
/*Registration defined: /*Registration defined:
* General parameters to to register for an notification or to register a provider. * General parameters to to register for an notification or to register a provider.
*/ */
@ -713,6 +676,17 @@ type TextDocumentClientCapabilities struct {
} `json:"publishDiagnostics,omitempty"` } `json:"publishDiagnostics,omitempty"`
} }
/*WindowClientCapabilities defined:
* Window specific client capabilities.
*/
type WindowClientCapabilities struct {
/*Progress defined:
* Whether client supports handling progress notifications.
*/
Progress bool `json:"progress,omitempty"`
}
// ClientCapabilities is // ClientCapabilities is
type ClientCapabilities struct { type ClientCapabilities struct {
@ -1267,21 +1241,13 @@ type ClientCapabilities struct {
*/ */
LinkSupport bool `json:"linkSupport,omitempty"` LinkSupport bool `json:"linkSupport,omitempty"`
} `json:"declaration,omitempty"` } `json:"declaration,omitempty"`
/*SelectionRange defined:
* Capabilities specific to `textDocument/selectionRange` requests
*/
SelectionRange struct {
/*DynamicRegistration defined:
* Whether implementation supports dynamic registration for selection range providers. If this is set to `true`
* the client supports the new `(SelectionRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
} `json:"selectionRange,omitempty"`
} `json:"textDocument,omitempty"` } `json:"textDocument,omitempty"`
/*Window defined:
* Window specific client capabilities.
*/
Window WindowClientCapabilities `json:"window,omitempty"`
/*Experimental defined: /*Experimental defined:
* Experimental client capabilities. * Experimental client capabilities.
*/ */
@ -1445,28 +1411,32 @@ type SaveOptions struct {
type TextDocumentSyncOptions struct { type TextDocumentSyncOptions struct {
/*OpenClose defined: /*OpenClose defined:
* Open and close notifications are sent to the server. * Open and close notifications are sent to the server. If omitted open close notification should not
* be sent.
*/ */
OpenClose bool `json:"openClose,omitempty"` OpenClose bool `json:"openClose,omitempty"`
/*Change defined: /*Change defined:
* Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full * Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
* and TextDocumentSyncKind.Incremental. * and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.
*/ */
Change TextDocumentSyncKind `json:"change,omitempty"` Change TextDocumentSyncKind `json:"change,omitempty"`
/*WillSave defined: /*WillSave defined:
* Will save notifications are sent to the server. * If present will save notifications are sent to the server. If omitted the notification should not be
* sent.
*/ */
WillSave bool `json:"willSave,omitempty"` WillSave bool `json:"willSave,omitempty"`
/*WillSaveWaitUntil defined: /*WillSaveWaitUntil defined:
* Will save wait until requests are sent to the server. * If present will save wait until requests are sent to the server. If omitted the request should not be
* sent.
*/ */
WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"` WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"`
/*Save defined: /*Save defined:
* Save notifications are sent to the server. * If present save notifications are sent to the server. If omitted the notification should not be
* sent.
*/ */
Save *SaveOptions `json:"save,omitempty"` Save *SaveOptions `json:"save,omitempty"`
} }
@ -1630,11 +1600,6 @@ type ServerCapabilities struct {
* The server provides Goto Type Definition support. * The server provides Goto Type Definition support.
*/ */
DeclarationProvider bool `json:"declarationProvider,omitempty"` // boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions) DeclarationProvider bool `json:"declarationProvider,omitempty"` // boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions)
/*SelectionRangeProvider defined:
* The server provides selection range support.
*/
SelectionRangeProvider bool `json:"selectionRangeProvider,omitempty"` // boolean | SelectionRangeProviderOptions | (SelectionRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)
} }
// InitializeParams is // InitializeParams is
@ -3405,9 +3370,6 @@ type Tracer struct {
// FoldingRangeKind defines constants // FoldingRangeKind defines constants
type FoldingRangeKind string type FoldingRangeKind string
// SelectionRangeKind defines constants
type SelectionRangeKind string
// ResourceOperationKind defines constants // ResourceOperationKind defines constants
type ResourceOperationKind string type ResourceOperationKind string
@ -3494,23 +3456,6 @@ const (
*/ */
Region FoldingRangeKind = "region" Region FoldingRangeKind = "region"
/*Empty defined:
* Empty Kind.
*/
Empty SelectionRangeKind = ""
/*Statement defined:
* The statment kind, its value is `statement`, possible extensions can be
* `statement.if` etc
*/
Statement SelectionRangeKind = "statement"
/*Declaration defined:
* The declaration kind, its value is `declaration`, possible extensions can be
* `declaration.function`, `declaration.class` etc.
*/
Declaration SelectionRangeKind = "declaration"
/*Create defined: /*Create defined:
* Supports creating new files and folders. * Supports creating new files and folders.
*/ */

View File

@ -29,7 +29,6 @@ type Server interface {
ColorPresentation(context.Context, *ColorPresentationParams) ([]ColorPresentation, error) ColorPresentation(context.Context, *ColorPresentationParams) ([]ColorPresentation, error)
FoldingRange(context.Context, *FoldingRangeParams) ([]FoldingRange, error) FoldingRange(context.Context, *FoldingRangeParams) ([]FoldingRange, error)
Declaration(context.Context, *TextDocumentPositionParams) ([]DeclarationLink, error) Declaration(context.Context, *TextDocumentPositionParams) ([]DeclarationLink, error)
SelectionRange(context.Context, *SelectionRangeParams) ([][]SelectionRange, error)
Initialize(context.Context, *InitializeParams) (*InitializeResult, error) Initialize(context.Context, *InitializeParams) (*InitializeResult, error)
Shutdown(context.Context) error Shutdown(context.Context) error
WillSaveWaitUntil(context.Context, *WillSaveTextDocumentParams) ([]TextEdit, error) WillSaveWaitUntil(context.Context, *WillSaveTextDocumentParams) ([]TextEdit, error)
@ -228,16 +227,6 @@ func serverHandler(log xlog.Logger, server Server) jsonrpc2.Handler {
if err := conn.Reply(ctx, r, resp, err); err != nil { if err := conn.Reply(ctx, r, resp, err); err != nil {
log.Errorf(ctx, "%v", err) log.Errorf(ctx, "%v", err)
} }
case "textDocument/selectionRange": // req
var params SelectionRangeParams
if err := json.Unmarshal(*r.Params, &params); err != nil {
sendParseError(ctx, log, conn, r, err)
return
}
resp, err := server.SelectionRange(ctx, &params)
if err := conn.Reply(ctx, r, resp, err); err != nil {
log.Errorf(ctx, "%v", err)
}
case "initialize": // req case "initialize": // req
var params InitializeParams var params InitializeParams
if err := json.Unmarshal(*r.Params, &params); err != nil { if err := json.Unmarshal(*r.Params, &params); err != nil {
@ -575,14 +564,6 @@ func (s *serverDispatcher) Declaration(ctx context.Context, params *TextDocument
return result, nil return result, nil
} }
func (s *serverDispatcher) SelectionRange(ctx context.Context, params *SelectionRangeParams) ([][]SelectionRange, error) {
var result [][]SelectionRange
if err := s.Conn.Call(ctx, "textDocument/selectionRange", params, &result); err != nil {
return nil, err
}
return result, nil
}
func (s *serverDispatcher) Initialize(ctx context.Context, params *InitializeParams) (*InitializeResult, error) { func (s *serverDispatcher) Initialize(ctx context.Context, params *InitializeParams) (*InitializeResult, error) {
var result InitializeResult var result InitializeResult
if err := s.Conn.Call(ctx, "initialize", params, &result); err != nil { if err := s.Conn.Call(ctx, "initialize", params, &result); err != nil {

View File

@ -262,10 +262,6 @@ func (s *Server) Resolve(context.Context, *protocol.CompletionItem) (*protocol.C
return nil, notImplemented("Resolve") return nil, notImplemented("Resolve")
} }
func (s *Server) SelectionRange(context.Context, *protocol.SelectionRangeParams) ([][]protocol.SelectionRange, error) {
return nil, notImplemented("SelectionRange")
}
func (s *Server) SetTraceNotification(context.Context, *protocol.SetTraceParams) error { func (s *Server) SetTraceNotification(context.Context, *protocol.SetTraceParams) error {
return notImplemented("SetTraceNotification") return notImplemented("SetTraceNotification")
} }