Skip to content

Add compilation_db to scons build to create compile_commands.json for automatic LSP configuration #91

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

Closed
wants to merge 1 commit into from

Conversation

keks137
Copy link

@keks137 keks137 commented Jun 17, 2025

by default my LSP cant find a bunch of stuff
since scons is an atypical build system I can't just use bear to generate the compile_command.json file for clangd
scons does however have a feature to generate the file itself, so I decided to add it
thought it might make sense to add this to the template itself, so that LSPs just work out of the box

@Ivorforce
Copy link
Member

Ivorforce commented Jun 17, 2025

Hi @keks137, thank you for contributing!
godot-cpp based projects already have support for this feature, out of the box. The way you generate the file is:

scons compiledb=yes compile_commands.json

This is documented in the godot docs here, but it's hard to find - In the godot-cpp section, it's only subtly mentioned in the "Getting Started" document.

I have an open PR to the docs to make this more acessible; unfortunately it hasn't reached consensus yet.

@keks137
Copy link
Author

keks137 commented Jun 17, 2025

oh ok thanks
maybe you could add it in some kind of (Optional) section or something to the Usage section in the Readme of this template
just so people like me can easily find it

@paddy-exe
Copy link
Collaborator

paddy-exe commented Jun 18, 2025

This can be closed now that #92 has been merged.

@paddy-exe paddy-exe closed this Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants