Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-100084 LSP: find usages in qml
  3. QTBUG-119843

qmlls: correct shadowing rules for find usages

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Won't Do
    • P3: Somewhat important
    • 6.8
    • QML: Tooling
    • None

    Description

      Currently, find usages has a very coarse approximation to recognize shadowed properties (or at least shadowed properties you can detect at compiletime).

      Maybe this should be fixed?

      Here some edge cases to test:

      For a signal s, onS should not shadow s. Also, should shadowing onS also shadows s?

      signal s
      function f() {
          let onS = 43;
          s(); // usage of signal s
      }
      function g() {
          let s = 43;
          onS() // usage of signal handler s?
      }
      property int p
      function h() {
          let p = 123
          pChanged() // usage of property int p's changed handler?
      }

      For a shadowed property p, root.p is not shadowed (because of the identifier).

      id: root
      property int p
      function f() {
          let p = 123
          return root.p // usage of property p
      }
      function g() {
          let root = 123
          return root.p // not an usage of property p because root is shadowed
      }

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            sami.shalayel Sami Shalayel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes