Add IDE Diagnostics panel

This commit is contained in:
Matt Parker
2025-09-26 22:54:45 +10:00
parent 2d0101080c
commit 461cd96c15
8 changed files with 79 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
using Godot;
using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
using SharpIDE.Godot.Features.IdeDiagnostics;
using SharpIDE.Godot.Features.Problems;
namespace SharpIDE.Godot.Features.BottomPanel;
@@ -20,6 +21,7 @@ public partial class BottomPanelManager : Panel
private Control _debugPanel = null!;
private Control _buildPanel = null!;
private ProblemsPanel _problemsPanel = null!;
private IdeDiagnosticsPanel _ideDiagnosticsPanel = null!;
private Dictionary<BottomPanelType, Control> _panelTypeMap = [];
@@ -29,13 +31,15 @@ public partial class BottomPanelManager : Panel
_debugPanel = GetNode<Control>("%DebugPanel");
_buildPanel = GetNode<Control>("%BuildPanel");
_problemsPanel = GetNode<ProblemsPanel>("%ProblemsPanel");
_ideDiagnosticsPanel = GetNode<IdeDiagnosticsPanel>("%IdeDiagnosticsPanel");
_panelTypeMap = new Dictionary<BottomPanelType, Control>
{
{ BottomPanelType.Run, _runPanel },
{ BottomPanelType.Debug, _debugPanel },
{ BottomPanelType.Build, _buildPanel },
{ BottomPanelType.Problems, _problemsPanel }
{ BottomPanelType.Problems, _problemsPanel },
{ BottomPanelType.IdeDiagnostics, _ideDiagnosticsPanel }
};
GodotGlobalEvents.BottomPanelTabSelected += OnBottomPanelTabSelected;

View File

@@ -0,0 +1,8 @@
using Godot;
namespace SharpIDE.Godot.Features.IdeDiagnostics;
public partial class IdeDiagnosticsPanel : Control
{
}

View File

@@ -0,0 +1 @@
uid://1dbtk7cifd25

View File

@@ -0,0 +1,35 @@
[gd_scene load_steps=2 format=3 uid="uid://b0tjuqq3bca5e"]
[ext_resource type="Script" uid="uid://1dbtk7cifd25" path="res://Features/IdeDiagnostics/IdeDiagnosticsPanel.cs" id="1_qw18f"]
[node name="IdeDiagnosticsPanel" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_qw18f")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 0
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="Label" type="Label" parent="VBoxContainer/MarginContainer"]
layout_mode = 2
text = "IDE Diagnostics"
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
layout_mode = 2

View File

