-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
InlineRenameSession.InitializeOpenBuffers calls document.TryGetText instead of GetTextAsync.
If the DocumentState's textSource is a RecoverableTextAndVersion rather than a constant source, this won't return a text and will break the rename.
Typing into a document sets the text to a constant version, so this doesn't usually happen.
It consistently happens for me in a TextView with both C# and VB buffers from the same workspace (eg, my Markdown editor); unless all open Roslyn buffers either have had keystrokes or have the cursor (which triggers UpdateText fromGetOpenDocumentInCurrentContextWithChanges), it will fail in that method.
As an aside, I can't get rename to work anyway within VS; I need a Host workspace for IDocumentNavigationService (internal) to allow the rename, but I need a non-Host or the VS version of ITextUndoHistoryWorkspaceService will refuse to operate at all with my custom workspace class.
Ironically, rename works fine in custom hosts outside VS (VSEmbed), because I can skip the VS.LangServices layer entirely, except for IDocumentNavigationService to allow the rename