0

Has anyone here gotten IntelliSense to work relatively flawlessly in Visual Studio Code for Arduino with DxCore projects? I've gotten most of the way, but still have some issues.

For me, any calls to Serial.printf() get marked with a red squiggly. Ctrl+clicking on printf shows me the definition just fine. Other things here and there have the same behavior. For example, va_start within the printf definition.

In addition to that, when verifying the sketch, I get: [Error] Failed to read or write IntelliSense configuration: {} Don't think it's a real problem, but it's annoying.

Here's my c_pp_properties.json file:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "C:\\Users\\nabel\\OneDrive\\Documents\\ArduinoData\\packages\\DxCore\\hardware\\megaavr\\**",
                "C:\\Users\\nabel\\OneDrive\\Documents\\Arduino\\libraries\\**",
                "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\**",
                "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\**",
                "C:\\Program Files (x86)\\Arduino\\tools\\**",
                "C:\\Program Files (x86)\\Arduino\\libraries\\**"
            ],
        "forcedInclude": [
            "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino\\Arduino.h"
        ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE",
                "ARDUINO=10816", // Should be updated for version of Arduino IDE installed; https://stackoverflow.com/a/30928558
                "USBCON"
            ],
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "windows-msvc-x64"
        }
    ],
    "version": 4
}

If anyone has IntelliSense working well, could you share your c_pp_properties.json file? Thanks!

nabelekt
  • 99
  • 3
  • 12
  • 1
    Usually you should reach out to the right community to get an answer, https://github.com/microsoft/vscode-arduino/issues – Lex Li Nov 25 '21 at 01:01
  • Thanks for the link! I didn't realize that the project was on Github. It looks like others might be having similar issues. I posted in https://github.com/microsoft/vscode-arduino/issues/1364. – nabelekt Nov 25 '21 at 01:30
  • 1
    Most VSCode extensions are open sourced on GitHub, so you can follow the "Resources" section on Marketplace page to locate the repos, https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino – Lex Li Nov 25 '21 at 03:04

1 Answers1

4

JSON doesn't allow javascript comments my friend! Remove it and Bob's your uncle.

  • Are you referring to the `/**`? That is the syntax for a recursive include path and is commonly seen in these configuration files. – nabelekt May 20 '22 at 22:35
  • 1
    No. I'm referring to the comment: // Should be... – Maziar Rezaei May 22 '22 at 13:36
  • Ah! I will give that a try! I was confused because the `//` came from my C background and it's been several years since I've written any JS. Thanks! – nabelekt May 24 '22 at 16:31