Type: LanguageService
I can autocomplete functions and global variables but can't auto complete local variables.
When I disable cpptools, local variables can be autocompleted.
Describe the bug
Steps to reproduce
I have removed "code" folder from AppData. I think the location was "C:Users$USER$AppDataRoamingCode".
Before I removed the folder, there was no this problem. I am sorry I can't remember why I removed the folder.
Expected behavior
C/C++: Log DiagnosticsOffering completion
Offering completion
idle loop: reparsing the active document
Offering completion
idle loop: reparsing the active document
Offering completion
Offering completion
Offering completion
Offering completion
Logs
Insert logs here.
Screenshots


Additional context
It looks like semantic IntelliSense is disabled here. What is the value of the C_Cpp.intelliSenseEngine setting in your workspace? Based on the symptoms, it appears that it is set to "Tag Parser". Try setting it to "Default."
@ymkim92 did you delete your comment? I saw you set "C_Cpp.intellisenseEngineFallback": "Enabled". You should disable that setting (or we should just delete it from the extension). That setting will cause the extension to use the Tag Parser when it fails to resolve one of your #include statements. I suspect that's what's happening in your WSL project.
Thanks @bobbrow ,
Autocompletion works after changing C_Cpp.intelliSenseEngine to "Default".
But I found follow-up problems after that.
Please see the following code and comments:
#include <iostream>
int globalTestInt;
void Func(int intFunc)
{
intFunc = 0; // works fine for auto-completion and "go to definition"
}
void Func2(data::Acceleration &intFunc)
{
intFunc = 0; // doesn't work for auto-completion and "go to definition"
}
void Func3(uint32_t intFunc)
{
intFunc = 0; // doesn't work for auto-completion and "go to definition"
}
int main()
{
int testInteger;
testInteger = 0;
globalTestInt = 1;
testI
Fu
}
What I found from the above test is that if data type is not defined or can't find it, intellisense doesn't work after that.
Is this correct behavior?
But I think it could work for local variable within Func3() and main(). What do you think?
Usually the compiler can recover from an undefined symbol. In this case it looks like the & after the undefined type breaks the compiler for the remainder of the source file. Removing the & but keeping the undefined type appears to be a recoverable error.
This behavior is in our shared compiler code with Visual Studio. Would you be willing to open an issue on Developer Community so that the Visual Studio team can track this issue?
Thanks @bobbrow ,
I didn't know you could check my comment even if I delete it.
I wrote the previous comment without reading your comment for my deleted one. I am sorry.
I get email notifications, so I can still read it in my inbox if it was deleted. 馃槂 Hopefully my comment was still helpful.
It was very helpful. Thank you so much 馃憤.