Skip to content

Incomplete suggestion results cause re-triggering when typing w/o further context. #28400

Closed

Description

@yurriy

extension cpptools is installed.
VS Code toggle quick suggestions popup, after I type "i++;", but it shouldn't.

  • VSCode Version: last
  • OS Version: Ubuntu 16.04

Steps to Reproduce:
With cpptools enabled, type "i++;" in any cpp file.

Activity

  1. ramya-rao-a commented on Jun 12, 2017

    @ramya-rao-a
    Contributor

    This issue was moved to microsoft/vscode-cpptools#818

  2. bobbrow commented on Jun 12, 2017

    @bobbrow

    Hi there,

    We do not register for a textDocument/completion callback when semicolon is typed. We think this is a VS Code bug with the "editor.quickSuggestions" setting. It is popping up after semicolon is typed instead of waiting for a new line. I repro this on Windows too.

    Please reopen and investigate.

  3. added
    suggest
    on Jun 12, 2017
  4. added
    info-needed
    on Jun 13, 2017
  5. jrieken commented on Jun 13, 2017

    @jrieken
    Contributor

    We think this is a VS Code bug with the "editor.quickSuggestions" setting.

    Bob Brown (@bobbrow) What makes you think this? Quick-suggestions has nothing to do with trigger characters which will always go straight to your provider. Quick-suggestios is about suggesting while you type words. Please share your word definition, it might include ;

  6. bobbrow commented on Jun 13, 2017

    @bobbrow

    Our word definition? Do you mean the C++ grammar? I can go take a look and see if something changed there. What's strange is that we get a textDocument/completion event from VS Code only once the ; is typed. It's not a continuation of the previous word/symbol.

  7. jrieken commented on Jun 13, 2017

    @jrieken
    Contributor

    No, not the grammar but the wordPattern extensions either define via an API call or via the language-config file

  8. jrieken commented on Jun 13, 2017

    @jrieken
    Contributor

    Actually, this doesn't repro for me... Yuriy Baranov (@yurriy) Please provide more details

    jun-13-2017 18-26-41

  9. bobbrow commented on Jun 13, 2017

    @bobbrow

    We don't set a LanguageConfiguration anywhere in our extension. I honestly didn't know such a thing existed.

  10. sean-mcmanus commented on Jun 13, 2017

    @sean-mcmanus
    Contributor

    Johannes Rieken (@jrieken) Bob and I have both reproed the bug where the quickSuggestion popup occurs after the semicolon, but the repro appears to be random (timing related?) and we don't yet know a good way to force a repro. We don't think our extension is causing the issue.

  11. yurriy commented on Jun 14, 2017

    @yurriy
    Author

    This bug happened every time, but only in a particular directory, even if I cleaned all files within it (including .vscode), and created new 1.cpp. It didn't repro for copy of this dir. I deleted it and created the dir with the same name, and now it doesn't repro. Hence, it seems like this bug depends on time of creation of directory.

  12. jrieken commented on Jun 14, 2017

    @jrieken
    Contributor

    Yuriy Baranov (@yurriy) what is the list of snippets you have? what is the list of suggestion you see? can you attach a screen shot?

  13. 27 remaining items

  14. jrieken commented on Jun 22, 2017

    @jrieken
    Contributor

    Ok, I'd go for a higher limit to begin with and see how well or not that goes. With 10000 it should still be OK, the 40000 maybe a little slower. The rendering is all virtualised, the expensive bit is data serialisation and filtering/scoring. I'd give it a try, everyone would benefit if you guys can uncover some hidden perf issues with this.

    We might be able to fix this via saving the anchor position when an incomplete result is returned and clearing the state when the selection changes to a different line/file, although it might not solve all scenarios.

    It could work - the UI only allows to invoke IntelliSense in one editor at a time but your provider can also be asked via API-commands. But the assumption will hold for most cases...

    Another thing you could try is to filter down the list on the server, e.g. when having a huge result set and with a forgiving continuous substring matcher.

  15. sean-mcmanus commented on Jun 27, 2017

    @sean-mcmanus
    Contributor

    Johannes Rieken (@jrieken) We're hitting problems when incomplete == true -- there appears to be no way to cancel the completion when a ";" or other identifier breaking character is is encountered, even if we save the anchor position. The result is that it shows "No suggestions" instead of disappearing. Also, when the user hits Esc to cancel the completion popup, we also get no cancelRequest set, so we can't reset the "anchor" correctly. It sounds like you're saying this "incomplete" parameter is not really usable in a correct way? Or are we misunderstanding something?

  16. bobbrow commented on Jun 27, 2017

    @bobbrow

    Sean McManus (@sean-mcmanus) we don't have enough context from vscode to do anything right now besides increasing our upper limit. We can try 10000 and see if that helps.

  17. added
    bug
    and removed
    under-discussion
    on Jun 28, 2017
  18. jrieken commented on Jun 28, 2017

    @jrieken
    Contributor

    Ok, plan for June is to cancel suggestions when a result is marked as incomplete and when the cursor isn't on a word anymore. That might discriminate suggestions that contain non-word-characters and aren't there yet (still in the incomplete portion) but we believe that's the smaller problem.

  19. jrieken commented on Jun 28, 2017

    @jrieken
    Contributor

    I have pushed a change that implements aforementioned behaviour. Closing this issue, exposing more information to suggestion providers is tracked here: #752.

  20. bobbrow commented on Jun 28, 2017

    @bobbrow
  21. added
    verified
    on Jun 30, 2017
  22. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugsuggestverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions