Set path to compileCommands automatically.#247
Open
Symbitic wants to merge 1 commit intoxmake-io:devfrom
Open
Conversation
Member
|
If the user does not have cpptools installed and is only using clangd. Does it work? https://xmake.io/#/plugin/more_plugins?id=clangd |
waruqi
reviewed
Jan 5, 2024
| const compileCommandsFile = path.join(config.compileCommandsDirectory, "compile_commands.json"); | ||
| const compileCommandsWatcher = vscode.workspace.createFileSystemWatcher(compileCommandsFile); | ||
| compileCommandsWatcher.onDidCreate(() => { | ||
| const config = vscode.workspace.getConfiguration('C_Cpp'); |
Member
There was a problem hiding this comment.
If the user does not have cpptools installed, do we always get a valid config instead of undefined?
|
可以参考下cmake插件的实现vscode-cmake-tools/src/cpptools.ts |
|
This PR would help me a lot, makes working with Xmake very convenient. |
SirLynix
reviewed
Aug 26, 2025
| These configuration settings are stored in your project's c_cpp_properties.json file. To edit this file, in VS Code, select C/C++: Edit Configurations (UI) from the Command Palette (⇧⌘P): | ||
|
|
||
| Please see [IntelliSense for cross-compiling](https://code.visualstudio.com/docs/cpp/configure-intellisense-crosscompilation) | ||
|
|
Member
There was a problem hiding this comment.
I think we should keep this section in case something goes wrong
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm not sure if this is a feature or a bug fix, but this removes the need for setting the path to the compile commands file in
.vscode/c_cpp_properties.jsonby settingC_Cpp.default.compileCommands.With this, IntelliSense should work as soon as XMake is run for the first time.