Use compile_commands.json as alternative input (for includes, defines, ...)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c, vscode
- Domain
- developer-experience, devtools
Research direction
Start by tracing the Makefile Tools configuration-provider path and how it generates or consumes compile_commands.json; compare that with the c_cpp_properties.json example and the kernel module's include and define needs. Done means the extension can use compile_commands.json to supply IntelliSense inputs without manually duplicating the configuration.
Written by the indexing model from the issue text.
Description
I have a simple linux kernel module which has a bunch of includes at the top, e.g.
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/uaccess.h>
The Makefile is also straightforward, e.g.
obj-m += test_module.o
all:
make -C $(KERNEL_DIR) M=$(PWD) modules
clean:
make -C $(KERNEL_DIR) M=$(PWD) clean
KERNEL_DIR is an environment provide variable that points to the Linux kernel source code.
When I launch VSCode I can build the kernel module without any issues, but in the editor under three of the includes a red squiggly line is displayed and it complains that it cannot find the file. Under the other three it finds the system provided header files, rather than the correct ones in the KERNEL_DIR directory.
If I manually provide a c_cpp_properties.json file with the include paths and defines manually specified everything works fine, e.g.
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${env:KERNEL_DIR}/include",
"${env:KERNEL_DIR}/include/uapi",
"${env:KERNEL_DIR}/include/generated",
"${env:KERNEL_DIR}/include/generated/uapi",
"${env:KERNEL_DIR}/arch/x86/include",
"${env:KERNEL_DIR}/arch/x86/include/uapi",
"${env:KERNEL_DIR}/arch/x86/include/generated/",
"${env:KERNEL_DIR}/arch/x86/include/generated/uapi",
"/usr/lib/gcc/x86_64-redhat-linux/12/include"
],
"compilerArgs": ["-nostdinc", "-isystem"],
"browse": {
"path" : [
"${workspaceFolder}",
"${env:KERNEL_DIR}/include",
"${env:KERNEL_DIR}/mm",
"${env:KERNEL_DIR}/fs",
"${env:KERNEL_DIR}/kernel"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"defines": ["__KERNEL__", "MODULE"],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu11",
"cppStandard": "c++14",
"intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}
However I had read that Makefile Tools was supposed to avoid needing to do this manually. Is that not the case?
- Dominant language
- TypeScript
- Stars
- 244
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-makefile-tools
-
`shell: true` with args in `spawnChildProcess` trips Node's DEP0190 on every Makefile configureOpenmore info needed
Difficulty 3/5 Half a day Newbie friendliness 62/100
microsoft/vscode-makefile-tools#842 · 1 comment ·
-
Dry-run during configure executes workspace recipes and can terminate VS Code (kill 0 in a Makefile trap)Possibly taken @JoakimCarlsson claimed this 42 days ago. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 62/100
microsoft/vscode-makefile-tools#835 · 5 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
microsoft/vscode-makefile-tools#825 · 2 comments ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
[Feature] Makefile Tools output window should automatically open when running makefile commandsOpenbug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
All issues in microsoft/vscode-makefile-tools
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
marmelab/react-admin#11431 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
db-ux-design-system/core-web#8655 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
stripe/react-stripe-js#728 ·
-
[Upload Grade C dataset] the pop-up changes it's size while uploading the document => Jumping effectOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
epam/statgpt-admin-frontend#305 ·
Maintainers usually reply within 1 day