Intellisense 99.9% Working

VSC 1.42.0, Platfomio Home 3.0.1, Core 4.1.0, Mac OS-X 10.13.6
Installed extensions C/C++ Intellisense 0.26.3, C++ Intellisense 0.2.2 and Platformio IDE 1.10.0.
(Both the above Intellisenses are recommended, does that mean I need both?)

I have an Atmel 2560 project, about 10,000 lines spread over 22 source and 25 include files. Developing on Arduino Mega (and Veroboard!), also have final 2561 version on custom PCB.

The project compiles and runs (both CPUs).

When I open one particular file (just happens to be the largest) I get 11 ā€œProblemsā€ for 3 identiers, all are of the type 'identifier ā€œLCD_LINE_LENā€. ā€œLCD_LINE_LENā€ occurs 180 times in this file

Intellisense does all the right things, I can goto Definitions, Declarations etc., even for the light bulbed ā€˜undefinedā€™ identifiers.

I have a top level workspace with a .vscode dir, projects opened from Platformio Home open in the top level workspace, with their own .vscode dir. The c_cpp_properties.json files appear to be set up to compile for Mac, that confuses me a bit.

Iā€™ve tried many things suggested in the forum, adding build flags, adding include lines to Intellisense config, but canā€™t get rid of the 11 problems.

Can anyone help with this?

Thanks in advance, Ken

You should not activate any additional C/C++ related extensions except:

  • PlatformIO IDE by PlatformIO
  • C/C++ by Microsoft

Itā€™s the expected behavior to have a configuration called Mac if youā€™re running Visual Studio Code on macOS. So no worries.

But you will need to provide more information so we can reproduce it:

  • Can you share the project (e.g. on GitHub)?
  • What are the detailed error messages?

At least try the following steps:

  • Restart Visual Studio Code
  • Rebuild the IntelliSense Index (View / Command Paletteā€¦ / PlatformIO: Rebuild IntelliSense Index)
  • Make sure the PlatformIO project is open in Visual Studio Code and the problematic file has been opened from the Explorer view (and not from an error message in the terminal)
1 Like

Hi Manuel and thanks for your reply.

Removed the extra intellisense extension.

Not keen on sharing this part complete project on GitHub but Iā€™ll do a bit of work on cutting it down to something that shows the problem and share that.

The ā€œProblemā€ messages are all of the type:
identifier ā€œRPM_CORRECT_NONEā€ is undefined [line, col]
identifier ā€œRPM_CORRECT_FULLā€ is undefined [line, col]
identifier ā€œLCD_LINE_LENā€ is undefined [line, col]
identifier ā€œLOOP_OF_DEATHā€ is undefined [line, col]
[line, col] are numeric values

All the problem identifiers are in include files and the project compiles and runs.

At times I also get include errors for the 22 .h files included by the problem file, all of the type:
cannot open source file ā€œads.hā€ C/C++(1696) [line, col]
cannot open source file ā€œtimer0_pwm.hā€ C/C++(1696) [line, col]
cannot open source file ā€œee_prom.hā€ C/C++(1696) [line, col]
These include errors come and go and I donā€™t know what action makes them disappear.

Iā€™ve tried your suggestions, following your steps exactly with no change. Also tried ā€œcodeā€ in a terminal, removing the projects from the workspace and re-adding them with no success.

1 Like