-
Notifications
You must be signed in to change notification settings - Fork 129
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
Implement c_cpp_properties.json file generator fixes #1201 #1205
Conversation
Should be working as expected now. |
I came across this tweet which points to /~https://github.com/r-lib/usethis/blob/main/R/vscode.R, but it does not look like general enough. Not sure if it is helpful here. |
Thanks, this captures LinkingTo detectives from the DESCRIPTION and general R paths, but this PR also compiles dummy files to capture everything in configure and Makevars (defines, local includes, system dependencies, ...). I imagine the usethis script is meant to be edited manually later. (I'm not sure why the CI fails, it might be an unrelated issue) |
I tried it with latest httpgd on macOS, and the following file is produced (an empty {
"configurations": [
{
"name": "Mac",
"defines": [
"NDEBUG",
"BOOST_NO_AUTO_PTR",
"FMT_HEADER_ONLY"
],
"includePath": [
"${workspaceFolder}/src",
"/Library/Frameworks/R.framework/Versions/4.2/Resources/include",
"${workspaceFolder}/src/lib",
"/usr/local/include",
""
],
"compilerPath": "/usr/bin/clang++",
"cStandard": "${default}",
"cppStandard": "gnu++14",
"intelliSenseMode": "macos-clang-x64"
}
],
"version": 4
} with the following error: |
This is a bug, even when no C/C++ is used, the action should generate a config as you should be able to run it prior to adding C/C++ files. Can you try again? I don't get this error but have added stricter null checks everywhere (7d4ade3). A bit off-topic but what's the consensus on tsconfig.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it with httpgd, languageserver, and RMariaDB and all work nicely!
LGTM
Thanks for the nice work!
Thank you for your comments and the review! |
What problem did you solve?
This PR implements a command "Generate c_cpp_properties.json" that generates the file by collecting information from invoking the compiler and from the DESCRIPTION file.
This enables code completion, IntelliSense, etc. for C/C++ files in R packages.
The issue is described in more detail here: #1201
Demo
Code_rcwvV3zBYQ.mp4
TODO