Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Ability to set databaseFilename in c_cpp_properties.json #2825

Closed
1 task done
pfeerick opened this issue Jul 24, 2019 · 4 comments
Closed
1 task done
Milestone

Comments

@pfeerick
Copy link
Contributor

  • Feature Request.

It would be good if there was some way to set the databaseFilename specified in the auto-generated c_cpp_properties.json when using VSCode. Even better if it could be set via a VSCode setting, as well as/or rather than a platformio.ini parameter, as it could then span workspaces, and not need to be constantly (re-)configured. Hence the sometimes small (20MB), sometimes larger (80MB+) database files could be put somewhere with enough storage space.

Also need to investigate why the following VSCode do not appear to work.

"C_Cpp.intelliSenseCachePath": <string>
"C_Cpp.intelliSenseCacheSize": <number>

Forum link: https://community.platformio.org/t/vscode-browse-c-cpp-db-in-each-project/7152/8

Also related : platformio/platformio-vscode-ide/issues/787

@ivankravets ivankravets added this to the 4.0.1 milestone Aug 17, 2019
@ivankravets
Copy link
Member

Please re-test with pio upgrade --dev. We removed this configuration from static file. So, you can control C/CPP settings from VSCode.

For example, I tested with this and it works:

{
    "C_Cpp.intelliSenseCachePath": "/tmp/.vscode-cpptools",
    "C_Cpp.default.browse.databaseFilename": "/tmp/.vscode-cpptools/.browse.c_cpp.db"
}

@pfeerick
Copy link
Contributor Author

pfeerick commented Aug 19, 2019

Yup, that seems to do the trick... With 4.0.1-rc1 and vscode-insiders-1.38 (on Windows 10) it's letting me set the folder, and it's initially working perfectly.

    "C_Cpp.intelliSenseCachePath": "R:\\vscode-cpptools",
    "C_Cpp.default.browse.databaseFilename": "R:\\vscode-cpptools\\.browse.c_cpp.db"

But something is writing

"databaseFilename": "${workspaceRoot}/.vscode/.browse.c_cpp.db",

back if I close and open VSCode, during the "PlatformIO: IntelliSense Index Rebuild" stage (after I had manually removed the line, and saved the change. The template file is correct also.). Any idea if that is something in VSCode, or the vscode-extension, or a bug in the insider build?

@ivankravets
Copy link
Member

But something is writing

http://docs.platformio.org/en/latest/faq.html#multiple-pio-cores-in-a-system

Please remove other PlatformIO Cores and use built-in in VSCode.

@pfeerick
Copy link
Contributor Author

pfeerick commented Aug 23, 2019

tl;dr It's working now... Works perfectly on Linux, Windows needed... a reboot?

I'm running dual environments on Windows with PIO (release) on VSCode, and PIO (development) on VSCode Insiders and the following in the VSCode Insiders user settings.json to configure the develop environment. I don't know what was going on with the Windows build, as I booted into Linux, and is behaving perfectly, and I've tried again on Windows and it's working perfectly now, both develop and release. I'll chalk it up to Windows not liking me... it must know it's days as my primary OS are numbered!

    "platformio-ide.useBuiltinPIOCore": false,
    "platformio-ide.useDevelopmentPIOCore": true,
    "platformio-ide.customPATH": "C:\\platformio\\dev\\Scripts",

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

No branches or pull requests

2 participants