Skip to content

Commit 321bb7e

Browse files
enum fields to properties
1 parent 89cccdc commit 321bb7e

15 files changed

+173
-114
lines changed

src/Dap.Protocol/Feature/Events/BreakpointFeature.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public record Breakpoint
7777
public int? Offset { get; init; }
7878
}
7979
}
80+
8081
namespace Events
8182
{
8283
[Parallel]
@@ -104,9 +105,9 @@ public record BreakpointEvent : IRequest
104105
[StringEnum]
105106
public readonly partial struct BreakpointEventReason
106107
{
107-
public static readonly BreakpointEventReason Changed = new BreakpointEventReason("changed");
108-
public static readonly BreakpointEventReason New = new BreakpointEventReason("new");
109-
public static readonly BreakpointEventReason Removed = new BreakpointEventReason("removed");
108+
public static BreakpointEventReason Changed { get; } = new BreakpointEventReason("changed");
109+
public static BreakpointEventReason New { get; } = new BreakpointEventReason("new");
110+
public static BreakpointEventReason Removed { get; } = new BreakpointEventReason("removed");
110111
}
111112
}
112113
}

src/Dap.Protocol/Feature/Events/LoadedSourceFeature.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public record LoadedSourceEvent : IRequest
3535
[StringEnum]
3636
public readonly partial struct LoadedSourceReason
3737
{
38-
public static readonly LoadedSourceReason Changed = new LoadedSourceReason("changed");
39-
public static readonly LoadedSourceReason New = new LoadedSourceReason("new");
40-
public static readonly LoadedSourceReason Removed = new LoadedSourceReason("removed");
38+
public static LoadedSourceReason Changed { get; } = new LoadedSourceReason("changed");
39+
public static LoadedSourceReason New { get; } = new LoadedSourceReason("new");
40+
public static LoadedSourceReason Removed { get; } = new LoadedSourceReason("removed");
4141
}
4242
}
4343
}

src/Dap.Protocol/Feature/Events/ModuleFeature.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public record ModuleEvent : IRequest
3535
[StringEnum]
3636
public readonly partial struct ModuleEventReason
3737
{
38-
public static readonly ModuleEventReason Changed = new ModuleEventReason("changed");
39-
public static readonly ModuleEventReason New = new ModuleEventReason("new");
40-
public static readonly ModuleEventReason Removed = new ModuleEventReason("removed");
38+
public static ModuleEventReason Changed { get; } = new ModuleEventReason("changed");
39+
public static ModuleEventReason New { get; } = new ModuleEventReason("new");
40+
public static ModuleEventReason Removed { get; } = new ModuleEventReason("removed");
4141
}
4242
}
4343
}

src/Dap.Protocol/Feature/Events/OutputFeature.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ public record OutputEvent : IRequest
5353
public OutputEventGroup Group { get; set; }
5454

5555
/// <summary>
56-
/// If an attribute 'variablesReference' exists and its value is > 0, the
56+
/// If an attribute 'variablesReference' exists and its value is > 0, the
5757
/// output contains objects which can be retrieved by passing
5858
/// 'variablesReference' to the 'variables' request. The value should be less
5959
/// than or equal to 2147483647 (2^31-1).
60-
/// </summary>
60+
/// </summary>
6161
[Optional]
6262
public long? VariablesReference { get; init; }
6363

@@ -89,18 +89,18 @@ public record OutputEvent : IRequest
8989
[StringEnum]
9090
public readonly partial struct OutputEventCategory
9191
{
92-
public static readonly OutputEventCategory Console = new OutputEventCategory("console");
93-
public static readonly OutputEventCategory StandardOutput = new OutputEventCategory("stdout");
94-
public static readonly OutputEventCategory StandardError = new OutputEventCategory("stderr");
95-
public static readonly OutputEventCategory Telemetry = new OutputEventCategory("telemetry");
92+
public static OutputEventCategory Console { get; } = new OutputEventCategory("console");
93+
public static OutputEventCategory StandardOutput { get; } = new OutputEventCategory("stdout");
94+
public static OutputEventCategory StandardError { get; } = new OutputEventCategory("stderr");
95+
public static OutputEventCategory Telemetry { get; } = new OutputEventCategory("telemetry");
9696
}
9797

9898
[StringEnum]
9999
public readonly partial struct OutputEventGroup
100100
{
101-
public static readonly OutputEventGroup Start = new OutputEventGroup("start");
102-
public static readonly OutputEventGroup StartCollapsed = new OutputEventGroup("startCollapsed");
103-
public static readonly OutputEventGroup End = new OutputEventGroup("end");
101+
public static OutputEventGroup Start { get; } = new OutputEventGroup("start");
102+
public static OutputEventGroup StartCollapsed { get; } = new OutputEventGroup("startCollapsed");
103+
public static OutputEventGroup End { get; } = new OutputEventGroup("end");
104104
}
105105
}
106106
}

