Skip to content

Conversation

@Guo-Shiyu
Copy link
Contributor

@Guo-Shiyu Guo-Shiyu commented Aug 25, 2025

This PR optimizes the way to load and fetch compilation commands from CDB, and typo fix.

  1. During server initialization, if no valid CDB was found in given directories, try to search recursively in the workspace.
  2. Guess compile commands from other source file in same directory or parent directory for file not included in CDB.
  3. Always store absolute path in CompilationDatabase::LookupInfo::arguments, both cmake and xmake has been tested.

@Guo-Shiyu
Copy link
Contributor Author

@gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves how compilation commands are loaded and fetched. It introduces recursive searching for compile_commands.json in the workspace and adds a mechanism to guess commands for files not in the database. The changes also include some typo fixes and minor code improvements. My review focuses on improving robustness by handling potential exceptions, ensuring deterministic behavior in the command guessing logic, and minor code style enhancements. Overall, these are good improvements to the server's functionality.

@Guo-Shiyu
Copy link
Contributor Author

@copilot review

@Guo-Shiyu
Copy link
Contributor Author

@gemini review

@Guo-Shiyu
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces significant improvements to how compilation commands are loaded and fetched. It adds recursive searching for compile_commands.json, guessing commands for files not in the database, and ensures include paths are absolute. The changes are well-aligned with the description and improve the robustness of the language server.

My review includes a few points:

  • A critical fix for the recursive search logic for compile_commands.json.
  • A high-severity fix for the command-guessing logic to prevent incorrect matches.
  • A medium-severity suggestion to avoid redundant include paths in the generated commands.

Overall, this is a great enhancement. Addressing these points will make it even better.

@Guo-Shiyu Guo-Shiyu force-pushed the feat/better-load--commands branch from 0df51a5 to a029a8b Compare August 31, 2025 09:09
@Guo-Shiyu Guo-Shiyu requested a review from 16bit-ykiko August 31, 2025 09:10
@16bit-ykiko 16bit-ykiko changed the title Feat: better load and fetch compile command. Feat: better load and fetch compile command Sep 1, 2025
@16bit-ykiko 16bit-ykiko merged commit 155773c into clice-io:main Sep 2, 2025
9 checks passed
@Guo-Shiyu Guo-Shiyu deleted the feat/better-load--commands branch November 22, 2025 09:16
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.

2 participants