This commit is contained in:
Serge Smertin 2024-03-19 17:55:00 +01:00
parent 03f0ca10df
commit 7a522897cd
No known key found for this signature in database
GPG Key ID: 92A95A66446BCE3F
1 changed files with 5 additions and 5 deletions

View File

@ -137,7 +137,7 @@ func (p *LocalLspProxy) QuickFix(ctx context.Context, params *protocol.CodeActio
return nil, nil
}
var res struct {
Actions []protocol.CodeAction `json:"actions"`
CodeActions []protocol.CodeAction `json:"code_actions"`
}
err := p.client.Do(ctx, "POST", fmt.Sprintf("%s/quickfix", p.host),
httpclient.WithRequestData(map[string]any{
@ -150,11 +150,11 @@ func (p *LocalLspProxy) QuickFix(ctx context.Context, params *protocol.CodeActio
}
// protocol.CodeActionKindSource has to be handled by a separate method, not QuickFix(...) - e.g reformatting
quickFixKind := protocol.CodeActionKindQuickFix
for i := range res.Actions {
res.Actions[i].Diagnostics = []protocol.Diagnostic{fixMe.resolves}
res.Actions[i].Kind = &quickFixKind
for i := range res.CodeActions {
res.CodeActions[i].Diagnostics = []protocol.Diagnostic{fixMe.resolves}
res.CodeActions[i].Kind = &quickFixKind
}
return res.Actions, nil
return res.CodeActions, nil
}
func startServer(ctx context.Context) error {