Skip to content

Commit 79c9aae

Browse files
16bit-ykikoclaude
andcommitted
fix: review fixes — invalidate ast_deps on switchContext, clean up labels
- Add ast_deps.erase(path_id) in switchContext to prevent stale dependency snapshots - Remove -I from split-arg handling in CDB label generation (noisy long paths) - Untrack generated compile_commands.json (conftest generates it dynamically) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a7d9548 commit 79c9aae

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

src/server/master_server.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,8 +2791,7 @@ void MasterServer::register_handlers() {
27912791
desc += ' ';
27922792
desc += entry.arguments[j];
27932793
// Handle split args like "-D" "CONFIG_A"
2794-
if((a == "-D" || a == "-O" || a == "-I") &&
2795-
j + 1 < entry.arguments.size()) {
2794+
if((a == "-D" || a == "-O") && j + 1 < entry.arguments.size()) {
27962795
desc += entry.arguments[++j];
27972796
}
27982797
}
@@ -2866,9 +2865,10 @@ void MasterServer::register_handlers() {
28662865
active_contexts[path_id] = context_path_id;
28672866
header_file_contexts.erase(path_id);
28682867

2869-
// Also invalidate the PCH for the old context (if any) so it
2870-
// gets rebuilt with the new host's preamble.
2868+
// Also invalidate the PCH and AST deps for the old context so
2869+
// they get rebuilt with the new host's preamble.
28712870
pch_states.erase(path_id);
2871+
ast_deps.erase(path_id);
28722872

28732873
// Mark the document as dirty so it gets recompiled.
28742874
auto doc_it = documents.find(path_id);

tests/data/header_context/compile_commands.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)