@@ -147,23 +147,6 @@ func writeserver() {
147147` )
148148 out .WriteString ("type Server interface {\n " )
149149 for _ , k := range sdecls .keys () {
150- if k == "codeAction/resolve" {
151- sdecls [k ] = `// To support microsoft/language-server-protocol#1164, the language server
152- // need to read the client-supplied form answers and either returns a
153- // CodeAction with errors in the form fields surfacing the error to the
154- // client, or a CodeAction with properties the language client is waiting
155- // for (e.g. edits, commands).
156- //
157- // The language client may call "codeAction/resolve" if the language server
158- // returns a CodeAction with errors or try asking the user for completing the
159- // form again.
160- //
161- // The language client may call "codeAction/resolve" multiple times with user
162- // filled (re-filled) answers in the form until it obtains a CodeAction with
163- // properties (e.g. edits, commands) it's waiting for.
164- //
165- ` + sdecls [k ]
166- }
167150 out .WriteString (sdecls [k ])
168151 }
169152 out .WriteString (`
@@ -212,50 +195,6 @@ func writeprotocol() {
212195 hack ("WorkspaceFoldersServerCapabilities" , "WorkspaceFolders5Gn" )
213196 hack ("_InitializeParams" , "XInitializeParams" )
214197
215- // Insert a block of content into a type.
216- insert := func (key , content string ) {
217- if _ , ok := types [key ]; ! ok {
218- log .Fatalf ("types[%q] not found" , key )
219- }
220- idx := strings .LastIndex (types [key ], "}" )
221- if idx == - 1 {
222- log .Fatalf ("could not find '}' in type %q" , key )
223- }
224- types [key ] = types [key ][:idx ] + content + types [key ][idx :]
225- }
226-
227- // TODO(hxjiang): extend form resolve to codelens resolve.
228- insert ("CodeAction" , `
229- // FormFields and FormAnswers allow the server and client to exchange
230- // interactive questions and answers during a resolveCodeAction request.
231- //
232- // The server populates FormFields to define the schema. The server may
233- // optionally populate FormAnswers to preserve previous user input; if
234- // provided, the client may present these as default values.
235- //
236- // When the client responds, it must provide FormAnswers. The client is not
237- // required to send FormFields back to the server.
238-
239- // FormFields defines the questions and validation errors.
240- //
241- // This is a server-to-client field. The language server defines these, and
242- // the client uses them to render the form.
243- //
244- // Note: This is a non-standard protocol extension. See microsoft/language-server-protocol#1164.
245- FormFields []FormField ` + "`json:\" formFields,omitempty\" `" )
246- insert ("CodeAction" , `
247- // FormAnswers contains the values for the form questions.
248- //
249- // When sent by the language server, this field is optional but recommended
250- // to support editing previous values.
251- //
252- // When sent by the language client, this field is required. The slice must
253- // have the same length as FormFields (one answer per question), where the
254- // answer at index i corresponds to the field at index i.
255- //
256- // Note: This is a non-standard protocol extension. See microsoft/language-server-protocol#1164.
257- FormAnswers []any ` + "`json:\" formAnswers,omitempty\" `" )
258-
259198 for _ , k := range types .keys () {
260199 if k == "WatchKind" {
261200 types [k ] = "type WatchKind = uint32" // strict gopls compatibility needs the '='
0 commit comments