Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

The Extension should automagically fill the c_cpp_properties.json, so intellisense works out of the box #438

Closed
mundodisco8 opened this issue Nov 4, 2017 · 123 comments

Comments

@mundodisco8
Copy link

mundodisco8 commented Nov 4, 2017

EDIT: 07/03/2018: My understanding of the issue has improved since I opened it. I think that the extension should fill the intellisense config file on the fly based on the board being selected by the user.

To my knowledge, the Arduino IDE checks for libraries in 4 places: the main Arduino installation path (in windows c:\program files....), any board-specific version of the libraries for this board ("...\appdata\local..."), your sketchbook location and a "libraries" folder for that particular sketch. Ideally, you would install your libraries in your sketchbook location, so they are available for all your projects.

I've just installed VS Code and the Arduino plugin, and it seems to be able to know that my sketchbook location is not the default, as I can see the examples of the libraries that I've installed there, and I can compile my sketch. In any case, I get tens of intellisense errors, as intellisense seems incapable to follow the paths for the includes. I can add the sketchbook location libraries to the c_cpp_properties.json, and either add all the libraries used there (painfull) or add the base "libraries" folder and then tweak the includes to have partial paths (less painfull), but even in these cases, intellisense will complain that it can't find any of the libraries this files might use. And I would have to do it for all my projects, one by one.

What am I doing wrong? why doesn't this plugin pick the usual library locations? Is it normal to have 100s of intellisense errors? is that really the way it's meant to be?

Sorry, I'm new to Visual Studio and Visual Studio Code, and I'm quite sure that the problem it's me not being able to find out the logic behind them, but I can't find any info on the internet either.

I'm using windows 10 64 bits, and my arduino Ide is at the latest version. The relevant part of my c_cpp_settings.json of this project is:

            "name": "Win32",
            "includePath": [
                "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/include/*",
                "C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/um",
                "C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/ucrt",
                "C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/shared",
                "C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/winrt",
                "${workspaceRoot}",
                "C:\\Users\\Joel\\AppData\\Local\\Arduino15\\packages\\SODAQ\\hardware\\samd\\1.6.14\\cores\\arduino"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE"
            ],
            "intelliSenseMode": "msvc-x64",
            "browse": {
                "path": [
                    "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/include/*",
                    "C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/um",
                    "C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/ucrt",
                    "C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/shared",
                    "C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/winrt",
                    "${workspaceRoot}",
                    "C:\\Users\\Joel\\AppData\\Local\\Arduino15\\packages\\SODAQ\\hardware\\samd\\1.6.14\\cores\\arduino"
                ],
                "limitSymbolsToIncludedHeaders": false,
                "databaseFilename": ""
            }
        }

This is a screenshot of my project

2017-11-04_1307

@yaohaizh
Copy link
Contributor

yaohaizh commented Nov 4, 2017

Please see here to see whether help resolve this issue?
https://github.com/Microsoft/vscode-arduino/wiki/FAQ

By default, the Arduino extension doesn't pick up all the head files. You can either pop up the command "Arduino: Library Manager" to include the header file to your paths.

@mundodisco8
Copy link
Author

mundodisco8 commented Nov 6, 2017

Hi,

I just open an example, the blink example, and used the arduino Uno as board. That way, my c_cpp_properties.json has just these two folders:

"C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino",
"${workspaceRoot}"

With that, all the Arduino-defined functions and variables are highlighted as undefined (pinMode, digitalWrite, HIGH,...).

It may be that I don't get how this thing is supposed to work, but I expect from the Arduino plugin to get all these methods by default. I also don't understand why doesn't it search for libraries where the Arduino IDE is expecting to find libraries (that is, the installation folder, the roaming/local/... folder where your boards are installed and the sketchbook location). These folders should be added by default. In any case, even if I add them, I can't get it to work. Yes, it compiles, but it's impossible to use this in a medium sized sketch without getting dozens of errors that make debugging a nightmare.