@@ -10,6 +10,7 @@ public partial class LeftSideBar : Panel
private Button _runButton = null!;
private Button _buildButton = null!;
private Button _debugButton = null!;
private Button _ideDiagnosticsButton = null!;
public override void _Ready()
{
@@ -18,11 +19,13 @@ public partial class LeftSideBar : Panel
_runButton = GetNode<Button>("%RunButton");
_buildButton = GetNode<Button>("%BuildButton");
_debugButton = GetNode<Button>("%DebugButton");
_ideDiagnosticsButton = GetNode<Button>("%IdeDiagnosticsButton");
_problemsButton.Toggled += toggledOn => GodotGlobalEvents.InvokeBottomPanelTabSelected(toggledOn ? BottomPanelType.Problems : null);
_runButton.Toggled += toggledOn => GodotGlobalEvents.InvokeBottomPanelTabSelected(toggledOn ? BottomPanelType.Run : null);
_buildButton.Toggled += toggledOn => GodotGlobalEvents.InvokeBottomPanelTabSelected(toggledOn ? BottomPanelType.Build : null);
_debugButton.Toggled += toggledOn => GodotGlobalEvents.InvokeBottomPanelTabSelected(toggledOn ? BottomPanelType.Debug : null);
_ideDiagnosticsButton.Toggled += toggledOn => GodotGlobalEvents.InvokeBottomPanelTabSelected(toggledOn ? BottomPanelType.IdeDiagnostics : null);
GodotGlobalEvents.BottomPanelTabExternallySelected += OnBottomPanelTabExternallySelected;
}
@@ -36,6 +39,7 @@ public partial class LeftSideBar : Panel
case BottomPanelType.Debug: _debugButton.ButtonPressed = true; break;
case BottomPanelType.Build: _buildButton.ButtonPressed = true; break;
case BottomPanelType.Problems: _problemsButton.ButtonPressed = true; break;
case BottomPanelType.IdeDiagnostics: _ideDiagnosticsButton.ButtonPressed = true; break;
default: throw new ArgumentOutOfRangeException(nameof(arg), arg, null);
}
});

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=3 uid="uid://biyhfwx36ium8"]
[gd_scene load_steps=10 format=3 uid="uid://biyhfwx36ium8"]
[ext_resource type="Script" uid="uid://bddno1bbvvp5q" path="res://Features/LeftSideBar/LeftSideBar.cs" id="1_rgaf0"]
[ext_resource type="ButtonGroup" uid="uid://c2nmo2x3va0gi" path="res://Features/LeftSideBar/LeftBottomSidebarButtonGroup.tres" id="2_1aad6"]
@@ -8,6 +8,7 @@
[ext_resource type="Texture2D" uid="uid://cre7q0efp4vrq" path="res://Features/LeftSideBar/Resources/SidebarRun.svg" id="5_jg03n"]
[ext_resource type="Texture2D" uid="uid://b0170ypw8uf3a" path="res://Features/LeftSideBar/Resources/Terminal.svg" id="6_ddh6f"]
[ext_resource type="Texture2D" uid="uid://butisxqww0boc" path="res://Features/LeftSideBar/Resources/SidebarDebug.svg" id="6_jg03n"]
[ext_resource type="Texture2D" uid="uid://dx8bt0adxpqgy" path="res://Features/LeftSideBar/Resources/Ide.svg" id="9_6ih3m"]
[node name="LeftSideBar" type="Panel"]
custom_minimum_size = Vector2(80, 0)
@@ -110,3 +111,18 @@ icon = ExtResource("6_ddh6f")
icon_alignment = 1
vertical_icon_alignment = 0
expand_icon = true
[node name="IdeDiagnosticsButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
focus_mode = 0
theme = ExtResource("3_prju6")
theme_override_font_sizes/font_size = 13
toggle_mode = true
button_group = ExtResource("2_1aad6")
text = "IDE"
icon = ExtResource("9_6ih3m")
icon_alignment = 1
vertical_icon_alignment = 0
expand_icon = true

View File

@@ -29,5 +29,6 @@ public enum BottomPanelType
Run,
Debug,
Build,
Problems
Problems,
IdeDiagnostics
}

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=3 uid="uid://b2oniigcp5ew5"]
[gd_scene load_steps=18 format=3 uid="uid://b2oniigcp5ew5"]
[ext_resource type="FontFile" uid="uid://38igu11xwba6" path="res://Inter-VariableFont.ttf" id="1_7ptyn"]
[ext_resource type="Script" uid="uid://bavypuy7b375x" path="res://IdeRoot.cs" id="1_whawi"]
@@ -13,6 +13,7 @@
[ext_resource type="PackedScene" uid="uid://tqpmww430cor" path="res://Features/Problems/ProblemsPanel.tscn" id="11_b7c1a"]
[ext_resource type="PackedScene" uid="uid://dkjips8oudqou" path="res://Features/Debug_/DebugPanel.tscn" id="11_s2dv6"]
[ext_resource type="PackedScene" uid="uid://8lk0qj233a7p" path="res://Features/Search/SearchWindow.tscn" id="13_7ptyn"]
[ext_resource type="PackedScene" uid="uid://b0tjuqq3bca5e" path="res://Features/IdeDiagnostics/IdeDiagnosticsPanel.tscn" id="13_woo5i"]
[sub_resource type="Theme" id="Theme_s2dv6"]
default_font = ExtResource("1_7ptyn")
@@ -156,6 +157,11 @@ unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="IdeDiagnosticsPanel" parent="VBoxContainer/HBoxContainer/InvertedVSplitContainer/BottomPanel" instance=ExtResource("13_woo5i")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="OpenSolutionDialog" type="FileDialog" parent="."]
unique_name_in_owner = true
title = "Open a File"