@@ -83,7 +81,7 @@
@if (_solutionFilePath is not null)
{
-
+
@@ -107,6 +105,7 @@
private string? _solutionFilePath;
private SharpIdeSolutionModel? _solutionModel;
+ private ISharpIdeNode? _selectedNode;
private SharpIdeFile? _selectedFile;
private BottomPanelType? _selectedBottomPanel = null;
@@ -140,6 +139,31 @@
GlobalEvents.StartedRunningProject += OnStartedRunningProject;
}
+ private void OnProblemSelected(SharpIdeFile file)
+ {
+ _selectedFile = file;
+ _selectedNode = file;
+ var parent = _selectedFile.Parent;
+ parent.Expanded = true;
+ while (parent is IChildSharpIdeNode childNode)
+ {
+ if (childNode is not IExpandableSharpIdeNode expandableParent) throw new InvalidOperationException("Parent node must implement IExpandableSharpIdeNode");
+ expandableParent.Expanded = true;
+ parent = childNode.Parent;
+ }
+ if (parent is not SharpIdeSolutionModel solutionModel) throw new InvalidOperationException("Parent node must be a SharpIdeSolutionModel");
+ solutionModel.Expanded = true;
+ StateHasChanged();
+ }
+
+ private void AfterSelectedNodeChanged()
+ {
+ if (_selectedNode is SharpIdeFile file)
+ {
+ _selectedFile = file;
+ }
+ }
+
private async Task OnStartedRunningProject()
{
SelectBottomPanel(BottomPanelType.Run);
@@ -180,5 +204,4 @@
{
var dialogRef = await DialogService.ShowAsync("SharpIDE Settings", new DialogOptions { MaxWidth = MaxWidth.Medium, CloseButton = true });
}
-
}