Godot WIP

This commit is contained in:
Matt Parker
2025-08-18 18:13:22 +10:00
parent 0701af3ac3
commit c0c240cf0e
10 changed files with 232 additions and 10 deletions

View File

@@ -1,4 +1,14 @@
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Loader;
using Godot;
using Microsoft.Build.Locator;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Host.Mef;
using SharpIDE.Application.Features.Analysis;
using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
namespace SharpIDE.Godot;
@@ -8,13 +18,26 @@ public partial class IdeRoot : Control
private FileDialog _fileDialog = null!;
public override void _Ready()
{
MSBuildLocator.RegisterDefaults();
_openSlnButton = GetNode<Button>("%OpenSlnButton");
_fileDialog = GetNode<FileDialog>("%OpenSolutionDialog");
_fileDialog.FileSelected += OnFileSelected;
//_fileDialog.Visible = true;
}
private void OnFileSelected(string path)
private async void OnFileSelected(string path)
{
GD.Print($"Selected: {path}");
try
{
GD.Print($"Selected: {path}");
var solutionModel = await VsPersistenceMapper.GetSolutionModel(path);
RoslynAnalysis.StartSolutionAnalysis(path);
}
catch (Exception e)
{
GD.PrintErr($"Error loading solution: {e.Message}");
GD.PrintErr(e.StackTrace);
}
}
}