VSCode auto completion and syntax highlighting

Dear community

My hardware is Uno R4
I set up my development environment using VSCode (with C++ extension) and Arduino CLI and using 'make' to wrap the Arduino CLI. the result is I am able to compile, upload, and open serial monitor without any issues.

But I had issue with auto completion and syntax highlighting in VSCode. reason being, for basic project, Arduino CLI will look after the 'include' directory, which means I don't need to include the header file in the source code if those header files are common/basic, the project will compile even without the 'includes'. but without those includes, VSCode failed to recognize some of the variable names. VSCode can help to add the header files, but not the absolute file path, to solve auto completion and syntax highlight issue, but arduino CLI will fail to compile. I can solve this by include the header file using absolute file path.

Is there a setting or parameter I can set in VSCode so that it will automatically include some header files for me?

Thanks

Hi @branchus. Have you tried using this extension?:

I only used it once very briefly so I can't verify, but they do claim that the extension provides "IntelliSense" (auto completion and similar "code aware" features) and syntax highlighting.

This is a very popular extension. The VS Code Marketplace stats don't accurately reflect the extent of its popularity because it was originally created by Microsoft, but Microsoft recently abandoned the extension. The community took over the extension, but its installation and review stats were reset back to zero at that time.

Thank you for the reply, I will have a look at this extension

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.