Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-124592

LSP: confusing type in WorkspaceEdit breaks JSON serialization

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.0 FF, 6.8
    • 6.8
    • Qt Language Server
    • None
    • e40871352 (dev), ab90f3e0e (dev)

    Description

      There is a type that confuses the JSON serialization in WorkspaceEdit, and it is:

      std::optional<std::variant<QList<TextDocumentEdit>,                         QList<std::variant<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>>>>

      Basically, if you deserialize a WorkspaceEdit with a

      QList<std::variant<TextDocumentEdit, CreateFile, RenameFile, DeleteFile>

      and then later reserialize it, you will obtain a QList<TextDocumentEdit> with invalid content.

       

      This was found while writing tests for renaming qml components and their corresponding files.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              sami.shalayel Sami Shalayel
              sami.shalayel Sami Shalayel
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes