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

Auto completion causes duplicated inputs when clangd is running slow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 14.0.1
    • clangd version 18.1.8
      cmake version 3.30.0
    • Linux/X11

    Description

      `clangd` is set up as a custom LSP in Language Client settings. The one from `C++ -> Clangd` is not used. Why I did not use the builtin integration is for another issue ticket, but this issue is for the custom Language Client.

      the arguments are set to the following:

      ```
       --compile-commands-dir=%

      {ActiveProject:BuildConfig:Path}

      -j=8 --malloc-trim --background-index --background-index-priority=low --pch-storage=memory --clang-tidy --all-scopes-completion --header-insertion=never --limit-references=0 --rename-file-limit=0 --function-arg-placeholders --completion-style=detailed
      ```

      CMAKE_EXPORT_COMPILE_COMMANDS needs to be enabled for clangd to find the `compile_commands.json`.

      When a huge project is active, clangd runs slower. If I type too fast such that clangd auto complete suggestion barely catches up, when I press Tab to insert the auto completion, the result is usually like this:

      ```
      VkImageMemoryBarrierbarri
      ```

      That is, it suggests `VkImageMemoryBarrier` when I've typed `vkimagememorybarri`, but the completion result leaves me to manually delete the duplicated words, which slows me down. It seems as if the internal state is lagging behind the code editor (the internal state sees `vkimagememory` when the code editor already has `vkimagememorybarri`), as this won't happen if I wait a few seconds before hitting Tab.

      This doesn't occur with the builtin clangd integration. It's only an issue with custom Language Client.

      Attachments

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

        Activity

          People

            davschul David Schulz
            jclink Jessia Clinkscale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes