diff options
author | Raul Santos <raulsntos@gmail.com> | 2022-08-27 03:22:23 +0200 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2022-08-27 03:22:31 +0200 |
commit | d35c58507c7b4e1da2c310f3d290c7c13ea8fcf0 (patch) | |
tree | ddc4087efad7fd134b17696cc996970e11e6b6ce /modules/mono/editor | |
parent | 390333e822c95081cfbd837699c8c63370b388dc (diff) |
Fix C# style with `dotnet format`
Diffstat (limited to 'modules/mono/editor')
11 files changed, 46 insertions, 27 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedFields.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedFields.cs index ac9f59aa99..ac8d6473a6 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedFields.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedFields.cs @@ -94,16 +94,20 @@ namespace Godot.SourceGenerators.Sample [Export] private NodePath field_NodePath = new NodePath("foo"); [Export] private RID field_RID; - [Export] private Godot.Collections.Dictionary field_GodotDictionary = + [Export] + private Godot.Collections.Dictionary field_GodotDictionary = new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } }; - [Export] private Godot.Collections.Array field_GodotArray = + [Export] + private Godot.Collections.Array field_GodotArray = new() { "foo", 10, Vector2.Up, Colors.Chocolate }; - [Export] private Godot.Collections.Dictionary<string, bool> field_GodotGenericDictionary = + [Export] + private Godot.Collections.Dictionary<string, bool> field_GodotGenericDictionary = new() { { "foo", true }, { "bar", false } }; - [Export] private Godot.Collections.Array<int> field_GodotGenericArray = + [Export] + private Godot.Collections.Array<int> field_GodotGenericArray = new() { 0, 1, 2, 3, 4, 5, 6 }; } } diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedProperties.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedProperties.cs index 4a0e8075f0..3020cfbc50 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedProperties.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedProperties.cs @@ -94,16 +94,20 @@ namespace Godot.SourceGenerators.Sample [Export] private NodePath property_NodePath { get; set; } = new NodePath("foo"); [Export] private RID property_RID { get; set; } - [Export] private Godot.Collections.Dictionary property_GodotDictionary { get; set; } = + [Export] + private Godot.Collections.Dictionary property_GodotDictionary { get; set; } = new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } }; - [Export] private Godot.Collections.Array property_GodotArray { get; set; } = + [Export] + private Godot.Collections.Array property_GodotArray { get; set; } = new() { "foo", 10, Vector2.Up, Colors.Chocolate }; - [Export] private Godot.Collections.Dictionary<string, bool> property_GodotGenericDictionary { get; set; } = + [Export] + private Godot.Collections.Dictionary<string, bool> property_GodotGenericDictionary { get; set; } = new() { { "foo", true }, { "bar", false } }; - [Export] private Godot.Collections.Array<int> property_GodotGenericArray { get; set; } = + [Export] + private Godot.Collections.Array<int> property_GodotGenericArray { get; set; } = new() { 0, 1, 2, 3, 4, 5, 6 }; } } diff --git a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs index 60a4f297c9..7c5502814f 100644 --- a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs +++ b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs @@ -34,7 +34,7 @@ namespace GodotTools.Core path = path.Replace('\\', '/'); path = path[path.Length - 1] == '/' ? path.Substring(0, path.Length - 1) : path; - string[] parts = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] parts = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); path = string.Join(Path.DirectorySeparatorChar.ToString(), parts).Trim(); @@ -60,7 +60,7 @@ namespace GodotTools.Core public static string ToSafeDirName(this string dirName, bool allowDirSeparator = false) { - var invalidChars = new List<string> {":", "*", "?", "\"", "<", ">", "|"}; + var invalidChars = new List<string> { ":", "*", "?", "\"", "<", ">", "|" }; if (allowDirSeparator) { diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs index bc09e1ebf9..72e2a1fc0d 100644 --- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs +++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs @@ -123,12 +123,16 @@ namespace GodotTools.IdeMessaging string projectMetadataDir = Path.Combine(godotProjectDir, ".godot", "mono", "metadata"); // FileSystemWatcher requires an existing directory - if (!Directory.Exists(projectMetadataDir)) { + if (!Directory.Exists(projectMetadataDir)) + { // Check if the non hidden version exists string nonHiddenProjectMetadataDir = Path.Combine(godotProjectDir, "godot", "mono", "metadata"); - if (Directory.Exists(nonHiddenProjectMetadataDir)) { + if (Directory.Exists(nonHiddenProjectMetadataDir)) + { projectMetadataDir = nonHiddenProjectMetadataDir; - } else { + } + else + { Directory.CreateDirectory(projectMetadataDir); } } diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs index 10d7e1898e..dd3913b4f3 100644 --- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs +++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs @@ -78,7 +78,7 @@ namespace GodotTools.IdeMessaging clientStream.WriteTimeout = ClientWriteTimeout; clientReader = new StreamReader(clientStream, Encoding.UTF8); - clientWriter = new StreamWriter(clientStream, Encoding.UTF8) {NewLine = "\n"}; + clientWriter = new StreamWriter(clientStream, Encoding.UTF8) { NewLine = "\n" }; } public async Task Process() diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/ResponseAwaiter.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/ResponseAwaiter.cs index 548e7f06ee..a57c82b608 100644 --- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/ResponseAwaiter.cs +++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/ResponseAwaiter.cs @@ -17,7 +17,7 @@ namespace GodotTools.IdeMessaging if (content.Status == MessageStatus.Ok) SetResult(JsonConvert.DeserializeObject<T>(content.Body)); else - SetResult(new T {Status = content.Status}); + SetResult(new T { Status = content.Status }); } } } diff --git a/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs b/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs index 7a4641dbbc..cc0deb6cc0 100644 --- a/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs +++ b/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs @@ -249,8 +249,8 @@ namespace GodotTools.OpenVisualStudio // Thread call was rejected, so try again. int IOleMessageFilter.RetryRejectedCall(IntPtr hTaskCallee, int dwTickCount, int dwRejectType) { + // flag = SERVERCALL_RETRYLATER if (dwRejectType == 2) - // flag = SERVERCALL_RETRYLATER { // Retry the thread call immediately if return >= 0 & < 100 return 99; diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs b/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs index fc325fc25b..96b28de789 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs @@ -76,13 +76,20 @@ namespace GodotTools.Export else { string arch = ""; - if (features.Contains("x86_64")) { + if (features.Contains("x86_64")) + { arch = "x86_64"; - } else if (features.Contains("x86_32")) { + } + else if (features.Contains("x86_32")) + { arch = "x86_32"; - } else if (features.Contains("arm64")) { + } + else if (features.Contains("arm64")) + { arch = "arm64"; - } else if (features.Contains("arm32")) { + } + else if (features.Contains("arm32")) + { arch = "arm32"; } CompileAssembliesForDesktop(exporter, platform, isDebug, arch, aotOpts, aotTempDir, outputDataDir, assembliesPrepared, bclDir); diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs index 95b60aded1..3f4dbb95bb 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs @@ -180,17 +180,17 @@ namespace GodotTools.Ides public void SendOpenFile(string file) { - SendRequest<OpenFileResponse>(new OpenFileRequest {File = file}); + SendRequest<OpenFileResponse>(new OpenFileRequest { File = file }); } public void SendOpenFile(string file, int line) { - SendRequest<OpenFileResponse>(new OpenFileRequest {File = file, Line = line}); + SendRequest<OpenFileResponse>(new OpenFileRequest { File = file, Line = line }); } public void SendOpenFile(string file, int line, int column) { - SendRequest<OpenFileResponse>(new OpenFileRequest {File = file, Line = line, Column = column}); + SendRequest<OpenFileResponse>(new OpenFileRequest { File = file, Line = line, Column = column }); } } diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs index 6f11831b80..62db6e3af5 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs @@ -385,7 +385,7 @@ namespace GodotTools.Ides // However, it doesn't fix resource loading if the rest of the path is also case insensitive. string scriptFileLocalized = FsPathUtils.LocalizePathWithCaseChecked(request.ScriptFile); - var response = new CodeCompletionResponse {Kind = request.Kind, ScriptFile = request.ScriptFile}; + var response = new CodeCompletionResponse { Kind = request.Kind, ScriptFile = request.ScriptFile }; response.Suggestions = await Task.Run(() => Internal.CodeCompletionRequest(response.Kind, scriptFileLocalized ?? request.ScriptFile)); return response; diff --git a/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs b/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs index 651922d019..ecbe730adf 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs @@ -206,10 +206,10 @@ namespace GodotTools.Utils return searchDirs.Select(dir => Path.Combine(dir, name)).FirstOrDefault(File.Exists); return (from dir in searchDirs - select Path.Combine(dir, name) + select Path.Combine(dir, name) into path - from ext in windowsExts - select path + ext).FirstOrDefault(File.Exists); + from ext in windowsExts + select path + ext).FirstOrDefault(File.Exists); } [return: MaybeNull] |