If my understanding is correct, only the folders in the includePath parameter are used for intellisense, but the search in them is not recursive. I don't know what folders do I have to add to get all the different definitions and methods and whatnot from Arduino working, but I suspect that it could be again dozens of them, not including all the folders I have to include to make a library work if it has dependencies... Is there a way to get Intellisense working on the Arduino plugin or am I doing something that is simply not achievable?

@bandrews
Copy link

bandrews commented Nov 7, 2017

I've been fighting the same thing; since the intellisense parser changed to requiring exact paths from being willing to follow recursive directories, it's basically impossible to set up all the include paths necessary for Arduino usage.

I've been able to add all the libraries to the browse path, which inexplicably does work with recursion. Then, VS Code will suggest folders that are missing from the include path in the light bulb bubble. But I have to play whack-a-mole going deep into the bowels of included microcontroller library structures to get everything added. And the suggestions stop working after you pick only one, so you end up with lots of missing libraries and no way to discover the necessary paths for them...

This really needs to be fixed by the C/C++ extension authors, but judging from their issues database they've seemed stubbornly resistant to feedback requesting the return of recursive search paths. :(

@mundodisco8
Copy link
Author

That's a shame, let's see how things develop, but it looks like a dealbreaker, at least for me at the moment. :(

@aldrDev
Copy link

aldrDev commented Nov 11, 2017

Also been fighting this issue. I have been trying to use the LiquidCrystal library for a project of mine, First it's annoying and unwieldy trying to point to that file - let alone dig around to then find (and point to) the dependencies within that. The c_cpp_properties.json file is becoming a mess trying to keep - I'm rather discouraged to work on a bigger project which might need more libraries.

Any other solutions or alternatives for now? It's a shame because I love Visual Studio Code and it would be perfect to add another type of project to it (I use it for Unity (C#), Java, and Web Development with zero issues)

@yaohaizh
Copy link
Contributor

yaohaizh commented Nov 13, 2017

For please this value to your vscode setting file to see whether fix the intellisense issue:

"C_Cpp.intelliSenseEngine": "Tag Parser",

@aldrDev
Copy link

aldrDev commented Nov 14, 2017

This partially works (In that it stops the problems showing up in my test.ino file; and it seems I can show IntelliSense for methods not affected by problematic includes deeper down the rabbit hole)

As you can see

image

It will suffice for now - At least I can program for (and build) to my Arduino from the comfort of VS Code :) Looking forward to see even tighter / full integration soon.

Thanks @yaohaizh

@JulianGmp
Copy link

JulianGmp commented Nov 17, 2017

I was in a similar situation trying to set up vscode for programming ESP chips (using Arduino).
I got intellisense to work, but I haven't done too much testing so this solution might not be final one.

But it does give me preview for parameters in the FastLED Library, which is installed under D:\Users\Julian\Documents\Arduino\libraries\FastLED.
2017-11-17 21_47_49-ws2812_manager ino - source - visual studio code

Stuff I did:

  • Force Intellisense to use the "Tag Parser" in the User Settings:
"C_Cpp.intelliSenseEngineFallback": "Disabled",
"C_Cpp.intelliSenseEngine": "Tag Parser",
  • Set up the c_cpp_properties.json
{
    "name": "Arduino",
    "includePath": [
        "${workspaceRoot}"
    ],
    "browse": {
        "path": [
            "D:/Program Files (x86)/Arduino/hardware",
            "D:/Program Files (x86)/Arduino/libraries",
            "D:/Users/Julian/Documents/Arduino/libraries/",
            "D:/Users/Julian/Documents/Arduino/hardware/",
            "${workspaceRoot}"
        ],
        "limitSymbolsToIncludedHeaders": true,
        "databaseFilename": ""
    },
    "intelliSenseMode": "msvc-x64"
}

