function extractUsedForPattern(refsNode) {
      /** @type {Identifier | MemberExpression | ChainExpression} */
      let node = refsNode
      while (node.parent.type === 'ChainExpression') {
        node = node.parent
      }
      const parent = node.parent
      switch (parent.type) {
        case 'AssignmentExpression': {
          if (parent.right === node) {
            if (parent.left.type === 'ObjectPattern') {
              // `({foo} = $refs)`
              extractUsedForObjectPattern(parent.left)
            } else if (parent.left.type === 'Identifier') {
              // `foo = $refs`
              hasUnknown = true
            }
          }
          break
        }
        case 'VariableDeclarator': {
          if (parent.init === node) {
            if (parent.id.type === 'ObjectPattern') {
              // `const {foo} = $refs`
              extractUsedForObjectPattern(parent.id)
            } else if (parent.id.type === 'Identifier') {
              // `const foo = $refs`
              hasUnknown = true
            }
          }
          break
        }
        case 'MemberExpression': {
          if (parent.object === node) {
            // `$refs.foo`
            const name = utils.getStaticPropertyName(parent)
            if (name) {
              usedRefs.add(name)
            } else {
              hasUnknown = true
            }
          }
          break
        }
        case 'CallExpression': {
          const argIndex = parent.arguments.indexOf(node)
          if (argIndex !== -1) {
            // `foo($refs)`
            hasUnknown = true
          }
          break
        }
        case 'ForInStatement':
        case 'ReturnStatement': {
          hasUnknown = true
          break
        }
      }
    }
Extract the use ref names.
@param {Identifier | MemberExpression} refsNode
@returns {void}