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

Respect .clangd CompilationDatabase configuration #1816

Open
ADKaster opened this issue Nov 11, 2024 · 1 comment
Open

Respect .clangd CompilationDatabase configuration #1816

ADKaster opened this issue Nov 11, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ADKaster
Copy link

Description

SourceKit-LSP does not search in the relative path provided by the clangd config file's CompilationDatabase configuration.

https://clangd.llvm.org/config#compilationdatabase

Example .clangd:

CompileFlags:
  CompilationDatabase: Build/release

Diagnostics:
  UnusedIncludes: None
  MissingIncludes: None

Given only this configuration, clangd finds my compile_commands.json in Build/release relative to the project root.

SourceKit-LSP only finds my compile_commands json after creating a symlink to the project root.

Here's the log from the Swift tab of VsCode's Output window:

13:58:42: Swift version 6.1-dev (LLVM cdc8e8b92cfb482, Swift fc03688e63434e8)
Swift Path: /home/andrew/.local/share/swiftly/toolchains/main-snapshot-2024-09-18/usr/bin
Toolchain Path: /home/andrew/.local/share/swiftly/toolchains/main-snapshot-2024-09-18/usr
Runtime Library Path: /home/andrew/.local/share/swiftly/toolchains/main-snapshot-2024-09-18/usr/lib/swift/linux
Default Target: x86_64-unknown-linux-gnu
13:58:42: SourceKit-LSP setup
13:58:42: focus: undefined
14:36:48: unfocus: undefined
14:36:49: ladybird-browser: add: /home/andrew/ladybird-org/ladybird-browser
14:36:49: ladybird-browser: focus: /home/andrew/ladybird-org/ladybird-browser

At 14:36:49 I added the symlink ln -s Build/release/compile_commands.json compile_commands.json, and SourceKit-LSP immediately picked it up.

@ADKaster ADKaster added the enhancement New feature or request label Nov 11, 2024
@ahoppen
Copy link
Member

ahoppen commented Nov 11, 2024

Synced to Apple’s issue tracker as rdar://139673190

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants