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

"C_Cpp.intelliSenseEngine": "Default" not working as expected #786

Closed
atavern1 opened this issue May 31, 2017 · 4 comments
Closed

"C_Cpp.intelliSenseEngine": "Default" not working as expected #786

atavern1 opened this issue May 31, 2017 · 4 comments
Labels
Language Service more info needed The issue report is not actionable in its current state

Comments

@atavern1
Copy link

atavern1 commented May 31, 2017

I'm getting red squiggles indicating that a number of identifiers are undefined. I'm working from a Ubuntu machine and I've set up a c_cpp_properties.json as below (I removed the Mac and Windows config objects for brevity):

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceRoot}",
                "/usr/include/c++/5.4.0",
                "/usr/local/include",
                "/usr/include",
                "/home/anthony/Programs/playground/code/core/includes"
            ],
            "defines": [],
            "browse": {
                "path": [
                    "/usr/include/c++/5.4.0",
                    "/usr/local/include",
                    "/usr/include",
                    "/home/anthony/Programs/playground/code/core/includes"
                ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            }
        }
    ]
}

I've also set up a user-setting override of "C_Cpp.intelliSenseEngine" to "Default". It seems that this is the way to enable experimental semantic autocomplete after doing some digging around the internet.

After setting up my project in this way, I'm getting red squiggles underneath uses of cout as well as non standard library includes like glfwInit letting me know these identifiers are not defined. The thing is, I'm sure that the configuration given above correctly points to the declaration files.

What's weirder to me is that using 'Ctrl + click' on cout or glfwInit brings me immediately to their declarations. VS Code seems to have no problem when it comes to providing the click through functionality.

When I switch VS Code back to the Tag Parser method the red squiggles go away.

I've seen some bugs related to unexpected squiggles (#765) and (#757) but I don't believe this is a related issue after reading through them.

Any guidance on what's wrong with the setup I've got is appreciated. I'd be glad to give more details on my setup if needed.

@sean-mcmanus
Copy link
Contributor

Setting IntelliSenseEngine to Default does not yet enable semantic autocomplete (we're working on adding that next)...it just does errorSquiggles and hover now. The includePath setting is non-recursive, unlike the browse.path setting, which is. If you search through the #includes until you find the 1st missing file, that will tell you what file is really missing (we're in the process of adding this reporting automatically). You might be missing the folder /usr/include/x86_64-linux-gnu/c++/5.4.0 and /usr/include/x86_64-linux-gnu (we have fix for that, which will add that to the default path of a new c_cpp_properties.json)...or you might need /usr/lib/clang/<version>/include. Are you missing system files or your project headers?

@sean-mcmanus sean-mcmanus added Language Service more info needed The issue report is not actionable in its current state labels May 31, 2017
@dtasev
Copy link

dtasev commented Jun 19, 2017

Good to hear semantic autocomplete is in the works

@bobbrow
Copy link
Member

bobbrow commented Jul 3, 2017

@atavern1, were you able to get your c_cpp_properties.json file working? If not, I recommend querying your compiler for the system include path that it uses and pasting that into the json file.
e.g. clang -v -E -x c++ - < /dev/null

@bobbrow
Copy link
Member

bobbrow commented Jul 6, 2017

@atavern1, if you run the clang command above and copy the include paths into your c_cpp_properties.json file, that should resolve the majority of your squiggles. If that does not resolve your issue, please reopen and provide some additional details.

@dtasev, semantic member list suggestions (autocomplete) is available in 0.12.0.

@bobbrow bobbrow closed this as completed Jul 6, 2017
@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
Language Service more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests

4 participants