From 2097d1a51a71be899f540f9dd53e8e5c4dcb3270 Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Wed, 22 Oct 2025 22:30:30 +1000 Subject: [PATCH] refactor --- src/SharpIDE.Application/Features/Analysis/RoslynAnalysis.cs | 3 +-- src/SharpIDE.Godot/IdeRoot.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/SharpIDE.Application/Features/Analysis/RoslynAnalysis.cs b/src/SharpIDE.Application/Features/Analysis/RoslynAnalysis.cs index 9e012a8..efed9ad 100644 --- a/src/SharpIDE.Application/Features/Analysis/RoslynAnalysis.cs +++ b/src/SharpIDE.Application/Features/Analysis/RoslynAnalysis.cs @@ -484,8 +484,7 @@ public class RoslynAnalysis { using var _ = SharpIdeOtel.Source.StartActivity($"{nameof(RoslynAnalysis)}.{nameof(GetCodeCompletionsForDocumentAtPosition)}"); await _solutionLoadedTcs.Task; - var project = _workspace!.CurrentSolution.Projects.Single(s => s.FilePath == ((IChildSharpIdeNode)fileModel).GetNearestProjectNode()!.FilePath); - var document = project.Documents.Single(s => s.FilePath == fileModel.Path); + var document = await GetDocumentForSharpIdeFile(fileModel); Guard.Against.Null(document, nameof(document)); var completions = await GetCompletionsAsync(document, linePosition).ConfigureAwait(false); return completions; diff --git a/src/SharpIDE.Godot/IdeRoot.cs b/src/SharpIDE.Godot/IdeRoot.cs index b5aaa5e..ed8bf92 100644 --- a/src/SharpIDE.Godot/IdeRoot.cs +++ b/src/SharpIDE.Godot/IdeRoot.cs @@ -166,7 +166,7 @@ public partial class IdeRoot : Control var selectedFile = filesToOpen.SingleOrDefault(f => f.IsSelected); if (selectedFile.Item1 is not null) await GodotGlobalEvents.Instance.FileExternallySelected.InvokeParallelAsync(selectedFile.Item1, selectedFile.Item2); }); - + var tasks = solutionModel.AllProjects.Select(p => p.MsBuildEvaluationProjectTask).ToList(); await Task.WhenAll(tasks).ConfigureAwait(false); var runnableProjects = solutionModel.AllProjects.Where(p => p.IsRunnable).ToList();