def show_items(self, cursor, items, prefix_length=0):
        """ Shows the completion widget with 'items' at the position specified
            by 'cursor'.
        """
        point = self._get_top_left_position(cursor)
        self.clear()
        path_items = []
        for item in items:
            # Check if the item could refer to a file or dir. The replacing
            # of '"' is needed for items on Windows
            if (os.path.isfile(os.path.abspath(item.replace("\"", ""))) or
                    os.path.isdir(os.path.abspath(item.replace("\"", "")))):
                path_items.append(item.replace("\"", ""))
            else:
                list_item = QtWidgets.QListWidgetItem()
                list_item.setData(QtCore.Qt.UserRole, item)
                # Need to split to only show last element of a dot completion
                list_item.setText(item.split(".")[-1])
                self.addItem(list_item)

        common_prefix = os.path.dirname(os.path.commonprefix(path_items))
        for path_item in path_items:
            list_item = QtWidgets.QListWidgetItem()
            list_item.setData(QtCore.Qt.UserRole, path_item)
            if common_prefix:
                text = path_item.split(common_prefix)[-1]
            else:
                text = path_item
            list_item.setText(text)
            self.addItem(list_item)

        if QT6:
            screen_rect = self.screen().availableGeometry()
        else:
            screen_rect = QtWidgets.QApplication.desktop().availableGeometry(self)
        screen_height = screen_rect.height()
        height = int(min(self._height_max, screen_height - 50)) # -50px
        if ((screen_height - point.y() - height) < 0):
            point = self._text_edit.mapToGlobal(self._text_edit.cursorRect().topRight())
            py = point.y()
            point.setY(int(py - min(height, py - 10))) # -10px
        w = (self.sizeHintForColumn(0) +
             self.verticalScrollBar().sizeHint().width() +
             2 * self.frameWidth())
        self.setGeometry(point.x(), point.y(), w, height)

        # Move cursor to start of the prefix to replace it
        # when a item is selected
        cursor.movePosition(QtGui.QTextCursor.Left, n=prefix_length)
        self._start_position = cursor.position()
        self.setCurrentRow(0)
        self.raise_()
        self.show()
 Shows the completion widget with 'items' at the position specified
            by 'cursor'.
        
angrmanagement/vendor/qtconsole/completion_widget.py