vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Auto-Completion has some error

Open Kurt-Shiwz opened this issue 9 years ago • 10 comments

Auto-Completion has some error,can't suggest right word qq20170809-001127 2x

Kurt-Shiwz avatar Aug 08 '17 16:08 Kurt-Shiwz

Did you set "intelliSenseEngine": "Default" in your settings.json file? You currently have to opt-in to the new IntelliSense engine which does give back the exact results for structs, classes, and namespaces.

bobbrow avatar Aug 08 '17 16:08 bobbrow

@Kurt-Shiwz Also, the "Tag Parser" (fuzzy) autocomplete is expected to give too many results, although the t should be found after typing t.

sean-mcmanus avatar Aug 08 '17 22:08 sean-mcmanus

I have been set "intelliSenseEngine": "Default", but it appears the same error, show me a large list that content isn't what I expect, I set "C_Cpp.autocomplete": "Default" too

FMLS avatar Aug 09 '17 06:08 FMLS

@FMLS, it is still expected to get a large list if you are typing variable/class names. The Default intelliSenseEngine provides suggestions for class/struct/namespace members (e.g. after you type ., ->, ::) everything else is still using the Tag Parser.

bobbrow avatar Aug 09 '17 17:08 bobbrow

Same error happened on my computer. IntelliSense Engine can't identify the structure member, always show a large list. I have set ""C_Cpp.intelliSenseEngine": "Default",". I deleted the symbols folder in C:\Users\XXX\AppData\Roaming\Code\User\workspaceStorage, and re-parse the code by C/C++ extension tool, but have no effect. (Windows Server 2012 R2, VS code 1.14.2, C/C++ extension 0.12.2)

vscpp avatar Aug 10 '17 06:08 vscpp

@vscpp It sounds like you are falling back to the "Tag Parser" due to missing includePath paths that can't be found. What does it show in your Problems window?

sean-mcmanus avatar Aug 10 '17 16:08 sean-mcmanus

@sean-mcmanus I checked the error message, seems Intellisense force to switch to "Tag Parser". I am a UEFI BIOS developer, the UEFI has its own rules of grammar. UEFI define .dec file which include the include path, UEFI build tool will parse all header file by its rule. So seems it's difficult for VS code.

But Source Insight works, I believe VS code C++ extension will be more better than SI. :) image

vscpp avatar Aug 11 '17 06:08 vscpp

@vscpp I don't really understand. Are your header files actual files with a path you can add to the c_cpp_properties.json includePath setting? If not, you can turn the intelliSenseEngineFallback setting to "Disabled", although you might get error squiggles about unknown identifiers.

sean-mcmanus avatar Aug 11 '17 18:08 sean-mcmanus

@sean-mcmanus why can't just prompt t? 2017-08-12 15 28 10 2017-08-12 15 29 34

Kurt-Shiwz avatar Aug 12 '17 07:08 Kurt-Shiwz

@Kurt-Shiwz the Tag Parser can't just prompt "t" because it doesn't know the type of the variable on the left side of the .. It just returns a list of all symbols that have been parsed that could be used as a member of something. The "default" IntelliSense engine knows the type, so it can suggest just "t".

bobbrow avatar Aug 15 '17 22:08 bobbrow