Skip to content

Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.

feat(core): add colocated *_test.rs and test_*.rs to Rust group

thejesh23079fe113a626
diff --git a/understand-anything-plugin/packages/core/src/__tests__/ignore-generator.test.ts b/understand-anything-plugin/packages/core/src/__tests__/ignore-generator.test.ts
index 6dbde58b..479d9d66 100644
--- a/understand-anything-plugin/packages/core/src/__tests__/ignore-generator.test.ts
+++ b/understand-anything-plugin/packages/core/src/__tests__/ignore-generator.test.ts
@@ -240,6 +240,15 @@ describe("generateStarterIgnoreFile", () => {
expect(content).toContain("# **/tests.rs");
});
+ it("includes Rust workspace-style *_test.rs and test_*.rs conventions", () => {
+ const content = generateStarterIgnoreFile(testDir);
+ // Dominant in large workspaces (polkadot-sdk, rust-lang/rust,
+ // solana-labs/solana) where tests colocate with source rather
+ // than living inside inline `#[cfg(test)] mod tests`.
+ expect(content).toContain("# **/test_*.rs");
+ expect(content).toContain("# **/*_test.rs");
+ });
+
it("groups patterns under the JS / TS sub-header", () => {
const content = generateStarterIgnoreFile(testDir);
expect(content).toContain("# JS / TS");
diff --git a/understand-anything-plugin/packages/core/src/ignore-generator.ts b/understand-anything-plugin/packages/core/src/ignore-generator.ts
index c39cc187..287ac7d1 100644
--- a/understand-anything-plugin/packages/core/src/ignore-generator.ts
+++ b/understand-anything-plugin/packages/core/src/ignore-generator.ts
@@ -123,6 +123,8 @@ const TEST_PATTERN_GROUPS: Array<{ label: string; patterns: string[] }> = [
label: "Rust",
patterns: [
"**/tests.rs",
+ "**/test_*.rs",
+ "**/*_test.rs",
],
},
];