diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dfc0e9..4d12356 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixes +- Unions are now indexed in C, C++, Objective-C and Rust. A `union` declaration previously produced no symbol at all, so it never appeared in search or `codegraph_explore`, and anything attached to it disappeared with it — in Rust, every `impl SomeTrait for MyUnion` lost its edge, and the methods from that impl were left pointing at a type the graph did not contain. A `typedef union { … } Name;` in C now carries the typedef's name like `typedef struct` already did. Re-index after upgrading to pick up the new symbols. + - `codegraph_explore` now concentrates its answer on the code that actually answers your question instead of spreading it across files that merely share a word with it, so more of the answer arrives in a single call. Thanks @LeDuyViet for the detailed measurements and reproduction. (#1500) - Files only weakly related to your question now come back as a name, symbol and line number instead of spending the answer on their source — name one of them in a follow-up `codegraph_explore` to get it back in full. (#1500) - A generated CRUD or protobuf layer no longer crowds out the hand-written code sitting beside it: generated files are now recognized by the `// Code generated by … DO NOT EDIT.` style banner written at the top of the file, not just by a filename that looks generated. Re-index after upgrading to pick up the new detection. (#1500) diff --git a/docs/design/ccpp-kernel-port-checklist.md b/docs/design/ccpp-kernel-port-checklist.md index 08811f3..520b2fd 100644 --- a/docs/design/ccpp-kernel-port-checklist.md +++ b/docs/design/ccpp-kernel-port-checklist.md @@ -139,7 +139,10 @@ walker mirrors, with file:line anchors (as of `705e501`). Read WITH ## Extractor configs (languages/c-cpp.ts — read the whole file when porting) **cExtractor (line 180):** functionTypes=[function_definition]; NO -class/method/interface types; structTypes=[struct_specifier]; +class/method/interface types; structTypes=[struct_specifier] +(superseded: `union_specifier` joined structTypes — a named `union U { … };` +is a definition, extracted with kind `struct`, and `typedef union { … } N;` +resolves through resolveTypeAliasKind like `typedef struct`); enumTypes=[enum_specifier]; enumMemberTypes=[enumerator]; typeAliasTypes=[type_definition]; importTypes=[preproc_include]; callTypes=[call_expression]; variableTypes=[declaration]; diff --git a/docs/design/rust-lang-kernel-port-checklist.md b/docs/design/rust-lang-kernel-port-checklist.md index d931e7c..d6f01b3 100644 --- a/docs/design/rust-lang-kernel-port-checklist.md +++ b/docs/design/rust-lang-kernel-port-checklist.md @@ -54,7 +54,9 @@ Types: functionTypes=[`function_item`, **`function_signature_item`**] (the latter = a trait method DECLARATION `fn render(&self);` — extracted so a trait's method set is first-class); classTypes=[] (impl blocks instead); methodTypes = same two; interfaceTypes=[`trait_item`] with -**interfaceKind:'trait'**; structTypes=[`struct_item`]; enumTypes=[`enum_item`]; +**interfaceKind:'trait'**; structTypes=[`struct_item`] (superseded: +`union_item` joined structTypes — same `body` field, same extractor, kind +`struct`); enumTypes=[`enum_item`]; enumMemberTypes=[`enum_variant`]; typeAliasTypes=[`type_item`]; importTypes=[`use_declaration`]; callTypes=[`call_expression`]; variableTypes=[`let_declaration`, `const_item`, `static_item`].