Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.Razor;
[ExportMetadata("Extensions", new string[] { "cshtml", "razor", })]
[method: ImportingConstructor]
[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
internal sealed partial class RazorDynamicFileInfoProvider(Lazy<LanguageServerWorkspaceFactory> workspaceFactory, ILoggerFactory loggerFactory) : IDynamicFileInfoProvider, ILspService, IOnInitialized
internal sealed partial class RazorDynamicFileInfoProvider(Lazy<LanguageServerWorkspaceFactory> workspaceFactory, ILoggerFactory loggerFactory) : IDynamicFileInfoProvider, ILspService, IOnInitialized, IDisposable
{
private RazorWorkspaceService? _razorWorkspaceService;
private RazorLspDynamicFileInfoProvider? _dynamicFileInfoProvider;
Expand Down Expand Up @@ -80,4 +80,11 @@ public async Task RemoveDynamicFileInfoAsync(ProjectId projectId, string? projec

await _dynamicFileInfoProvider.RemoveDynamicFileInfoAsync(workspaceFactory.Value.HostWorkspace, projectId, projectFilePath, filePath, cancellationToken).ConfigureAwait(false);
}

public void Dispose()
{
// Dispose is called when the LSP server is being shut down. Clear the dynamic file provider in case a workspace
// event is raised after, as the actual provider will try to make LSP requests.
_dynamicFileInfoProvider = null;
}
}
Loading