that way, only the Tag Parses will be used as the engine and the config in the c_cpp_properties.json becomes a lot simples, since intellisense reads directories recursively now. That way I also got the engine to read libraries I installed manually, since they are placed in my homedirectory (D:/Users/Julian/Documents/Arduino/libraries/). Same goes for boards I installed, like the ESP8266, which has its package sit in "D:/Users/Julian/Documents/Arduino/hardware/".
Also, I used this as a source.

I'm gonna try to config the Arduino extension from Microsoft as well now, if I run into some issues I can fix I will comment them here.

@dafzor
Copy link

dafzor commented Nov 21, 2017

I have not tried the tag parser setting suggested here, but had come up with a solution which was to simply add all the include paths by hand.

For a basic hello world program on a UNO like this:

#include <Arduino.h>
#define LED_PIN 10

void setup() {
    pinMode(LED_PIN, OUTPUT);
}

void loop() {
    digitalWrite(LED_PIN, HIGH);
    delay(1000);
    digitalWrite(LED_PIN, LOW);
    delay(1000);
}

I need a C_Cpp_properties.json like this:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceRoot}",
                "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino",
                "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\\avr\\include",
                "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\\lib\\gcc\\avr\\4.9.2\\include",
                "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\mega"
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": false,
                "path": [
                    "${workspaceRoot}",
                    "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino",
                    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\\avr\\include",
                    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\\lib\\gcc\\avr\\4.9.2\\include",
                    "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\mega"
                ]
            },
            "intelliSenseMode": "msvc-x64"
        }
    ],
    "version": 3
}

Maybe changing it so that Arduino: Board Config actually includes all the needed paths could be a start for trying to fix the issue.

@InRiPa
Copy link

InRiPa commented Nov 22, 2017

@dafzor Thanks. I adjusted it for linux and it works. At least I got autocompletion and intellisense working. In case someone else needs it, here is my config:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "/usr/lib/gcc/avr/7.2.0/include",
                "/home/<user>/.arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino",
                "/usr/avr/include/",
                "/home/<user>/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/avr/include",
                "/usr/share/arduino/hardware/archlinux-arduino/avr/variants/mega"
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": false,
                "path": [
                    "/usr/lib/gcc/avr/7.2.0/include",
                    "/home/<user>/.arduino15/packages/arduino/hardware/avr/1.6.20/cores/arduino",
                    "/usr/avr/include/",
                    "/home/<user>/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/avr/include",
                    "/usr/share/arduino/hardware/archlinux-arduino/avr/variants/mega"
                ]
            },
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 3
}

@heyAyushh
Copy link

Somebody Please tell this for mac too

@carlhung
Copy link

I can't find the path for Mac

@JulianGmp
Copy link

@stormbytes I think that is caused because the Arduino.h file isn't included by default in Visual Studio's mind. The Arduino Software obviously includes their core when compiling.
Adding the #include <Arduino.h> or the #include <Esp.h> when using ESP Controllers won't cause issues though. It's a bit annoying but oh well, better than having to use the Arduino "IDE"

@JulianGmp
Copy link

JulianGmp commented Dec 17, 2017

@stormbytes I'm not using PlatformIO, I'm using the Arduino Extension from Microsoft

But I guess both extensions didn't prevent this from happening, oh well not the End of the world

@yaohaizh
Copy link
Contributor

The official Arduino IDE will include the <Arduino.h> behind in their tooling. But for VSCode Arduino extension, we have to include explicitly, just as normal C/C++ file to make the intellisense work. But you doesn't need this header file for build/upload.

@dafzor
Copy link

dafzor commented Dec 18, 2017

Just leaving the info here that even if you setup the include paths the intellisense will still not work 100%. For example, if you include SD.h library and a line like this File myfile = SD.open("myfile"); it will show several type definition errors even though the sketch will compile and run correctly.

So I ended up moving to http://www.visualmicro.com until the vscode extension gets fixed.

@DavidKarlas
Copy link
Member

DavidKarlas commented Jan 6, 2018

