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

Built-in code completion snippets preferred over customized ones

    XMLWordPrintable

Details

    • Linux/X11

    Description

      When typing C++ operators like sizeof, alignof, alignas and maybe some other, QtCreator offers to auto-complete the operator name and adds parenthesis after it. The problem is that it also adds a space between the operator name and the opening parenthesis. I would like to remove that space.

      In QtCreator settings, Text Editor -> Snippets, there is a way to customize snippets. However, there are no entries for these operators. If I add ones, I can see as I type, e.g. sizeof, a combobox appears with multiple sizeof suggestions, and the first one is the built-in one with the space. The snippet I typed in in the settings is on the 4th place in the suggestion list, so obviously I won't waste time selecting it as I'm able to type "sizeof" in about the same number of keystrokes.

      This is not specific to the newly added snippets. The snippets that are already there are also duplicated with the built-ins. For example, as I type "while", I can see a combobox with two completion variants: the first one is the built-in, and the second one from the settings.

      I think that having built-in suggestions in the code completion is inconvenient and defeats the purpose of customizing snippets as a tool for making QtCreator suggest code that is formatted consistent with user's preferences. That is especially so given that the built-in snippets come first in the list. I think, built-ins should be removed from the list if there is a custom snippet.

      Attachments

        Issue Links

          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:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes