Skip to content

If libman.json is open but not initialized, adding a new library via the wizard fails to edit the document #602

@jimmylewis

Description

@jimmylewis

Functional impact

Completing the wizard does not accomplish the task as expected.

Minimal repro steps

  1. Have a solution with a libman.json file open.
  2. Close the solution with a different file as the active document.
  3. Reopen the solution, without setting focus to the libman.json tab
  4. Add -> New Client Library, fill out the wizard and install

Expected result

The libman.json file should be edited to include the new library, and the library should be installed.

Actual result

No change in the libman.json file, library is not installed.

Further technical details

This is occurring because there is a text buffer open but the TextView (and its TextViewData) is not yet initialized.

Callstack:

Microsoft.Web.LibraryManager.Vsix.dll!Microsoft.Web.LibraryManager.Vsix.UI.Models.InstallDialogViewModel.FormatSelection(Microsoft.VisualStudio.Text.ITextBuffer textBuffer, int insertionIndex, string insertionText) Line 613 C#
Microsoft.Web.LibraryManager.Vsix.dll!Microsoft.Web.LibraryManager.Vsix.UI.Models.InstallDialogViewModel.InsertIntoTextBuffer(Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer document, Microsoft.Web.LibraryManager.LibraryInstallationState libraryInstallationState, Microsoft.Web.LibraryManager.Manifest manifest) Line 585 C#
Microsoft.Web.LibraryManager.Vsix.dll!Microsoft.Web.LibraryManager.Vsix.UI.Models.InstallDialogViewModel.InstallPackageAsync() Line 539 C#

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions