Vscode: How to see system includes in project explorer?

Hello all,
I am new in platformio, and try to study it. Previously I used visualgdb plugin.
In visualgdb I could see all includes (from my project and system includes (for example stm specific (stm32*.h stm32_hal… and so on.)
see screenshot:

In vscode + platformio I cannot see them. Also I cannot search them with CTRL+P hotkey. (test blinky project was created from examples, It successfully compiled, also code navigation to definition, declaration, popup hints are working)

Is it possible to include them?
Is it possible to use CTRL+P to search also system includes ?

P.S. vscode 1.42, platformio 1.10

platformio.ini:
[env:nucleo_f103rb]
platform = ststm32
framework = stm32cube
board = nucleo_f103rb
build_flags = -DF1

screenshot from platformio without system includes:

The workspace viewer and Intellisense completion are provided by VSCode and the C/C++ intellesense plugin by Microsoft, so I think these features should be added there. (GitHub - microsoft/vscode-cpptools: Official repository for the Microsoft C/C++ extension for VS Code. and Issues · microsoft/vscode · GitHub)

PlatformIO is also able to generate VisualStudio projects, see documentation.

1 Like

Hello, I don’t think this is issue of Microsoft plugin.

In case of raw c/c++ project. I can add folders in *.code-workspace file:

{
	"folders": [
		{
			"path": ".",
		},
		{
			"path": "/usr/include/,
			"name": "system_includes"
		}
	],	
}

Search “CRTL+P” and view in explorer will work successfully.

In case of platformio. I tried to add:

{
	"folders": [
		{
			"path": ".",
		},
		{
			"path": "/home/vdybala/.platformio/packages/framework-stm32cube/f1/Drivers/STM32F1xx_HAL_Driver/Inc",
			"name": "system_includes"
		}
	],	
}

But it seems does not work. Search still does not work, In explorer I still cannot see system includes.

Maybe @ivankravets can figure out how to use this .code-workspace to implement this feature. You can also open a feature-request issue in Issues · platformio/platformio-core · GitHub.

2 Likes

@valeros please help