0

Is it possible that VSCode code completion only offers those elements in the list that I have already used, but does not read the header files of glibc and the given environment? I use the Espressif plugin and I am surprised to find that, for example,

arg_print_syntax(stdout, (void *) &blink_args, "\n");

I want to call it, I press ctrl space after "arg" and it does not offer it, even though at the beginning of the file there is

 #include "argtable3/argtable3.h"

If I type it in and recompile it, it offers it, but only that,

arg_print_glossary(stdout, (void *) &blink_args, "%-25s %s\n");

it does not offer it again until I type it in and compile it. The path to the esp-idf components libraries is set in c_cpp_properties.json:

"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}/**"
],

The eclipse plugin reads all the libraries accurately and offers them, but this vscode is not correct and it is very disappointing that the built-in "AI" is so deceptive, even if it is called intelliSense.

9
  • What extension are you using specifically? I am not too familiar with using Espressif for embedded, but I usually use clang for "code completion" and it works very well out of the box, even for finding definitions from libraries. Commented Oct 3 at 8:58
  • make sure your CMakeLists.txt for the project contains your intention of using the console component (contains argtable3 among others), and that you reran cmake, so it can update all the build stuff. that also touches files that vscode draws upon for intellisense. Commented Oct 3 at 15:24
  • I use Espressif IDF extension 1.10.2 in vscode 1.104.1 on linux. Commented Oct 3 at 15:28
  • CMkaeLists.txt is ok, because I can compile the code successfully. Commented Oct 3 at 15:29
  • have you tried restarting vscode? have you tried clearing/rebuilding whatever caching/indexing that intellisense does? Commented Oct 3 at 15:29

1 Answer 1

0

the solution is change microsoft c/c++ plugin to Clangd plugin. It works like Eclipse plugin.
in command line:

code --uninstall-extension ms-vscode.cpptools

and

code --install-extension llvm-vs-code-extensions.vscode-clangd

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.