mitaki28 / vscode-clang

Completion and Diagnostic for C/C++/Objective-C using Clang
MIT License
128 stars 24 forks source link

Context-sensitive autocomplete #28

Open SubhamoyS opened 8 years ago

SubhamoyS commented 8 years ago

I have installed cpptools and vscode-clang and no other autocomplete or linting extensions. I have Clang 3.8 installed on Ubuntu 14.04.

My settings.json looks like this:

{
    "clang.diagnostic.enable": false,
    "clang.cxxflags": ["-std=c++11", "-std=c++14", "-std=c++1z"]
}

My .clang-complete file looks like this:

"-I/usr/include"
"-I${workspaceRoot}/src"

In C++ code, when trying to autocomplete, I am getting a mind-numbing number of suggestions, among which there might exist the ones I require, but there is really no way to tell, unless I already know what it is, and I type several characters of it.

Is this expected behaviour, or have I failed to configure things properly?

screenshot 1 screenshot 2

san-chang commented 8 years ago

this two extension seems doesn't work well together. I like the auto-complete provide by C/C++ Clang, and the go to define provide by cpptools

I can't get the source code of cpptools

  • anyone help me for this ?

so It's hard to find the problem (for me) :)

finally I uninstall the cpptools and fork this repo, and try to add features of "go to define"

I don't known when I can finish this, but just try to do. for debug feature, may be a big build :)

SubhamoyS commented 8 years ago

I don't see how that would help solve the above issue though.

san-chang commented 8 years ago

"just use the MS C/C++ plugin that has this working (though not perfectly - they tend to open duplicate instances of the same file)"

said here : https://github.com/mitaki28/vscode-clang/issues/11

so I guess "this two extension seems doesn't work well together."

have you try to uninstall the cpptools provide by MS, then retest this?

because It's work well for me just use vscode-clang.

I hope it could help you sometime.

Pouja commented 7 years ago

Try "C_Cpp.autocomplete": "Disabled" setting in your settings.json So you get the best of two worlds: go to definition of MS C/C++ and the working completion of this plugin.