On macOS, I added #include <Arduino.h> to beginning of .ino file and I filled c_cpp_properties.json content with:

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceRoot}",
                "/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino",
                "/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega",
                "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include",
                "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/lib/gcc/avr/4.9.2/include"
            ],
            "defines": ["UBRRH"],
            "browse": {
                "limitSymbolsToIncludedHeaders": false,
                "path": [
                    "${workspaceRoot}",
                    "/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino",
                    "/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega",
                    "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include",
                    "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/lib/gcc/avr/4.9.2/include"
                ]
            },
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 3
}

Notice that #include <Arduino.h> line shows error, but you can ignore it and have Intelisense working for rest of file...

@heroboy
Copy link

heroboy commented Jan 10, 2018

I think you can run arduino_debug.exe, compile a sketch. You can look the console window for it how to call avr-g++ to know the predefined macros and include path. Finally my json file look like this:

{
    "configurations": [
        {
            "name": "Win32",
            "defines": [
                "F_CPU=16000000L",
                "ARDUINO=10805",
                "ARDUINO_AVR_UNO",
                "ARDUINO_ARCH_AVR"
            ],
            "includePath": [
                "D:\\tools\\arduino-1.8.5\\hardware\\arduino\\avr\\cores\\arduino",
                "D:\\tools\\arduino-1.8.5\\hardware\\arduino\\avr\\variants\\standard",
                "D:\\tools\\arduino-1.8.5\\hardware\\tools\\avr\\avr\\include",
                "D:\\tools\\arduino-1.8.5\\hardware\\tools\\avr\\lib\\gcc\\avr\\4.9.2\\include"
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": false,
                "path": [
                    "D:\\tools\\arduino-1.8.5\\hardware\\arduino\\avr\\cores\\arduino",
                    "D:\\tools\\arduino-1.8.5\\hardware\\arduino\\avr\\variants\\standard",
                    "D:\\tools\\arduino-1.8.5\\hardware\\tools\\avr\\avr\\include",
                    "D:\\tools\\arduino-1.8.5\\hardware\\tools\\avr\\lib\\gcc\\avr\\4.9.2\\include"
                ]
            },
            "intelliSenseMode": "msvc-x64"
        }
    ],
    "version": 3
}

@raffaeler
Copy link

I also retried today to configure the support for intellisense and it doesn't work.
After configuring the includePath, now it request WProgram.h even if the Arduino installation is totally updated.
I don't want to waste time and give up.

@clouds56
Copy link

If you meet something like identifier "Serial" not defined, also add "USBCON" into defines in configurations
See cpptools document for more details.

I'm not sure if there're other flags like this, while I hope the extension could do this automatically for us, since we have done setup the "Arduino Board Configuration".

@raffaeler
Copy link

Nope, in my case the problem is the editor. No way to configure properly the intellisense and get rid of the squiggles on the includes

@clouds56
Copy link

Which header is trying to request "WProgram.h"? In my linux package, there's no WProgram.h and no header's including it.

@dafzor
Copy link

dafzor commented Jan 20, 2018 via email

@raffaeler
Copy link

The library is DHT.h from Adafruit and is updated.
The DHT.h file specifies the same preprocessor definitgions you wrote, but it complains
image

If I right click the DHT.h and navigate to definition, the DHT.h file gets opened.
Arduino IDE version 1.8.2
DHT unified 1.0.0
DHT sensor library 1.3.0

@clouds56
Copy link

It's also about defines, the ARDUINO macro is not defined, add

defines: [ "ARDUINO=100" ],

to your c_cpp_properties.json

I'm assuming you're using this DHT.h, and your ARDUINO version is 100, change it if necessary.

@raffaeler
Copy link

Looks far better now, thanks!
I am adding other include paths and then will try connecting the devices.

I don't understand why the vscode extension does not provide somthing to get this easier. Also the doc does is not clear about the settings needed to make it work.

@mundodisco8
Copy link
Author

mundodisco8 commented Feb 2, 2018

