Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-27249

Local variable renaming doesn't work with clangd

    XMLWordPrintable

Details

    • Linux/X11
    • a1b910724d (qt-creator/qt-creator/7.0) a1b910724d (qt-creator/qt-creator/master) a1b910724d (qt-creator/qt-creator/qds-3.3)

    Description

      In my project, renaming function-local variables doesn't work when clangd is enabled:

      1. Navigate the cursor to a function-local variable name. For example, to the variable declaration.
      2. Press Ctrl+Shift+R to enter the variable renaming mode.

      The actual result: QtCreator opens search/replace panel within the file. The search and replace happens for the whole file and for all character sequences matching the search string, not renaming the specific variable in the given function.

      Expected result (which is what happens with clangd disabled): QtCreator enters variable renaming mode. You can rename the variable in-place, and the changes are automatically applied to all instances of the variable within the current function (not any other mentions of the word anywhere else in the file).

      This reproduces in my (large and not open source) CMake-based project. I could not create a small reproducer project.

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            lastique Andrey Semashev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes