Skip to content

compile_commands.json not work #11887

@piterzhang

Description

@piterzhang

Environment

  • OS and Version: windows
  • VS Code Version: 1.85.2
  • C/C++ Extension Version: 1.85.5
  • If using SSH remote, specify OS of remote machine:

Bug Summary and Steps to Reproduce

Bug Summary:

1.c_cpp_properties.json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64",
"compileCommands": "${workspaceFolder}/compile_commands.json"
}
],
"version": 4
}

  1. files in my wokerspec :
    piter@Y9000p:/mnt/d/Work/EmbeddedTutorial/LittleKernel/lk$ ls -al
    total 732
    drwxrwxrwx 1 piter piter 4096 Jan 20 11:25 .
    drwxrwxrwx 1 piter piter 4096 Jan 20 11:00 ..
    -rwxrwxrwx 1 piter piter 120 Dec 29 09:02 .gitignore
    drwxrwxrwx 1 piter piter 4096 Jan 20 11:19 .vscode
    -rwxrwxrwx 1 piter piter 1132 Dec 29 09:02 LICENSE
    -rwxrwxrwx 1 piter piter 1344 Dec 29 09:02 README.md
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 app
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 arch
    drwxrwxrwx 1 piter piter 4096 Jan 20 11:25 build-qemu-virt-arm32-test
    -rwxrwxrwx 1 piter piter 719792 Jan 20 11:25 compile_commands.json
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 dev
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 docs
    -rwxrwxrwx 1 piter piter 12519 Dec 29 09:02 engine.mk
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 external
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 kernel
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 lib
    -rwxrwxrwx 1 piter piter 590 Dec 29 09:02 lk_inc.mk.example
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 make
    -rwxrwxrwx 1 piter piter 1164 Jan 20 11:12 makefile
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 platform
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 project
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 scripts
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 target
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 tools
    drwxrwxrwx 1 piter piter 4096 Dec 29 09:02 top

  2. out put:
    [1/20/2024, 11:31:02 AM] "init.c" not found in "${workspaceFolder}/compile_commands.json". 'includePath' from c_cpp_properties.json in folder 'lk' will be used for this file instead.
    [1/20/2024, 11:42:29 AM] "init.c" not found in "${workspaceFolder}/compile_commands.json". 'includePath' from c_cpp_properties.json in folder 'lk' will be used for this file instead.

  3. click function cat't go to the right file

image

Configuration and Logs

[1/20/2024, 11:31:02 AM] "init.c" not found in "${workspaceFolder}/compile_commands.json". 'includePath' from c_cpp_properties.json in folder 'lk' will be used for this file instead.
[1/20/2024, 11:42:29 AM] "init.c" not found in "${workspaceFolder}/compile_commands.json". 'includePath' from c_cpp_properties.json in folder 'lk' will be used for this file instead.

Other Extensions

No response

Additional context

No response

### Tasks

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions