Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very poor Autocomplete; possibility of polyfill? #280

Closed
artagnon opened this issue Oct 13, 2016 · 6 comments
Closed

Very poor Autocomplete; possibility of polyfill? #280

artagnon opened this issue Oct 13, 2016 · 6 comments

Comments

@artagnon
Copy link

Hi,

Autocomplete is basically not working. At first, I thought it was my include path; for LLVM, it's very simple: "${workspaceRoot}/include". It doesn't even complete "Basic" to "BasicBlock" (token seen a couple of lines below) here:
screen shot 2016-10-12 at 8 16 04 pm

Something is seriously wrong, and this should work even without parsing any headers; it knows that BasicBlock is some kind of type (struct, class, union), and this is all the information it needs to know to fill out the template argument.

I know precise autocomplete is hard, but can I suggest a polyfill of any-word autocomplete (like Atom)? We need any-token autocomplete anyway, for things like macro invocations (think ASSERT_EQ in gtest).

I also tried it on my codebase at work, and it's useless again.

@sean-mcmanus
Copy link
Collaborator

This sounds like it could be a bug. Does it repro with 0.10.5 still? Could you give more repro details?

@artagnon
Copy link
Author

artagnon commented Apr 9, 2017

@sean-mcmanus Running 1.12, and the problem is very much there. Reproduction steps: open a Scratch.cpp and type out the following into it slowly:

#include <string>
//        ^~~~~~ does it complete "string" or "vector"?
#include <vector>

int main()
{
    std::vector<bool> bools;
//       ^~~~~~~~~~~ does it complete vector or bool?
    std::vector<int> ints;
//       ^~~~~~ the second time "vector" is encountered, still no complete.
    bools.emplace_back(false);
//  ^~~~~~~~~~~~~~~~~~ does it complete "bools"? How about "emplace_back"?
    bools.size();
//        ^~~~ what happened to "size"?
}

Atom autocompletes every single one of those words.

@sean-mcmanus
Copy link
Collaborator

  1. The lack of autocomplete in #include, for keywords like "bool", and for local variables like "bools" are known missing feature which we intend to add (no ETA yet).
  2. std:: should autocomplete with all the std classes that have had header files parsed, along with all the methods after the "." such as emplace_back and size. If your limitSymbolsToIncludedHeaders setting is set to the default of "false", then the includePath headers are not parsed by default, until you add the #include and then save the file. If that still doesn't work, are you able to do Go To Definition on the #include file to locate it?

@artagnon
Copy link
Author

artagnon commented Apr 15, 2017 via email

@sean-mcmanus
Copy link
Collaborator

You should delete your .browse.vc.db (default location is OS-dependent) or change the databaseFilename to something like ${workspaceRoot}/.browse.vc.db. It looks like initially it found /usr/include/c++/4.2.1/debug/string as the header, but it no longer exists. We intend to fix the issue where old/deleted files aren't being removed from the browse datagbase.

@bobbrow
Copy link
Member

bobbrow commented Jul 6, 2017

autocomplete for #include will be tracked by #802.
The second issue is fixed by using the new IntelliSense engine (add "C_Cpp.intelliSenseEngine": "Default" to your settings.json to try it out). We are also tracking an issue to fix up the browse database when files are deleted with #464.

@bobbrow bobbrow closed this as completed Jul 6, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants