Skip to content

Roslyn crashes F# rename when F# project contains cshtml file #16394

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


  1. Open reproduction project
  2. Open CreateAccountPage.fs
  3. Try to rename Token property using F2 (or Ctrl+R,R)

See the attached video for details

System.Exception : The file 'C:\Users\Andrii\Dev\Projects\Marketplace\Server\Pages\Error.cshtml.reAnT4S4KLCYARJg.ide.g.cs' was not part of the project. Did you call InvalidateConfiguration when the list of files in the project changed?
   at FSharp.Compiler.CodeAnalysis.IncrementalBuilder.GetSlotOfFileName(String fileName)
   at FSharp.Compiler.CodeAnalysis.IncrementalBuilder.GetParseResultsForFile(String fileName)
   at <StartupCode$FSharp-Compiler-Service>.$Service[Redacted]@[Redacted]Tuple`2 _arg13)
   at [Redacted]@[Redacted]T x)
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt,b result1,FSharpFunc`2 userCode)
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.VisualStudio.FSharp.Editor.WorkspaceExtensions.Project-FindFSharpReferencesAsync@325-11[a](<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.VisualStudio.FSharp.Editor.WorkspaceExtensions.Project-FindFSharpReferencesAsync@326-33(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.VisualStudio.FSharp.Editor.WorkspaceExtensions.Project-FindFSharpReferencesAsync@286[a](<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.VisualStudio.FSharp.Editor.SymbolHelpers.getSymbolUsesInProjects@86-3(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.VisualStudio.FSharp.Editor.SymbolHelpers.getSymbolUsesInProjects@79-1(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.VisualStudio.FSharp.Editor.SymbolHelpers.findSymbolUses@97(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.VisualStudio.FSharp.Editor.SymbolHelpers.getSymbolUses@147(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.VisualStudio.FSharp.Editor.SymbolHelpers.getSymbolUsesInSolution@159(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at <StartupCode$FSharp-Editor>.$InlineRenameService[Redacted]@[Redacted]ResumableStateMachine`1& sm)
   at <StartupCode$FSharp-Editor>.$InlineRenameService[Redacted]@[Redacted]ResumableStateMachine`1& sm)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.FSharpInlineRenameInfo.Microsoft-CodeAnalysis-Editor-IInlineRenameInfo-FindRenameLocationsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.<>c__DisplayClass44_0.<UpdateReferenceLocationsTask>b__0(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.<>c__DisplayClass76_0.<UpdateConflictResolutionTask>b__0(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.CommitCoreAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.CommitWorkerAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
   at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.CommitWorker(Boolean previewChanges)
   at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.RenameCommandHandler.Commit(InlineRenameSession activeSession,ITextView textView)

Original Comments

Feedback Bot on 11/24/2023, 02:51 AM:

(private comment, text removed)


Original Solutions

(no solutions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-LangService-RenameSymbolFCS and VS support for renaming symbolsBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions