another
This commit is contained in:
@@ -7,15 +7,11 @@ public static class VsPersistenceMapper
|
|||||||
public static async Task<SharpIdeSolutionModel> GetSolutionModel(string solutionFilePath, CancellationToken cancellationToken = default)
|
public static async Task<SharpIdeSolutionModel> GetSolutionModel(string solutionFilePath, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
using var _ = SharpIdeOtel.Source.StartActivity();
|
using var _ = SharpIdeOtel.Source.StartActivity();
|
||||||
var timer = Stopwatch.StartNew();
|
|
||||||
// This intermediate model is pretty much useless, but I have left it around as we grab the project nodes with it, which we might use later.
|
// This intermediate model is pretty much useless, but I have left it around as we grab the project nodes with it, which we might use later.
|
||||||
var intermediateModel = await IntermediateMapper.GetIntermediateModel(solutionFilePath, cancellationToken);
|
var intermediateModel = await IntermediateMapper.GetIntermediateModel(solutionFilePath, cancellationToken);
|
||||||
|
|
||||||
var solutionModel = new SharpIdeSolutionModel(solutionFilePath, intermediateModel);
|
var solutionModel = new SharpIdeSolutionModel(solutionFilePath, intermediateModel);
|
||||||
|
|
||||||
timer.Stop();
|
|
||||||
Console.WriteLine($"Solution model fully created in {timer.ElapsedMilliseconds} ms");
|
|
||||||
|
|
||||||
return solutionModel;
|
return solutionModel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using SharpIDE.Application.Features.Analysis;
|
using SharpIDE.Application.Features.Analysis;
|
||||||
using SharpIDE.Application.Features.Build;
|
using SharpIDE.Application.Features.Build;
|
||||||
using SharpIDE.Application.Features.Events;
|
using SharpIDE.Application.Features.Events;
|
||||||
@@ -46,6 +47,7 @@ public partial class IdeRoot : Control
|
|||||||
[Inject] private readonly IdeOpenTabsFileManager _openTabsFileManager = null!;
|
[Inject] private readonly IdeOpenTabsFileManager _openTabsFileManager = null!;
|
||||||
[Inject] private readonly RoslynAnalysis _roslynAnalysis = null!;
|
[Inject] private readonly RoslynAnalysis _roslynAnalysis = null!;
|
||||||
[Inject] private readonly SharpIdeSolutionModificationService _sharpIdeSolutionModificationService = null!;
|
[Inject] private readonly SharpIdeSolutionModificationService _sharpIdeSolutionModificationService = null!;
|
||||||
|
[Inject] private readonly ILogger<IdeRoot> _logger = null!;
|
||||||
|
|
||||||
public override void _EnterTree()
|
public override void _EnterTree()
|
||||||
{
|
{
|
||||||
@@ -136,7 +138,10 @@ public partial class IdeRoot : Control
|
|||||||
_ = Task.GodotRun(async () =>
|
_ = Task.GodotRun(async () =>
|
||||||
{
|
{
|
||||||
GD.Print($"Selected: {path}");
|
GD.Print($"Selected: {path}");
|
||||||
var solutionModel = await VsPersistenceMapper.GetSolutionModel(path);
|
var timer = Stopwatch.StartNew();
|
||||||
|
var solutionModel = await VsPersistenceMapper.GetSolutionModel(path); // TODO: Probably refactor into a DI Service
|
||||||
|
timer.Stop();
|
||||||
|
_logger.LogInformation("Solution model fully created in {ElapsedMilliseconds} ms", timer.ElapsedMilliseconds);
|
||||||
await _nodeReadyTcs.Task;
|
await _nodeReadyTcs.Task;
|
||||||
_solutionExplorerPanel.SolutionModel = solutionModel;
|
_solutionExplorerPanel.SolutionModel = solutionModel;
|
||||||
_codeEditorPanel.Solution = solutionModel;
|
_codeEditorPanel.Solution = solutionModel;
|
||||||
|
|||||||
Reference in New Issue
Block a user