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

LSP: confusing type in WorkspaceEdit breaks JSON serialization

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes