forked from OmniSharp/omnisharp-roslyn
/
RunCodeActionRequest.cs
29 lines (27 loc) · 1.13 KB
/
RunCodeActionRequest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using OmniSharp.Mef;
namespace OmniSharp.Models.V2.CodeActions
{
[OmniSharpEndpoint(OmniSharpEndpoints.V2.RunCodeAction, typeof(RunCodeActionRequest), typeof(RunCodeActionResponse))]
public class RunCodeActionRequest : Request, ICodeActionRequest
{
public string Identifier { get; set; }
public Range Selection { get; set; }
public bool WantsTextChanges { get; set; }
public bool ApplyTextChanges { get; set; } = true;
public bool WantsAllCodeActionOperations { get; set; }
public ICodeActionRequest WithSelection(Range newSelection) => new RunCodeActionRequest
{
Line = this.Line,
Column = this.Column,
Buffer = this.Buffer,
ApplyChangesTogether = this.ApplyChangesTogether,
Changes = this.Changes,
FileName = this.FileName,
Identifier = this.Identifier,
WantsTextChanges = this.WantsTextChanges,
ApplyTextChanges = this.ApplyTextChanges,
WantsAllCodeActionOperations = this.WantsAllCodeActionOperations,
Selection = newSelection
};
}
}