Still, all the solutions force you to use the tag parser, as the default mode doesn't work. I don't think the issue is solved, as the default mode doesn't work. Even including all the individual paths, I still get errors of undefined stuff that is clearly defined in libraries I'm including.
Having to go back a mode that has less features in order for it to work doesn't seem like a solution to me, but more like a patch while we work on the issue (something that I'm super grateful to have the option to use as a fallback, don't get me wrong).
That's why I think the issue should be open. I know that intellisense is not part of this plugin, but you should be either able to talk to the c/c++ plugin team in order to make them aware of this type of issues, or change the c_cpp_properties.json on the fly, based on the selected board, to add the barebones "browse.path".

All the best and good luck.

@mundodisco8
Copy link
Author

Another example:
I get errors on all the register names and bit names used to manipulate them. They are defined in "avr/io.h" (location dependant on your architecture), which is basically a bunch of #ifdefs. I understand that is not being picked because the relevant word for my board is not being defined (whereas the Arduino IDE defines all the relevant words), much like in the case of raffaeler with the Wprogram.h library. How can we overcome this? is there a list of stuff that is known to be defined by the IDE that is not being properly passed to intellisense?

@mu578
Copy link

mu578 commented Jan 3, 2021

@iFreilicht

Screen-Shot-2021-01-03-at-08 48 17

@adiazulay
Copy link
Contributor

@moe123 are these errors in the v0.3.4 or did you build #1141 locally?

@iFreilicht
Copy link

iFreilicht commented Feb 17, 2021

@adiazulay Has #1183 found it's way into the current release?

If so, you can probably close this issue along with #776, #772 and #866.

EDIT: Ah sorry, just checked, this seems to only be part of the 0.4rc release right now.

@adiazulay
Copy link
Contributor

@iFreilicht if you download it and install the .vsix directly in vs code and let me know it works as expected on your end we could probably get it released today. Otherwise it'll probably be early next week.

link to release: https://github.com/microsoft/vscode-arduino/releases/tag/v0.4.0-rc2

@iFreilicht
Copy link

@adiazulay I tested this with a few boards and it seems to work well, except for #1206 as you reported. I am getting error: '__FlashStringHelper' does not name a type when trying to compile a sketch containing F() for Digispark, but didn't have time to dig into it.

@Benik3
Copy link

Benik3 commented Feb 22, 2021

I just tried it too, but for some reason the "auto fill" doesn't work for me.
On previous version it at least added library folders on startup of VScode.

@adiazulay
Copy link
Contributor

@Benik3 are you using v0.4.0-rc2? If you are can you try to rebuild intellisense configuration?

@Benik3
Copy link

Benik3 commented Feb 22, 2021

Yep, I installed the version posted above.
I tried to completely delete .vscode folder, is it OK?

@Benik3
Copy link

Benik3 commented Feb 22, 2021

I sinteresting, that when I open Arduino examples, I have different info in the bar down:
Mainly on example it say Arduino, on manual opened .ino file it say Win32
obrazek

@iFreilicht
Copy link

tried to completely delete .vscode folder, is it OK?

Yes, you can do that, but you have to select a board and serial port again afterwards.

Mainly on example it say Arduino, on manual opened .ino file it say Win32

Could you post a link to the .ino file you're having trouble with? I tested this on several of my projects, and couldn't reproduce your issue.

And try to run "Verify" once, after that all the library folders should be added!

@adiazulay
Copy link
Contributor

I found that in some cases if c_cpp_properties.json was generated with v0.3 you have to delete it for the new one to generate correctly.

@Benik3
Copy link

Benik3 commented Feb 22, 2021

Temperature_logger.zip
Here is e.g. project on which I try it. Even after Verifiy it didn't change.
I'm on windows 10 2004, VS Code 1.53.2
obrazek

@Benik3
Copy link

Benik3 commented Feb 22, 2021

