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 @@ -14,19 +14,19 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.Razor;
[method: ImportingConstructor]
[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
internal sealed class RazorRefactorNotifyWrapper(
[Import(AllowDefault = true)] IRazorRefactorNotifyService? implementation) : IRefactorNotifyService
[Import(AllowDefault = true)] Lazy<IRazorRefactorNotifyService>? implementation) : IRefactorNotifyService
{
private readonly IRazorRefactorNotifyService? _implementation = implementation;
private readonly Lazy<IRazorRefactorNotifyService>? _implementation = implementation;

public bool TryOnAfterGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure)
{
// Return true if there is no implementation so rename isn't blocked
return _implementation?.TryOnAfterGlobalSymbolRenamed(workspace, changedDocumentIDs, symbol, newName, throwOnFailure) ?? true;
return _implementation?.Value.TryOnAfterGlobalSymbolRenamed(workspace, changedDocumentIDs, symbol, newName, throwOnFailure) ?? true;
}

public bool TryOnBeforeGlobalSymbolRenamed(Workspace workspace, IEnumerable<DocumentId> changedDocumentIDs, ISymbol symbol, string newName, bool throwOnFailure)
{
// Return true if there is no implementation so rename isn't blocked
return _implementation?.TryOnBeforeGlobalSymbolRenamed(workspace, changedDocumentIDs, symbol, newName, throwOnFailure) ?? true;
return _implementation?.Value.TryOnBeforeGlobalSymbolRenamed(workspace, changedDocumentIDs, symbol, newName, throwOnFailure) ?? true;
}
}
Loading