Skip to content

Commit 9d3c4fc

Browse files
committed
Fix merge issues
1 parent 01dd912 commit 9d3c4fc

3 files changed

Lines changed: 26 additions & 20 deletions

File tree

‎JavaToCSharpCli/Program.cs‎

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,26 @@ public static async Task Main(string[] args)
9494
{
9595
var rootCommand = new RootCommand("Java to C# Converter")
9696
{
97-
Description = "A syntactic transformer of source code from Java to C#."
97+
Description = "A syntactic transformer of source code from Java to C#.",
9898
};
9999

100-
rootCommand.Add(CreateFileCommand());
101-
rootCommand.Add(CreateDirectoryCommand());
100+
rootCommand.Subcommands.Add(CreateFileCommand());
101+
rootCommand.Subcommands.Add(CreateDirectoryCommand());
102102

103-
rootCommand.Add(_includeSubdirectoriesOption);
104-
rootCommand.Add(_includeUsingsOption);
105-
rootCommand.Add(_includeNamespaceOption);
106-
rootCommand.Add(_includeCommentsOption);
107-
rootCommand.Add(_useDebugAssertOption);
108-
rootCommand.Add(_startInterfaceNamesWithIOption);
109-
rootCommand.Add(_commentUnrecognizedCodeOption);
110-
rootCommand.Add(_systemOutToConsoleOption);
111-
rootCommand.Add(_fileScopedNamespacesOption);
112-
rootCommand.Add(_clearDefaultUsingsOption);
113-
rootCommand.Add(_addUsingsOption);
114-
rootCommand.Add(_mappingsFileNameOption);
103+
rootCommand.Options.Add(_includeSubdirectoriesOption);
104+
rootCommand.Options.Add(_includeUsingsOption);
105+
rootCommand.Options.Add(_includeNamespaceOption);
106+
rootCommand.Options.Add(_includeCommentsOption);
107+
rootCommand.Options.Add(_useDebugAssertOption);
108+
rootCommand.Options.Add(_startInterfaceNamesWithIOption);
109+
rootCommand.Options.Add(_commentUnrecognizedCodeOption);
110+
rootCommand.Options.Add(_systemOutToConsoleOption);
111+
rootCommand.Options.Add(_fileScopedNamespacesOption);
112+
rootCommand.Options.Add(_clearDefaultUsingsOption);
113+
rootCommand.Options.Add(_addUsingsOption);
114+
rootCommand.Options.Add(_mappingsFileNameOption);
115115

116-
var parseResult = rootCommand.Parse(args);
117-
118-
await parseResult.InvokeAsync();
116+
await rootCommand.Parse(args).InvokeAsync();
119117

120118
// flush logs
121119
_loggerFactory.Dispose();
@@ -258,13 +256,17 @@ private static void ConvertToCSharpDir(DirectoryInfo inputDirectory, DirectoryIn
258256
}
259257
}
260258
else
259+
{
261260
_logger.LogError("Java input folder {path} doesn't exist!", inputDirectory);
261+
}
262262
}
263263

264264
private static void ConvertToCSharpFile(FileSystemInfo inputFile, FileSystemInfo? outputFile, JavaConversionOptions options, bool overwrite = true)
265265
{
266266
if (!overwrite && outputFile is { Exists: true })
267+
{
267268
_logger.LogInformation("{outputFilePath} exists, skip to next.", outputFile);
269+
}
268270
else if (inputFile.Exists)
269271
{
270272
try
@@ -302,7 +304,9 @@ private static void ConvertToCSharpFile(FileSystemInfo inputFile, FileSystemInfo
302304
}
303305
}
304306
else
307+
{
305308
_logger.LogError("Java input file {filePath} doesn't exist!", inputFile.FullName);
309+
}
306310
}
307311

308312
private static void OutputFileOrPrint(string? fileName, string contents)

‎JavaToCSharpGui/App.axaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<Application.Styles>
1212
<FluentTheme /> <!-- FluentTheme will get overridden by the SemiTheme below but is needed for AvaloniaEdit -->
1313
<semi:SemiTheme Locale="en-US" />
14-
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml" />
14+
<semi:AvaloniaEditSemiTheme />
1515
</Application.Styles>
1616
</Application>

‎JavaToCSharpGui/Infrastructure/TextClipboard.cs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ internal class TextClipboard(IClipboard? clipboard) : ITextClipboard
1212
{
1313
return null;
1414
}
15+
1516
return await clipboard.TryGetTextAsync();
1617
}
1718

1819
/// <inheritdoc />
1920
public async Task SetTextAsync(string? text)
2021
{
21-
if(clipboard is null)
22+
if (clipboard is null)
2223
{
2324
return;
2425
}
26+
2527
await clipboard.SetTextAsync(text);
2628
}
2729
}

0 commit comments

Comments
 (0)