mirror of
https://github.com/golang/go
synced 2024-11-18 19:44:46 -07:00
internal/lsp/protocol: update to protocol version 3.15
I was messing around with the new diagnostic tags feature and had to update to get it to work. Change-Id: I4294513b460ec4806d23af20bf908cee8673f7c8 Reviewed-on: https://go-review.googlesource.com/c/tools/+/197117 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Peter Weinberger <pjw@google.com>
This commit is contained in:
parent
eb7cb10de1
commit
22afafe332
@ -196,7 +196,9 @@ func (c *connection) initialize(ctx context.Context) error {
|
||||
params := &protocol.ParamInitia{}
|
||||
params.RootURI = string(span.FileURI(c.Client.app.wd))
|
||||
params.Capabilities.Workspace.Configuration = true
|
||||
params.Capabilities.TextDocument.Hover.ContentFormat = []protocol.MarkupKind{protocol.PlainText}
|
||||
params.Capabilities.TextDocument.Hover = &protocol.HoverClientCapabilities{
|
||||
ContentFormat: []protocol.MarkupKind{protocol.PlainText},
|
||||
}
|
||||
if _, err := c.Server.Initialize(ctx, params); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ func (s *Server) initialize(ctx context.Context, params *protocol.ParamInitia) (
|
||||
}
|
||||
|
||||
var codeActionProvider interface{}
|
||||
if params.Capabilities.TextDocument.CodeAction.CodeActionLiteralSupport != nil &&
|
||||
len(params.Capabilities.TextDocument.CodeAction.CodeActionLiteralSupport.CodeActionKind.ValueSet) > 0 {
|
||||
if ca := params.Capabilities.TextDocument.CodeAction; ca != nil && ca.CodeActionLiteralSupport != nil &&
|
||||
len(ca.CodeActionLiteralSupport.CodeActionKind.ValueSet) > 0 {
|
||||
// If the client has specified CodeActionLiteralSupport,
|
||||
// send the code actions we support.
|
||||
//
|
||||
@ -66,9 +66,9 @@ func (s *Server) initialize(ctx context.Context, params *protocol.ParamInitia) (
|
||||
codeActionProvider = true
|
||||
}
|
||||
var renameOpts interface{}
|
||||
if params.Capabilities.TextDocument.Rename.PrepareSupport {
|
||||
if r := params.Capabilities.TextDocument.Rename; r != nil {
|
||||
renameOpts = &protocol.RenameOptions{
|
||||
PrepareProvider: true,
|
||||
PrepareProvider: r.PrepareSupport,
|
||||
}
|
||||
} else {
|
||||
renameOpts = true
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -53,7 +53,7 @@ let fnames = [
|
||||
`${srcDir}/protocol/src/protocol.ts`, `${srcDir}/types/src/main.ts`,
|
||||
`${srcDir}/jsonrpc/src/main.ts`
|
||||
];
|
||||
let gitHash = 'fda16d6b63ba0fbdbd21d437ea810685528a0018';
|
||||
let gitHash = '36ac51f057215e6e2e0408384e07ecf564a938da';
|
||||
let outFname = 'tsprotocol.go';
|
||||
let fda: number, fdb: number, fde: number; // file descriptors
|
||||
|
||||
|
@ -143,8 +143,7 @@ func SetOptions(options *Options, opts interface{}) OptionResults {
|
||||
|
||||
func (o *Options) ForClientCapabilities(caps protocol.ClientCapabilities) {
|
||||
// Check if the client supports snippets in completion items.
|
||||
if caps.TextDocument.Completion.CompletionItem != nil &&
|
||||
caps.TextDocument.Completion.CompletionItem.SnippetSupport {
|
||||
if c := caps.TextDocument.Completion; c != nil && c.CompletionItem != nil && c.CompletionItem.SnippetSupport {
|
||||
o.InsertTextFormat = protocol.SnippetTextFormat
|
||||
}
|
||||
// Check if the client supports configuration messages.
|
||||
@ -153,11 +152,13 @@ func (o *Options) ForClientCapabilities(caps protocol.ClientCapabilities) {
|
||||
o.DynamicWatchedFilesSupported = caps.Workspace.DidChangeWatchedFiles.DynamicRegistration
|
||||
|
||||
// Check which types of content format are supported by this client.
|
||||
if len(caps.TextDocument.Hover.ContentFormat) > 0 {
|
||||
o.PreferredContentFormat = caps.TextDocument.Hover.ContentFormat[0]
|
||||
if hover := caps.TextDocument.Hover; hover != nil && len(hover.ContentFormat) > 0 {
|
||||
o.PreferredContentFormat = hover.ContentFormat[0]
|
||||
}
|
||||
// Check if the client supports only line folding.
|
||||
o.LineFoldingOnly = caps.TextDocument.FoldingRange.LineFoldingOnly
|
||||
if fr := caps.TextDocument.FoldingRange; fr != nil {
|
||||
o.LineFoldingOnly = fr.LineFoldingOnly
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Options) set(name string, value interface{}) OptionResult {
|
||||
|
Loading…
Reference in New Issue
Block a user