src/Dap.Protocol/Feature/Events/ProcessFeature.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ public record ProcessEvent : IRequest
5757
[StringEnum]
5858
public readonly partial struct ProcessEventStartMethod
5959
{
60-
public static readonly ProcessEventStartMethod Launch = new ProcessEventStartMethod("launch");
61-
public static readonly ProcessEventStartMethod Attach = new ProcessEventStartMethod("attach");
62-
public static readonly ProcessEventStartMethod AttachForSuspendedLaunch = new ProcessEventStartMethod("attachForSuspendedLaunch");
60+
public static ProcessEventStartMethod Launch { get; } = new ProcessEventStartMethod("launch");
61+
public static ProcessEventStartMethod Attach { get; } = new ProcessEventStartMethod("attach");
62+
public static ProcessEventStartMethod AttachForSuspendedLaunch { get; } = new ProcessEventStartMethod("attachForSuspendedLaunch");
6363
}
6464
}
6565
}

src/Dap.Protocol/Feature/Events/StoppedFeature.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ public record StoppedEvent : IRequest
6969
[StringEnum]
7070
public readonly partial struct StoppedEventReason
7171
{
72-
public static readonly StoppedEventReason Step = new StoppedEventReason("step");
73-
public static readonly StoppedEventReason Breakpoint = new StoppedEventReason("breakpoint");
74-
public static readonly StoppedEventReason Exception = new StoppedEventReason("exception");
75-
public static readonly StoppedEventReason Pause = new StoppedEventReason("pause");
76-
public static readonly StoppedEventReason Entry = new StoppedEventReason("entry");
77-
public static readonly StoppedEventReason Goto = new StoppedEventReason("goto");
78-
public static readonly StoppedEventReason FunctionBreakpoint = new StoppedEventReason("function breakpoint");
79-
public static readonly StoppedEventReason DataBreakpoint = new StoppedEventReason("data breakpoint");
80-
public static readonly StoppedEventReason InstructionBreakpoint = new StoppedEventReason("instruction breakpoint");
72+
public static StoppedEventReason Step { get; } = new StoppedEventReason("step");
73+
public static StoppedEventReason Breakpoint { get; } = new StoppedEventReason("breakpoint");
74+
public static StoppedEventReason Exception { get; } = new StoppedEventReason("exception");
75+
public static StoppedEventReason Pause { get; } = new StoppedEventReason("pause");
76+
public static StoppedEventReason Entry { get; } = new StoppedEventReason("entry");
77+
public static StoppedEventReason Goto { get; } = new StoppedEventReason("goto");
78+
public static StoppedEventReason FunctionBreakpoint { get; } = new StoppedEventReason("function breakpoint");
79+
public static StoppedEventReason DataBreakpoint { get; } = new StoppedEventReason("data breakpoint");
80+
public static StoppedEventReason InstructionBreakpoint { get; } = new StoppedEventReason("instruction breakpoint");
8181
}
8282
}
8383
}

src/Dap.Protocol/Feature/Events/ThreadFeature.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public record ThreadEvent : IRequest
4141
[StringEnum]
4242
public readonly partial struct ThreadEventReason
4343
{
44-
public static readonly ThreadEventReason Started = new ThreadEventReason("started");
45-
public static readonly ThreadEventReason Exited = new ThreadEventReason("exited");
44+
public static ThreadEventReason Started { get; } = new ThreadEventReason("started");
45+
public static ThreadEventReason Exited { get; } = new ThreadEventReason("exited");
4646
}
4747
}
4848
}

src/Dap.Protocol/Models/InvalidatedAreas.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ namespace OmniSharp.Extensions.DebugAdapter.Protocol.Models
55
[StringEnum]
66
public readonly partial struct InvalidatedAreas
77
{
8-
public static InvalidatedAreas All = new InvalidatedAreas("all");
9-
public static InvalidatedAreas Stacks = new InvalidatedAreas("stacks");
10-
public static InvalidatedAreas Threads = new InvalidatedAreas("threads");
11-
public static InvalidatedAreas Variables = new InvalidatedAreas("variables");
8+
public static InvalidatedAreas All { get; } = new InvalidatedAreas("all");
9+
public static InvalidatedAreas Stacks { get; } = new InvalidatedAreas("stacks");
10+
public static InvalidatedAreas Threads { get; } = new InvalidatedAreas("threads");
11+
public static InvalidatedAreas Variables { get; } = new InvalidatedAreas("variables");
1212
}
1313
}

0 commit comments

Comments
 (0)