dotnet/roslyn

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

开放

#27,203 创建于 2018年5月28日

 (0 条评论) (0 个反应) (0 位负责人)C# (4,257 个派生)batch import
Area-IDEBugFeature - Renamehelp wanted

仓库指标

星标
 (20,414 个星标)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 256 个 PR)

描述

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

贡献者指南