dotnet/roslyn

Attempt to drop light-bulb on a renamed generated symbol that no longer exists results in code fix crash

Open

#27,203 建立於 2018年5月28日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)C# (20,414 star) (4,257 fork)batch import
Area-IDEBugFeature - Renamehelp wanted

描述

Version Used:

Steps to Reproduce:

If you rename a symbol outside of the editor, the rename tracking code fix doesn't like it:

        private async Task<Guid> GetSingleFileGeneratorsGuid()
        {
            var generalProperties = await this.ProjectNode.ActiveProjectConfig.GetConfigurationGeneralPropertiesAsync(preferSnapshot: true);
            string guid = await generalProperties.SingleFileGeneratorsTypeGuid.GetEvaluatedValueAtEndAsync(); <!-- SingleFileGeneratorsTypeGuid comes from generated code from XAML that I renamed in the XAML

            return Guid.TryParse(guid, out Guid result) ? result : this.ProjectNode.ProjectTypeGuid;
        }
System.AggregateException : One or more errors occurred. ---> Invoked rename tracking smart tag but cannot find the symbol.
   at async Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking.RenameTrackingTaggerProvider.RenameTrackingCommitter.RenameSymbolAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking.RenameTrackingTaggerProvider.RenameTrackingCodeAction.ComputePreviewOperationsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.<>c__DisplayClass11_0.<GetPreviewAsync>b__0(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)
---> (Inner Exception #0) System.InvalidOperationException : Invoked rename tracking smart tag but cannot find the symbol.
   at async Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking.RenameTrackingTaggerProvider.RenameTrackingCommitter.RenameSymbolWorkerAsync(<Unknown Parameters>)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)<---

貢獻者指南

Attempt to drop light-bulb on a renamed generated symbol that no longer exists results in code fix crash · dotnet/roslyn#27203 | Good First Issue