update project diagnostics in file on sln alteration
This commit is contained in:
@@ -15,13 +15,10 @@ using Microsoft.CodeAnalysis.MSBuild;
|
||||
using Microsoft.CodeAnalysis.Razor.SemanticTokens;
|
||||
using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem;
|
||||
using Microsoft.CodeAnalysis.Remote.Razor.SemanticTokens;
|
||||
using Microsoft.CodeAnalysis.Shared.Extensions;
|
||||
using Microsoft.CodeAnalysis.Shared.Utilities;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
using SharpIDE.Application.Features.Analysis.FixLoaders;
|
||||
using SharpIDE.Application.Features.Analysis.Razor;
|
||||
using SharpIDE.Application.Features.Build;
|
||||
using SharpIDE.Application.Features.Events;
|
||||
using SharpIDE.Application.Features.SolutionDiscovery;
|
||||
using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
|
||||
using SharpIDE.RazorAccess;
|
||||
|
||||
@@ -15,6 +15,8 @@ public class GlobalEvents
|
||||
public EventWrapper<SharpIdeProjectModel, Task> ProjectStoppedRunning { get; } = new(_ => Task.CompletedTask);
|
||||
public EventWrapper<ExecutionStopInfo, Task> DebuggerExecutionStopped { get; } = new(_ => Task.CompletedTask);
|
||||
public EventWrapper<SharpIdeFile, Task> IdeFileSavedToDisk { get; } = new(_ => Task.CompletedTask);
|
||||
/// A document changed, project was reloaded etc. Document changes include unsaved changes in the IDE.
|
||||
public EventWrapper<Task> SolutionAltered { get; } = new(() => Task.CompletedTask);
|
||||
|
||||
public FileSystemWatcherInternal FileSystemWatcherInternal { get; } = new();
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace SharpIDE.Application.Features.FilePersistence;
|
||||
#pragma warning disable VSTHRD011
|
||||
|
||||
/// Holds the in memory copies of files, and manages saving/loading them to/from disk.
|
||||
public class IdeFileManager
|
||||
public class IdeOpenTabsFileManager
|
||||
{
|
||||
private ConcurrentDictionary<SharpIdeFile, Lazy<Task<string>>> _openFiles = new();
|
||||
|
||||
@@ -35,6 +35,7 @@ public class IdeFileManager
|
||||
if (file.IsRoslynWorkspaceFile)
|
||||
{
|
||||
await RoslynAnalysis.UpdateDocument(file, newText);
|
||||
GlobalEvents.Instance.SolutionAltered.InvokeParallelFireAndForget();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +50,7 @@ public class IdeFileManager
|
||||
{
|
||||
var text = await textTask;
|
||||
await RoslynAnalysis.UpdateDocument(file, text);
|
||||
GlobalEvents.Instance.SolutionAltered.InvokeParallelFireAndForget();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user