dotnet/roslyn

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

Open

#27,203 opened on May 28, 2018

View on GitHub
 (0 comments) (0 reactions) (0 assignees)C# (20,414 stars) (4,257 forks)batch import
Area-IDEBugFeature - Renamehelp wanted

Description

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)<---

Contributor guide