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 合併指標
 (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)<---

貢獻者指南