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

default intellisense engine not working #1019

Closed
liuchanchen opened this issue Sep 8, 2017 · 17 comments
Closed

default intellisense engine not working #1019

liuchanchen opened this issue Sep 8, 2017 · 17 comments
Labels
bug Language Service more info needed The issue report is not actionable in its current state

Comments

@liuchanchen
Copy link

VSCode Version:
1.15.1
OS Version:
ubuntu 16.04 LTS

extension version:
0.12.3

Steps to Reproduce:
1.install c/c++ extension
2.set C_Cpp.intelliSenseEngine as defult
3.restart vs code
4.find autocomplete doesn't work

@marcrowo
Copy link

marcrowo commented Sep 8, 2017

I think this might have to do with #981 and the intelliSenseEngine: "Default" setting causing intelliSense parsing to be stuck.

After changing my intelliSenseEngine to "Tag Parser", autocomplete, formatting, etc. seem to work. However, this will reduce the quality of the intelliSense suggestions.

@liuchanchen
Copy link
Author

liuchanchen commented Sep 8, 2017

setting intellisense engine as "tag parse" works. And I also find it autocomplete works fine in windows,is it related with OS?

@marcrowo
Copy link

marcrowo commented Sep 8, 2017

I also noticed this on a non-Windows system (macOS).

@sean-mcmanus sean-mcmanus added the more info needed The issue report is not actionable in its current state label Sep 8, 2017
@sean-mcmanus
Copy link
Contributor

With the Default IntelliSense engine, what is your Microsoft.VSCode.CPP.IntelliSense.Msvc.exe doing when you open a file and hover? Is it using lots of CPU, is it crashed, etc.? Autocomplete could fail if it somehow fails to parse the translation unit. Does it work for a simple C++ workspace with just a main function? Yes, it could be OS related.

@marcrowo
Copy link

marcrowo commented Sep 8, 2017

The Default IntelliSense engine works for a simple file.

However, after opening a file that includes a large header file (like doctest), the CPU usage of Microsoft.VSCode.CPP.IntelliSense.Msvc.darwin is very high and there is a red flame in the status bar with tooltip "Parsing...". At this point, IntelliSense is also no longer working.

For the same files, Tag Parser seemed to work.

screen shot 2017-09-08 at 11 47 33 am

screen shot 2017-09-08 at 11 47 41 am

@sean-mcmanus
Copy link
Contributor

@marcrowo Yeah, your issue sounds like #981 . I don't know yet if @liuchanchen is experience the same behavior.

@liuchanchen
Copy link
Author

liuchanchen commented Sep 9, 2017

I print the process cpu utilization and find the extension usage seems not very high
image

@liuchanchen
Copy link
Author

liuchanchen commented Sep 9, 2017

Actually, the autocomplete even not work in a pretty simply file just like:
int main()
{
int i;

return 0;

}

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Sep 10, 2017

@liuchanchen Does "main" autocomplete for you? It should be autocompleting using the Tag Parser (even when "Default" is set). "i" shouldn't autocomplete (unless it exists at a global scope elsewhere) because we don't support autocompletion of local variables yet. The enhanced "Default" autocompletion only provides results for after . -> ::. However, I'm seeing that fail to work in this simple example, so I'll investigate Monday:
`class cc
{
int i;
};

int main()
{
cc c;
c. // This is failing to autocomplete.
return 0;
}`

@sean-mcmanus
Copy link
Contributor

The previous example I posted doesn't autocomplete because we don't autocomplete inaccessible members (in this case, the private variable "i"). I need more info from @liuchanchen on what exactly doesn't autocomplete (because it's working as expected for me).

@liuchanchen
Copy link
Author

@sean-mcmanus ,I am sorry for reply so late.
1 The following codes is my another example .I define a global variable cdev , and I want to use this variable in "main",but autocompletion doesn't work at all.
struct mychrdev_data
{
char buf[MYCHRDEV_CAPACITY];
unsigned int headptr;
unsigned int tailptr;
};
cdev_t cdev;

int main()
{
cdev.
}
2 My setting is as follows:
"C_Cpp.intelliSenseEngine": "Default",
"C_Cpp.intelliSenseEngineFallback": "Disabled"

Are these informations helpful for you?

@sean-mcmanus
Copy link
Contributor

I'm not able to repro the bug still. I had to add these definitions: constexpr int MYCHRDEV_CAPACITY = 10; and after the struct typedef mychrdev_data cdev_t;. Do you see any errors in the Problems window or when you hover over code? I noticed that on Linux, if the typedef is placed before the struct, then autocomplete fails (even though it works on Windowsi), but in both cases, hovering shows an <error-type>.

@liuchanchen
Copy link
Author

liuchanchen commented Sep 13, 2017

Actually, the codes I posted is extracted from a source code file which can be compiled correctly. I define MYCHRDEV_CAPACITY as a const number almost like what you do, and add "typedef mychrdev_data cdev_t" after structure define .So I don't think it is syntax error causing autocompletion failing. ''tag parse" (on linux)also works fine in the same file

@sean-mcmanus
Copy link
Contributor

Does hover give info on the variables involved in the autocomplete? If the member is somehow unavailable then we wouldn't show it (i.e. if "struct" were changed to "class").

So to double check you don't actually use this code you pasted struct mychrdev_data { char buf[MYCHRDEV_CAPACITY]; unsigned int headptr; unsigned int tailptr; }; cdev_t cdev;
and instead you have a typedef beween the struct definition and the cdev definition, right? Because moving the typedef to other locations would cause the autocomplete to fail.

@BrianSipple
Copy link

BrianSipple commented Sep 17, 2017

After updating to 0.12.4, I've found autocomplete to be broken with both the Default and Tag Parser intelliSenseEngine setting.

OS: MacOS 10.12.6
VSCode: 1.16.1

For additional context, the project I'm in is quite large (OpenFrameworks), but I wasn't experiencing any issues in 0.12.3.

@sean-mcmanus
Copy link
Contributor

@BrianSipple I'm not able to repro a problem with autocomplete. Can you give more details? Does it work with a simple project? What results do you get? Are you using . -> ::? Are other features like hover and Go to Definition working? If you believe cpptools regressed you can try the older version at http://ms-vscode.gallery.vsassets.io/_apis/public/gallery/publisher/ms-vscode/extension/cpptools/0.12.3/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage (renaming the zip to vsix and using the Install from vsix command).

@bobbrow
Copy link
Member

bobbrow commented Mar 20, 2018

Closing stale issues marked with "more info needed". If you continue to have issues with the extension, please reopen and add some additional information that will help us debug your issue.

@bobbrow bobbrow closed this as completed Mar 20, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Language Service more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests

5 participants