Uploaded image for project: 'VS Code Extension'
  1. VS Code Extension
  2. VSCODEEXT-186

Qt Qml Language Server does not recognize module import registered via qmlRegisterSingletonInstance

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 1.4.0, 1.5.1
    • QML/QtQuick support
    • None
    • OS Name: Microsoft Windows 11 Pro
      OS Version: 10.0.26100 N/A Build 26100
      OS Manufacturer: Microsoft Corporation
      OS Configuration: Standalone Workstation
      OS Build Type: Multiprocessor Free
    • All, Windows

    Description

      Qt Qml Language Server does not recognize import of module registered via qmlRegisterSingletonInstance

      There is a simple project that uses the qmlRegisterSingletonInstance() function to register its object.
      However, when trying to view this module, the code editor (via the QML language server) indicates an error in this qml file (Main.qml), and the VS Code code editor also highlights the error at the point where this object is accessed.

      At the same time, Qt Creator displays it without errors. In addition, running the executable file also does not display any errors, works correctly, and normally accesses the property of the registered object and displays it as text.

      Attached are screenshots and an archive with the source code for playback. The Qt library itself is installed in c:/Qt6.8.2.

      Attachments

        1. screenshot-3.png
          screenshot-3.png
          33 kB
        2. screenshot-2.png
          screenshot-2.png
          70 kB
        3. screenshot-1.png
          screenshot-1.png
          146 kB
        4. QtQmlVSCodeTest.zip
          6 kB
        5. 1.png
          1.png
          30 kB
        6. 0-1.png
          0-1.png
          66 kB
        7. 0.png
          0.png
          66 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtvscodeteam Qt VS Code
            rumgot rumgot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes