Debian Codegraph @

modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Requests/Requests.cs

raw symbols SCIP
1 // ReSharper disable ClassNeverInstantiated.Global
2 // ReSharper disable UnusedMember.Global
3 // ReSharper disable UnusedAutoPropertyAccessor.Global
4
5 using System;
6 using Newtonsoft.Json;
7
8 namespace GodotTools.IdeMessaging.Requests
9 {
10 public abstract class Request
11 {
12 [JsonIgnore] public string Id { get; }
13
14 protected Request(string id)
15 {
16 Id = id;
17 }
18 }
19
20 public abstract class Response
21 {
22 [JsonIgnore] public MessageStatus Status { get; set; } = MessageStatus.Ok;
23 }
24
25 public sealed class CodeCompletionRequest : Request
26 {
27 public enum CompletionKind
28 {
29 InputActions = 0,
30 NodePaths,
31 ResourcePaths,
32 ScenePaths,
33 ShaderParams,
34 Signals,
35 ThemeColors,
36 ThemeConstants,
37 ThemeFonts,
38 ThemeStyles
39 }
40
41 public CompletionKind Kind { get; set; }
42 public string ScriptFile { get; set; } = string.Empty;
43
44 public new const string Id = "CodeCompletion";
45
46 public CodeCompletionRequest() : base(Id)
47 {
48 }
49 }
50
51 public sealed class CodeCompletionResponse : Response
52 {
53 public CodeCompletionRequest.CompletionKind Kind;
54 public string ScriptFile { get; set; } = string.Empty;
55 public string[] Suggestions { get; set; } = Array.Empty<string>();
56 }
57
58 public sealed class PlayRequest : Request
59 {
60 public new const string Id = "Play";
61
62 public PlayRequest() : base(Id)
63 {
64 }
65 }
66
67 public sealed class PlayResponse : Response
68 {
69 }
70
71 public sealed class StopPlayRequest : Request
72 {
73 public new const string Id = "StopPlay";
74
75 public StopPlayRequest() : base(Id)
76 {
77 }
78 }
79
80 public sealed class StopPlayResponse : Response
81 {
82 }
83
84 public sealed class DebugPlayRequest : Request
85 {
86 public string DebuggerHost { get; set; } = string.Empty;
87 public int DebuggerPort { get; set; }
88 public bool? BuildBeforePlaying { get; set; }
89
90 public new const string Id = "DebugPlay";
91
92 public DebugPlayRequest() : base(Id)
93 {
94 }
95 }
96
97 public sealed class DebugPlayResponse : Response
98 {
99 }
100
101 public sealed class OpenFileRequest : Request
102 {
103 public string File { get; set; } = string.Empty;
104 public int? Line { get; set; }
105 public int? Column { get; set; }
106
107 public new const string Id = "OpenFile";
108
109 public OpenFileRequest() : base(Id)
110 {
111 }
112 }
113
114 public sealed class OpenFileResponse : Response
115 {
116 }
117
118 public sealed class ReloadScriptsRequest : Request
119 {
120 public new const string Id = "ReloadScripts";
121
122 public ReloadScriptsRequest() : base(Id)
123 {
124 }
125 }
126
127 public sealed class ReloadScriptsResponse : Response
128 {
129 }
130 }