From a4628383481ee3e30571c58b32b2c5331eedd491 Mon Sep 17 00:00:00 2001 From: danimester23 Date: Sat, 4 Apr 2026 19:50:15 +0200 Subject: [PATCH 1/4] Implement support multi projet for the csharp parser --- .gitignore | 3 + plugins/csharp/parser/src/csharpparser.cpp | 22 +- .../parser/src_csharp/CSharpParser.csproj | 1 + plugins/csharp/parser/src_csharp/Program.cs | 381 +++++++++++++++++- 4 files changed, 391 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index b3a52364a..02a8040b1 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ build/ build_*/ install/ install_*/ + +# Mac OS specific files +.DS_Store diff --git a/plugins/csharp/parser/src/csharpparser.cpp b/plugins/csharp/parser/src/csharpparser.cpp index 490c82f56..dda79acd5 100644 --- a/plugins/csharp/parser/src/csharpparser.cpp +++ b/plugins/csharp/parser/src/csharpparser.cpp @@ -42,6 +42,11 @@ bool CsharpParser::parse() bool success = true; std::vector paths = _ctx.options["input"].as>(); + if (paths.empty()) + { + LOG(error) << "No input path specified for C# parser!"; + return false; + } std::string buildPath = _ctx.options["build-dir"].as(); if (acceptProjectBuildPath(buildPath)) @@ -86,14 +91,11 @@ bool CsharpParser::parseProjectBuildPath( command.append("' "); command.append(std::to_string(_ctx.options["jobs"].as())); - for (auto p : paths_) + for (const auto& inputPath : paths_) { - if (fs::is_directory(p)) - { - command.append(" '"); - command.append(p); - command.append("' "); - } + command.append(" '"); + command.append(inputPath); + command.append("'"); } LOG(debug) << "CSharpParser command: " << command; @@ -113,7 +115,7 @@ bool CsharpParser::parseProjectBuildPath( while(std::getline(log_str, line, '\n')) { - if (line[0] == '+' || line[0] == '-') + if (!line.empty() && (line[0] == '+' || line[0] == '-')) { addSource(line.substr(1), line[0] == '-'); if (line[0] == '+') @@ -125,6 +127,10 @@ bool CsharpParser::parseProjectBuildPath( countPart++; } } + else if (!line.empty()) + { + LOG(debug) << "[CSharpParser] " << line; + } } ch::steady_clock::time_point after = ch::steady_clock::now(); diff --git a/plugins/csharp/parser/src_csharp/CSharpParser.csproj b/plugins/csharp/parser/src_csharp/CSharpParser.csproj index ee513d5b9..173050c6b 100644 --- a/plugins/csharp/parser/src_csharp/CSharpParser.csproj +++ b/plugins/csharp/parser/src_csharp/CSharpParser.csproj @@ -15,6 +15,7 @@ + all diff --git a/plugins/csharp/parser/src_csharp/Program.cs b/plugins/csharp/parser/src_csharp/Program.cs index a9b2b23a5..27e2e04b4 100644 --- a/plugins/csharp/parser/src_csharp/Program.cs +++ b/plugins/csharp/parser/src_csharp/Program.cs @@ -7,8 +7,11 @@ using System.IO; using System.Collections; using System.Collections.Generic; +using System.Text.RegularExpressions; using System.Threading.Tasks; using CSharpParser.model; +using Microsoft.Build.Locator; +using Microsoft.CodeAnalysis.MSBuild; namespace CSharpParser { @@ -20,8 +23,9 @@ class Program private static string _buildDirBase = ""; private static string _connectionString = ""; - static int Main(string[] args) + static async Task Main(string[] args) { + MSBuildLocator.RegisterDefaults(); _rootDir = new List(); int threadNum = 4; @@ -37,7 +41,7 @@ static int Main(string[] args) _rootDir.Add(args[i].Replace("'", "")); } } - catch (Exception e) + catch (Exception) { WriteLine("Error in parsing command!"); return 1; @@ -91,9 +95,72 @@ static int Main(string[] args) CsharpDbContext _context = new CsharpDbContext(options); _context.Database.Migrate(); + if (_rootDir.Count == 0) + { + WriteLine("Missing input path argument in CSharpParser!"); + return 1; + } + + string primaryInput = _rootDir[0]; + + if (IsSolutionInput(primaryInput)) + { + await ParseSolutionPathAsync(primaryInput, csharpConnectionString, threadNum); + return 0; + } + + if (IsProjectInput(primaryInput)) + { + var projectInputs = _rootDir + .Where(IsProjectInput) + .Distinct(StringComparer.OrdinalIgnoreCase) + .ToList(); + + await ParseProjectsByPathAsync(projectInputs, csharpConnectionString, threadNum); + return 0; + } + + if (Directory.Exists(primaryInput)) + { + await ParseLegacyMode(csharpConnectionString, threadNum); + return 0; + } + + if (File.Exists(primaryInput)) + { + Console.Error.WriteLine($"Unsupported file type: {primaryInput}"); + Console.Error.WriteLine("Supported: .sln, .slnx, .csproj"); + return 1; + } + + WriteLine("Unsupported input path in CSharpParser!"); + return 1; + } + + private static bool IsSolutionInput(string inputPath) + { + return File.Exists(inputPath) + && (inputPath.EndsWith(".sln", StringComparison.OrdinalIgnoreCase) + || inputPath.EndsWith(".slnx", StringComparison.OrdinalIgnoreCase)); + } + + private static bool IsProjectInput(string inputPath) + { + return File.Exists(inputPath) + && inputPath.EndsWith(".csproj", StringComparison.OrdinalIgnoreCase); + } + + private static async Task ParseLegacyMode(string csharpConnectionString, int threadNum) + { List allFiles = new List(); foreach (var p in _rootDir) { + if (!Directory.Exists(p)) + { + WriteLine("Skipping non-directory input in legacy mode: " + p); + continue; + } + Console.WriteLine(p); allFiles.AddRange(GetSourceFilesFromDir(p, ".cs")); } @@ -102,10 +169,13 @@ static int Main(string[] args) { WriteLine(f); } + IEnumerable assemblies = GetSourceFilesFromDir(_buildDir, ".dll"); IEnumerable assemblies_base = assemblies; - if (args.Length == 5) + if (Directory.Exists(_buildDirBase)) + { assemblies_base = GetSourceFilesFromDir(_buildDirBase, ".dll"); + } List trees = new List(); foreach (string file in allFiles) @@ -119,7 +189,7 @@ static int Main(string[] args) CSharpCompilation compilation = CSharpCompilation.Create("CSharpCompilation") .AddReferences(MetadataReference.CreateFromFile(typeof(object).Assembly.Location)) .AddSyntaxTrees(trees); - + foreach (string file in assemblies_base) { compilation = compilation.AddReferences(MetadataReference.CreateFromFile(file)); @@ -129,10 +199,7 @@ static int Main(string[] args) compilation = compilation.AddReferences(MetadataReference.CreateFromFile(file)); } - var runtask = ParalellRun(csharpConnectionString, threadNum, trees, compilation); - int ret = runtask.Result; - - return 0; + await ParalellRun(csharpConnectionString, threadNum, trees, compilation); } private static async Task ParalellRun(string csharpConnectionString, int threadNum, @@ -286,5 +353,303 @@ private static string transformConnectionString() return csharpConnectionString; } + + private static async Task ParseSolutionPathAsync( + string solutionPath, + string csharpConnectionString, + int threadCount) + { + try + { + var solution = await LoadSolutionAsync(solutionPath); + int documentCount = solution.Projects + .SelectMany(p => p.Documents) + .Count(d => !string.IsNullOrEmpty(d.FilePath)); + + if (solution.Projects.Any() && documentCount > 0) + { + await ParseSolutionAsync(solution, csharpConnectionString, threadCount); + return; + } + + Console.WriteLine( + "OpenSolutionAsync returned no usable documents, trying manual project discovery."); + } + catch (Exception ex) + { + Console.Error.WriteLine($"OpenSolutionAsync failed: {ex.Message}"); + Console.WriteLine("Trying manual project discovery from solution file."); + } + + var projectPaths = ExtractProjectPathsFromSolution(solutionPath); + if (projectPaths.Count == 0) + { + Console.Error.WriteLine($"No C# projects found in solution: {solutionPath}"); + return; + } + + await ParseProjectsByPathAsync(projectPaths, csharpConnectionString, threadCount); + } + + private static List ExtractProjectPathsFromSolution(string solutionPath) + { + var projectPaths = new List(); + var solutionDir = Path.GetDirectoryName(solutionPath) ?? string.Empty; + + // Works for both classic .sln rows and .slnx quoted project paths. + var csprojRegex = new Regex( + "\"([^\"]+\\.csproj)\"", + RegexOptions.IgnoreCase | RegexOptions.Compiled); + + IEnumerable solutionLines; + try + { + solutionLines = File.ReadLines(solutionPath); + } + catch (Exception ex) + { + Console.Error.WriteLine($"Failed to read solution file '{solutionPath}': {ex.Message}"); + return projectPaths; + } + + foreach (var line in solutionLines) + { + var matches = csprojRegex.Matches(line); + foreach (Match match in matches) + { + var relativeProjectPath = match.Groups[1].Value.Trim(); + if (string.IsNullOrEmpty(relativeProjectPath)) + { + continue; + } + + var normalizedProjectPath = relativeProjectPath + .Replace('\\', Path.DirectorySeparatorChar) + .Replace('/', Path.DirectorySeparatorChar); + + var fullProjectPath = Path.GetFullPath( + Path.Combine(solutionDir, normalizedProjectPath)); + + if (!File.Exists(fullProjectPath)) + { + Console.Error.WriteLine( + $"Project path from solution not found: {fullProjectPath}"); + continue; + } + + projectPaths.Add(fullProjectPath); + } + } + + return projectPaths + .Distinct(StringComparer.OrdinalIgnoreCase) + .ToList(); + } + + private static async Task ParseProjectsByPathAsync( + List projectPaths, + string csharpConnectionString, + int threadCount) + { + Console.WriteLine($"Fallback project count: {projectPaths.Count}"); + foreach (var projectPath in projectPaths) + { + try + { + Console.WriteLine($"Fallback loading project: {projectPath}"); + var workspace = CreateMsBuildWorkspace(); + var project = await workspace.OpenProjectAsync(projectPath); + await ParseProjectAsync( + project, + csharpConnectionString, + threadCount); + } + catch (Exception ex) + { + Console.Error.WriteLine( + $"Fallback load failed for '{projectPath}': {ex.Message}"); + } + } + } + + private static MSBuildWorkspace CreateMsBuildWorkspace() + { + var workspace = MSBuildWorkspace.Create(); + workspace.LoadMetadataForReferencedProjects = true; + workspace.WorkspaceFailed += (sender, args) => + { + Console.Error.WriteLine($"Workspace warning: {args.Diagnostic.Message}"); + }; + + return workspace; + } + + private static async Task LoadInputAsync(string inputPath) + { + if (File.Exists(inputPath)) + { + if (inputPath.EndsWith(".sln", StringComparison.OrdinalIgnoreCase) || + inputPath.EndsWith(".slnx", StringComparison.OrdinalIgnoreCase)) + { + return await LoadSolutionAsync(inputPath); + } + if (inputPath.EndsWith(".csproj", StringComparison.OrdinalIgnoreCase)) + { + return await LoadProjectAsync(inputPath); + } + else + { + Console.Error.WriteLine($"Unsupported file type: {inputPath}"); + Console.Error.WriteLine("Supported: .sln, .slnx, .csproj"); + return null; + } + } + if (Directory.Exists(inputPath)) + { + return null; + } + else + { + Console.Error.WriteLine($"Input path not found: {inputPath}"); + return null; + } + } + + private static async Task LoadSolutionAsync(string solutionPath) + { + Console.WriteLine($"Loading solution: {solutionPath}"); + var workspace = CreateMsBuildWorkspace(); + + var solution = await workspace.OpenSolutionAsync(solutionPath); + Console.WriteLine($"Solution loaded: {solution.FilePath}"); + Console.WriteLine($"Projects found: {solution.Projects.Count()}"); + return solution; + } + + private static async Task LoadProjectAsync(string projectPath) + { + Console.WriteLine($"Loading project: {projectPath}"); + var workspace = CreateMsBuildWorkspace(); + + var project = await workspace.OpenProjectAsync(projectPath); + Console.WriteLine($"Project loaded: {project.Name}"); + + return project.Solution; + } + + private static async Task ParseSolutionAsync( + Solution solution, + string csharpConnectionString, + int threadCount) + { + Console.WriteLine($"Solution loaded: {solution.FilePath}"); + Console.WriteLine($"Projects found: {solution.Projects.Count()}"); + + foreach (var project in solution.Projects) + { + await ParseProjectAsync(project, csharpConnectionString, threadCount); + } + } + + private static async Task ParseProjectAsync( + Project project, + string csharpConnectionString, + int threadCount) + { + Console.WriteLine($"Processing project: {project.Name}"); + + var compilation = await project.GetCompilationAsync(); + + if (compilation == null) + { + Console.WriteLine($"- Compilation failed for {project.Name}"); + return; + } + + var documents = project.Documents + .Where(d => !string.IsNullOrEmpty(d.FilePath)) + .ToList(); + Console.WriteLine($"- Documents in {project.Name}: {documents.Count}"); + + await ProcessDocumentsInParallel( + documents, + compilation, + csharpConnectionString, + threadCount, + project.Name + ); + } + + private static async Task ProcessDocumentsInParallel( + List documents, + Compilation compilation, + string csharpConnectionString, + int threadCount, + string projectName) + { + if (documents.Count == 0) + { + return; + } + + var tasks = new List(); + int effectiveThreadCount = Math.Max(1, Math.Min(threadCount, documents.Count)); + var documentGroups = documents.Chunk(documents.Count / effectiveThreadCount + 1); + + foreach (var group in documentGroups) + { + tasks.Add(Task.Run(async () => + { + var options = new DbContextOptionsBuilder() + .UseNpgsql(csharpConnectionString) + .Options; + var localDbContext = new CsharpDbContext(options); + + foreach (var document in group) + { + await ProcessSingleDocument( + document, + compilation, + localDbContext, + projectName + ); + } + + await localDbContext.SaveChangesAsync(); + })); + } + await Task.WhenAll(tasks); + } + + private static async Task ProcessSingleDocument( + Document document, + Compilation compilation, + CsharpDbContext dbContext, + string projectName) + { + try + { + var syntaxTree = await document.GetSyntaxTreeAsync(); + if (syntaxTree == null) return; + + var semanticModel = compilation.GetSemanticModel(syntaxTree); + + var visitor = new AstVisitor( + dbContext, + semanticModel, + syntaxTree); + + var root = await syntaxTree.GetRootAsync(); + visitor.Visit(root); + + string status = visitor.FullyParsed ? "+" : "-"; + Console.WriteLine($"{status}{document.FilePath}"); + } + catch (Exception ex) + { + Console.Error.WriteLine($"Error parsing {document.FilePath}: {ex.Message}"); + Console.WriteLine($"-{document.FilePath}"); + } + } } } From 1bf2bd8d0f5c1b3a960564a44cd180fa7ba0e528 Mon Sep 17 00:00:00 2001 From: danimester23 Date: Mon, 27 Apr 2026 21:57:25 +0200 Subject: [PATCH 2/4] Fix issues --- plugins/csharp/parser/src_csharp/Program.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/csharp/parser/src_csharp/Program.cs b/plugins/csharp/parser/src_csharp/Program.cs index 27e2e04b4..927d61047 100644 --- a/plugins/csharp/parser/src_csharp/Program.cs +++ b/plugins/csharp/parser/src_csharp/Program.cs @@ -385,7 +385,8 @@ private static async Task ParseSolutionPathAsync( if (projectPaths.Count == 0) { Console.Error.WriteLine($"No C# projects found in solution: {solutionPath}"); - return; + throw new InvalidOperationException( + $"No C# projects found in solution: {solutionPath}"); } await ParseProjectsByPathAsync(projectPaths, csharpConnectionString, threadCount); @@ -457,7 +458,7 @@ private static async Task ParseProjectsByPathAsync( try { Console.WriteLine($"Fallback loading project: {projectPath}"); - var workspace = CreateMsBuildWorkspace(); + using var workspace = CreateMsBuildWorkspace(); var project = await workspace.OpenProjectAsync(projectPath); await ParseProjectAsync( project, @@ -518,7 +519,7 @@ private static async Task LoadInputAsync(string inputPath) private static async Task LoadSolutionAsync(string solutionPath) { Console.WriteLine($"Loading solution: {solutionPath}"); - var workspace = CreateMsBuildWorkspace(); + using var workspace = CreateMsBuildWorkspace(); var solution = await workspace.OpenSolutionAsync(solutionPath); Console.WriteLine($"Solution loaded: {solution.FilePath}"); @@ -529,7 +530,7 @@ private static async Task LoadSolutionAsync(string solutionPath) private static async Task LoadProjectAsync(string projectPath) { Console.WriteLine($"Loading project: {projectPath}"); - var workspace = CreateMsBuildWorkspace(); + using var workspace = CreateMsBuildWorkspace(); var project = await workspace.OpenProjectAsync(projectPath); Console.WriteLine($"Project loaded: {project.Name}"); From e5b49ebf3c8ce02d24494bd6849b507192aa731d Mon Sep 17 00:00:00 2001 From: danimester23 Date: Mon, 11 May 2026 17:39:44 +0200 Subject: [PATCH 3/4] Fix issues --- plugins/csharp/parser/src_csharp/Program.cs | 106 +++++++------------- 1 file changed, 38 insertions(+), 68 deletions(-) diff --git a/plugins/csharp/parser/src_csharp/Program.cs b/plugins/csharp/parser/src_csharp/Program.cs index 927d61047..c4f0c08b3 100644 --- a/plugins/csharp/parser/src_csharp/Program.cs +++ b/plugins/csharp/parser/src_csharp/Program.cs @@ -1,5 +1,4 @@ -using static System.Console; -using System.Linq; +using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.EntityFrameworkCore; @@ -25,7 +24,16 @@ class Program static async Task Main(string[] args) { - MSBuildLocator.RegisterDefaults(); + try + { + MSBuildLocator.RegisterDefaults(); + } + catch (Exception ex) + { + Console.Error.WriteLine($"Failed to register MSBuild: {ex.Message}"); + return 1; + } + _rootDir = new List(); int threadNum = 4; @@ -43,7 +51,7 @@ static async Task Main(string[] args) } catch (Exception) { - WriteLine("Error in parsing command!"); + Console.WriteLine("Error in parsing command!"); return 1; } /*if (args.Length < 3) @@ -85,23 +93,24 @@ static async Task Main(string[] args) return 1; }*/ - //Converting the connectionstring into entiy framwork style connectionstring + if (_rootDir.Count == 0) + { + Console.WriteLine("Missing input path argument in CSharpParser!"); + return 1; + } + + string primaryInput = _rootDir[0]; + + //Converting the connectionstring into entity framework style connectionstring string csharpConnectionString = transformConnectionString(); var options = new DbContextOptionsBuilder() .UseNpgsql(csharpConnectionString) .Options; - CsharpDbContext _context = new CsharpDbContext(options); + await using var _context = new CsharpDbContext(options); _context.Database.Migrate(); - if (_rootDir.Count == 0) - { - WriteLine("Missing input path argument in CSharpParser!"); - return 1; - } - - string primaryInput = _rootDir[0]; if (IsSolutionInput(primaryInput)) { @@ -133,7 +142,7 @@ static async Task Main(string[] args) return 1; } - WriteLine("Unsupported input path in CSharpParser!"); + Console.WriteLine("Unsupported input path in CSharpParser!"); return 1; } @@ -157,7 +166,7 @@ private static async Task ParseLegacyMode(string csharpConnectionString, int thr { if (!Directory.Exists(p)) { - WriteLine("Skipping non-directory input in legacy mode: " + p); + Console.WriteLine("Skipping non-directory input in legacy mode: " + p); continue; } @@ -167,7 +176,7 @@ private static async Task ParseLegacyMode(string csharpConnectionString, int thr foreach (var f in allFiles) { - WriteLine(f); + Console.WriteLine(f); } IEnumerable assemblies = GetSourceFilesFromDir(_buildDir, ".dll"); @@ -184,7 +193,7 @@ private static async Task ParseLegacyMode(string csharpConnectionString, int thr SyntaxTree tree = CSharpSyntaxTree.ParseText(programText, null, file); trees.Add(tree); } - Write(trees.Count); + Console.Write(trees.Count); CSharpCompilation compilation = CSharpCompilation.Create("CSharpCompilation") .AddReferences(MetadataReference.CreateFromFile(typeof(object).Assembly.Location)) @@ -220,7 +229,7 @@ private static async Task ParalellRun(string csharpConnectionString, int th var ParsingTasks = new List>(); int maxThread = threadNum < trees.Count() ? threadNum : trees.Count(); - WriteLine(threadNum); + Console.WriteLine(threadNum); for (int i = 0; i < maxThread; i++) { ParsingTasks.Add(ParseTree(contextList[i],trees[i],compilation,i)); @@ -254,11 +263,11 @@ private static async Task ParseTree(CsharpDbContext context, { var ParsingTask = Task.Run(() => { - WriteLine("ParallelRun " + tree.FilePath); + Console.WriteLine("ParallelRun " + tree.FilePath); SemanticModel model = compilation.GetSemanticModel(tree); var visitor = new AstVisitor(context, model, tree); visitor.Visit(tree.GetCompilationUnitRoot()); - WriteLine((visitor.FullyParsed ? "+" : "-") + tree.FilePath); + Console.WriteLine((visitor.FullyParsed ? "+" : "-") + tree.FilePath); return index; }); return await ParsingTask; @@ -287,12 +296,12 @@ public static IEnumerable GetSourceFilesFromDir(string root, string exte } catch (UnauthorizedAccessException e) { - WriteLine(e.Message); + Console.WriteLine(e.Message); continue; } catch (System.IO.DirectoryNotFoundException e) { - WriteLine(e.Message); + Console.WriteLine(e.Message); continue; } @@ -485,36 +494,6 @@ private static MSBuildWorkspace CreateMsBuildWorkspace() return workspace; } - private static async Task LoadInputAsync(string inputPath) - { - if (File.Exists(inputPath)) - { - if (inputPath.EndsWith(".sln", StringComparison.OrdinalIgnoreCase) || - inputPath.EndsWith(".slnx", StringComparison.OrdinalIgnoreCase)) - { - return await LoadSolutionAsync(inputPath); - } - if (inputPath.EndsWith(".csproj", StringComparison.OrdinalIgnoreCase)) - { - return await LoadProjectAsync(inputPath); - } - else - { - Console.Error.WriteLine($"Unsupported file type: {inputPath}"); - Console.Error.WriteLine("Supported: .sln, .slnx, .csproj"); - return null; - } - } - if (Directory.Exists(inputPath)) - { - return null; - } - else - { - Console.Error.WriteLine($"Input path not found: {inputPath}"); - return null; - } - } private static async Task LoadSolutionAsync(string solutionPath) { @@ -527,16 +506,6 @@ private static async Task LoadSolutionAsync(string solutionPath) return solution; } - private static async Task LoadProjectAsync(string projectPath) - { - Console.WriteLine($"Loading project: {projectPath}"); - using var workspace = CreateMsBuildWorkspace(); - - var project = await workspace.OpenProjectAsync(projectPath); - Console.WriteLine($"Project loaded: {project.Name}"); - - return project.Solution; - } private static async Task ParseSolutionAsync( Solution solution, @@ -597,14 +566,15 @@ private static async Task ProcessDocumentsInParallel( int effectiveThreadCount = Math.Max(1, Math.Min(threadCount, documents.Count)); var documentGroups = documents.Chunk(documents.Count / effectiveThreadCount + 1); + var options = new DbContextOptionsBuilder() + .UseNpgsql(csharpConnectionString) + .Options; + foreach (var group in documentGroups) { tasks.Add(Task.Run(async () => { - var options = new DbContextOptionsBuilder() - .UseNpgsql(csharpConnectionString) - .Options; - var localDbContext = new CsharpDbContext(options); + await using var localDbContext = new CsharpDbContext(options); foreach (var document in group) { @@ -644,12 +614,12 @@ private static async Task ProcessSingleDocument( visitor.Visit(root); string status = visitor.FullyParsed ? "+" : "-"; - Console.WriteLine($"{status}{document.FilePath}"); + Console.WriteLine($"{status} [{projectName}] {document.FilePath}"); } catch (Exception ex) { Console.Error.WriteLine($"Error parsing {document.FilePath}: {ex.Message}"); - Console.WriteLine($"-{document.FilePath}"); + Console.WriteLine($"- [{projectName}] {document.FilePath}"); } } } From ebf106683e945a9e4d49f98aaa403e0ac2bcc6d6 Mon Sep 17 00:00:00 2001 From: danimester23 Date: Mon, 11 May 2026 21:18:40 +0200 Subject: [PATCH 4/4] Fix issues --- plugins/csharp/parser/src_csharp/Program.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/csharp/parser/src_csharp/Program.cs b/plugins/csharp/parser/src_csharp/Program.cs index c4f0c08b3..da33c135f 100644 --- a/plugins/csharp/parser/src_csharp/Program.cs +++ b/plugins/csharp/parser/src_csharp/Program.cs @@ -614,12 +614,14 @@ private static async Task ProcessSingleDocument( visitor.Visit(root); string status = visitor.FullyParsed ? "+" : "-"; - Console.WriteLine($"{status} [{projectName}] {document.FilePath}"); + Console.WriteLine($"[{projectName}] {document.FilePath}"); + Console.WriteLine($"{status}{document.FilePath}"); } catch (Exception ex) { Console.Error.WriteLine($"Error parsing {document.FilePath}: {ex.Message}"); - Console.WriteLine($"- [{projectName}] {document.FilePath}"); + Console.WriteLine($"[{projectName}] {document.FilePath}"); + Console.WriteLine($"-{document.FilePath}"); } } }