It looks like I found the problem. I didnt know, that I have to make Verify, to init it. So when I wanted to check the configuration, VScode automatically inited the default CPP json. After this, it never re-init as Arduino.

After good initiation I really have included libraries folder, ESP8266 definition etc., so it looks good :)

I also found, that sometime the Verify is launched automatically (it happen after opening the VScode, opening the example, now it happen immediately after what was manual Verify done).

@iFreilicht
Copy link

iFreilicht commented Feb 28, 2021

I didnt know, that I have to make Verify, to init it. So when I wanted to check the configuration, VScode automatically inited the default CPP json. After this, it never re-init as Arduino.

Which is why I wrote:

And try to run "Verify" once, after that all the library folders should be added!

But ok, glad to see you got it working 👍️

I also found, that sometime the Verify is launched automatically (it happen after opening the VScode, opening the example, now it happen immediately after what was manual Verify done).

Yes, as Adi already explained above:

I found that in some cases if c_cpp_properties.json was generated with v0.3 you have to delete it for the new one to generate correctly.

@itopaloglu83
Copy link

itopaloglu83 commented Mar 5, 2021

Automagical creation of the c_cpp_properties.json is quite good but it's missing one important definition, architecture type.

/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/boards.txt contains definitions about each board. For example Arduino Uno has the following build configuration.

uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.board=AVR_UNO
uno.build.core=arduino
uno.build.variant=standard

The important one here for the intelligence is the mcu=atmega328p directive. This directive will later be converted to a compile time directive of -mmcu=atmega328p, This is so that avr-gcc will use that directive to define the macro shortcut of __AVR_ATmega328P__ .

https://www.nongnu.org/avr-libc/user-manual/using_tools.html

Long story short, defining the architecture type in c_cpp_properties.json as below resolved most of the strange behaviors for me.

"defines": [
    "USBCON",
    "__AVR_ATmega328P__"
],

This screenshot shows what kind of an error user would experience if the microcontroller is not defined properly. Most of the C/C++ functions, and Arduino functions would work perfectly, but any pin or bit definitions that are chip specific would fail. The screenshot shows that inteellisense failing to determine the current context and showing all the matching definitions for all AVR family chips.

Screen Shot 2021-03-05 at 00 19 10

Normally UCSR0B is defined under /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/iom328p.h for the ATmega328P chips.

@starofys
Copy link

starofys commented Mar 9, 2021

v0.4.0-rc3
missing header includes
use https://github.com/rogerclarkmelbourne/Arduino_STM32
image

@adiazulay
Copy link
Contributor

@starofys was the last includePath not automatically generated?

@starofys
Copy link

@starofys was the last includePath not automatically generated?
it's automatically generated
i need add defined in boards.txt by custom

Arduino_STM32\STM32F1\cores
Arduino_STM32\STM32F1\variants
Arduino_STM32\STM32F1\libraries

and in boards.txt compiler.libs.c.flags
compiler.libs.c.flags="-I{build.system.path}/libmaple" "-I{build.system.path}/libmaple/include" "-I{build.system.path}/libmaple/stm32f1/include" "-I{build.system.path}/libmaple/usb/stm32f1" "-I{build.system.path}/libmaple/usb/usb_lib"

@iFreilicht
Copy link

@itopaloglu83 Do you know which boards are affected by this? It seems all the regular Arduino boards and a lot of third-party ones work just fine without this definition.

@itopaloglu83
Copy link

Uhm, I would say it’s pretty common. Arduino Uno sketches get syntax highlighting errors. Not the missing include statements but the define statements for the pre-compiler. See my message above.

@iFreilicht
Copy link

iFreilicht commented Mar 16, 2021 via email

@adiazulay
Copy link
Contributor

IntelliSense auto-generation has been added in v0.4.0. If you're having any problems with IntelliSense please open a new issue.

@Noah-Schoonover
Copy link

I found that in some cases if c_cpp_properties.json was generated with v0.3 you have to delete it for the new one to generate correctly.

Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.