Autocomplete only on Tab press

Sysprogs forums Forums VisualGDB Autocomplete only on Tab press

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #35622
    Nakame
    Participant

    Hello !

    quite often, my code is wrongly autocompleted when i press the spacebar . This is sometime driving me insane. There was an option in visual c++ ( edit->intelisence->switch between automatic and tab only completion ) but it doesnt seem to work with visualGDB.

     

    Does visualGDB have a similar option that i couldnt find ? How can i make autocompletion work only when i press tab ?

     

    Thank you in advance !

    #35623
    support
    Keymaster

    Hi,

    VisualGDB’s code completion has 2 levels of confidence:

    • If the string you typed exactly matches the beginning of a suggestion, (e.g. you typed “print” and it found “printf”), typing any non-identifier character (space, opening bracket, comma, etc) will trigger a completion and will insert the character you typed.
    • If the string loosely matches the suggestion (e.g. you typed “ncmp” and if found “wcsncmp” or you typed “pascope” and it found “pthread_attr_getscope), it is considered a low-confidence match, so it will only get completed if you press tab. Otherwise it will insert what you typed as if there was no completion popup.

    Normally, this should avoid inserting the wrong suggestions, while still giving you the possibility to find functions or variables if you don’t know the exact name. If you keep getting incorrect completions, feel free to share more details with an exact example of what you are typing and what VisualGDB suggests, and we will look further into it.

    #35625
    Nakame
    Participant

    Hello !

     

    I don’t have an exemple right now ( and i am working on some electronic stuff for now ) but i will post one as soon as i stumble accross one.

    In the meantime you can imagine that i am not taking the time to post here if it wasnt a frustrating problem for me. When i press the space bar, i expect the end of the word. Period. If i want an autocompletion, i would usually press the “Enter” or “Tab” key. I assume from your response that this is not possible using visualGDB ?

    I will post an exemple as soon as possible.

    #35651
    Nakame
    Participant

    Allright i have the first good exemple that is very easy to reproduce here.

     

    In my norm, there is a rule that say that inside preprocessor conditions i am supposed to put a space between the ‘#’ and the rest. For exemple :

    #ifdef __GNU_C__

    # define className __PRETTY_FUNCTION__

    #endif

    Notice the space between ‘#’ and ‘define’ . With visualGDB , when i press the space after the #, it autocomplete to “#assert”. Again, this is an exemple, it happens on a lot of other things. It is rare enought that i don’t desactivate autocomplete alltogether but it is still annoying when it happen. An easy fix to that is to have an option to disable autocomplete on space and instead use tab . or even better, set the key yourself.

    #35661
    support
    Keymaster

    Hi,

    Thanks, this is indeed a bug in the completion system, although it looks like a very rare scenario.

    We have added special handling for spaces in preprocessor directives to this build: VisualGDB-6.0.103.5192.msi

    If you encounter other cases where spaces break completion logic, feel free to share the repro steps and we will look into it.

     

    Attachments:
    You must be logged in to view attached files.
    #35683
    Nakame
    Participant

    In the linked screenshot, i am trying to type in a variable nammed X, as in

    int ( &X )[ 100] )

     

    However, pressing spacebar after the “X”  here will autocomplete to X_OK . I just want a space.

    Attachments:
    You must be logged in to view attached files.
    #35685
    bflannery
    Participant

    I would like to second having this be a setting. I would like to disable:

    • If the string you typed exactly matches the beginning of a suggestion, (e.g. you typed “print” and it found “printf”), typing any non-identifier character (space, opening bracket, comma, etc) will trigger a completion and will insert the character you typed.

    Honestly this functionality gets in the way more than it speeds up my programming. I would much rather have autocomplete only complete what I am typing when I press tab.

    Here I am trying to create a local variable named, alarm. The sensible thing for me to do would be to type space to continue this line of code or end it with semicolon if it was simply a definition.

    However, that would autocomplete to a macro. Instead I need to hit escape and I don’t like reaching for that key because it interrupts my typing flow/train of thought.

     

    • This reply was modified 6 months, 3 weeks ago by bflannery.
    #35695
    Nakame
    Participant

    Another insanely annoying behavior that come from this is when i use multi-line edit. In the screenshot, i am trying to add the keyword “static” before 3 different lines, using the multi line edit tool ( shift + alt ). The autocomplete corretly assume that i want to use “static”. I press the spacebar and it autocomplete corretly but it cancel my multi line edit , and only the first line get edited, completly defeating the purpose.

    • This reply was modified 6 months, 3 weeks ago by Nakame.
    Attachments:
    You must be logged in to view attached files.
    #35953
    Nakame
    Participant

    im comming back to  this. This still annoy me very often. Is adding a setting to change the key to validate the autocomplete really that hard to add ? Am i missing something ? Do i need to keep bringing you exemples ?

    #35954
    support
    Keymaster

    No problem, we will try to clarify. We get a lot of requests to change various things and often discover problems proactively as well. So, we have to prioritize them. E.g., issues that break workflow for multiple users (e.g. recent Qt6 update breaking our Raspberry Pi toolchain) get higher priority than annoying glitches that trigger only under certain rare circumstances.

    Adding an extra set of checks to a rather complicated mechanism always has a chance of backfiring and causing unintended behavior someone else with another rare combination of settings, so it requires more testing and hence gets pooled together with other similar minor changes in the same area.

    The behavior mentioned by @bflannery was actually a bug introduced by switching to a newer Clang version (entering names for new variables should not trigger the completion at all) and is already fixed in our development branch. As for the setting, we should be able to add it next time we change other logic related to completion, however we cannot promise any deadlines for it now, sorry.

    #35956
    Nakame
    Participant

    Fine. Thank you very much for the explanation. I’ll be patient then.

    #36080
    support
    Keymaster

    Thanks for your patience. We have added the option to auto-complete only with TAB to VisualGDB 6.0R4.

    You can configure it via Tools->Options->Text Editor->C/C++(VisualGDB)->Advanced->Code Completion->Auto-complete only on TAB.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.