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

Add keyboard shortcut to "Expand selection" (clangd/LSP textDocument.selectionRange)?

    XMLWordPrintable

Details

    Description

      In VS Code, you can Alt+Shift+Right to "Expand Selection". When editing C++ files with the clangd extension, this asks the clangd LSP for "textDocument.selectionRange" information at the current cursor (LSP docs), then expands or contracts the selection based on the returned ranges every time you Alt+Shift+Right or Left. (If you move the cursor then Alt+Shift+Right again, it queries "textDocument.selectionRange" again.) This is useful both for editing code, and for asking the compiler about tricky C++ precedence problems (like querying the parse tree of (size_t)x & *mask[y] == 2). (JetBrains also has Ctrl+W for similar functionality, but is not built on top of clangd or LSP.)

      Given that Qt Creator uses clangd and it has selection range information built-in, is it possible to extend Qt Creator to add a keyboard shortcut to expand selection, which asks clangd for selection ranges around the cursor, then caches and applies them?

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            nyanpasu64 Nyan Pasu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes