display underline for diagnostics
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Loader;
|
||||
using System.Linq;
|
||||
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;
|
||||
|
||||
@@ -16,14 +12,18 @@ public partial class IdeRoot : Control
|
||||
{
|
||||
private Button _openSlnButton = null!;
|
||||
private FileDialog _fileDialog = null!;
|
||||
private SharpIdeCodeEdit _sharpIdeCodeEdit = null!;
|
||||
public override void _Ready()
|
||||
{
|
||||
MSBuildLocator.RegisterDefaults();
|
||||
|
||||
_openSlnButton = GetNode<Button>("%OpenSlnButton");
|
||||
_sharpIdeCodeEdit = GetNode<SharpIdeCodeEdit>("%SharpIdeCodeEdit");
|
||||
_fileDialog = GetNode<FileDialog>("%OpenSolutionDialog");
|
||||
_fileDialog.FileSelected += OnFileSelected;
|
||||
_openSlnButton.Pressed += () => _fileDialog.Visible = true;
|
||||
//_fileDialog.Visible = true;
|
||||
OnFileSelected(@"C:\Users\Matthew\Documents\Git\BlazorCodeBreaker\BlazorCodeBreaker.slnx");
|
||||
}
|
||||
|
||||
private async void OnFileSelected(string path)
|
||||
@@ -33,6 +33,12 @@ public partial class IdeRoot : Control
|
||||
GD.Print($"Selected: {path}");
|
||||
var solutionModel = await VsPersistenceMapper.GetSolutionModel(path);
|
||||
RoslynAnalysis.StartSolutionAnalysis(path);
|
||||
var infraProject = solutionModel.AllProjects.Single(s => s.Name == "Infrastructure");
|
||||
var diFile = infraProject.Files.Single(s => s.Name == "DependencyInjection.cs");
|
||||
var fileContents = await File.ReadAllTextAsync(diFile.Path);
|
||||
_sharpIdeCodeEdit.SetText(fileContents);
|
||||
var diagnostics = await RoslynAnalysis.GetDocumentDiagnostics(diFile);
|
||||
_sharpIdeCodeEdit.ProvideDiagnostics(diagnostics);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user