gitnexus 1.4.8 → 1.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/README.md +7 -0
  2. package/dist/cli/index-repo.d.ts +15 -0
  3. package/dist/cli/index-repo.js +115 -0
  4. package/dist/cli/index.js +11 -2
  5. package/dist/cli/setup.js +12 -9
  6. package/dist/cli/wiki.d.ts +4 -0
  7. package/dist/cli/wiki.js +174 -53
  8. package/dist/config/supported-languages.d.ts +7 -5
  9. package/dist/config/supported-languages.js +6 -4
  10. package/dist/core/graph/graph.js +9 -1
  11. package/dist/core/graph/types.d.ts +10 -2
  12. package/dist/core/ingestion/call-processor.d.ts +18 -1
  13. package/dist/core/ingestion/call-processor.js +297 -38
  14. package/dist/core/ingestion/call-routing.d.ts +3 -18
  15. package/dist/core/ingestion/call-routing.js +0 -19
  16. package/dist/core/ingestion/cobol/cobol-copy-expander.d.ts +57 -0
  17. package/dist/core/ingestion/cobol/cobol-copy-expander.js +385 -0
  18. package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +210 -0
  19. package/dist/core/ingestion/cobol/cobol-preprocessor.js +1509 -0
  20. package/dist/core/ingestion/cobol/jcl-parser.d.ts +68 -0
  21. package/dist/core/ingestion/cobol/jcl-parser.js +217 -0
  22. package/dist/core/ingestion/cobol/jcl-processor.d.ts +33 -0
  23. package/dist/core/ingestion/cobol/jcl-processor.js +229 -0
  24. package/dist/core/ingestion/cobol-processor.d.ts +54 -0
  25. package/dist/core/ingestion/cobol-processor.js +1186 -0
  26. package/dist/core/ingestion/entry-point-scoring.d.ts +17 -0
  27. package/dist/core/ingestion/entry-point-scoring.js +18 -4
  28. package/dist/core/ingestion/export-detection.d.ts +47 -8
  29. package/dist/core/ingestion/export-detection.js +29 -50
  30. package/dist/core/ingestion/field-extractor.d.ts +29 -0
  31. package/dist/core/ingestion/field-extractor.js +25 -0
  32. package/dist/core/ingestion/field-extractors/configs/c-cpp.d.ts +3 -0
  33. package/dist/core/ingestion/field-extractors/configs/c-cpp.js +108 -0
  34. package/dist/core/ingestion/field-extractors/configs/csharp.d.ts +8 -0
  35. package/dist/core/ingestion/field-extractors/configs/csharp.js +73 -0
  36. package/dist/core/ingestion/field-extractors/configs/dart.d.ts +8 -0
  37. package/dist/core/ingestion/field-extractors/configs/dart.js +76 -0
  38. package/dist/core/ingestion/field-extractors/configs/go.d.ts +11 -0
  39. package/dist/core/ingestion/field-extractors/configs/go.js +64 -0
  40. package/dist/core/ingestion/field-extractors/configs/helpers.d.ts +44 -0
  41. package/dist/core/ingestion/field-extractors/configs/helpers.js +134 -0
  42. package/dist/core/ingestion/field-extractors/configs/jvm.d.ts +3 -0
  43. package/dist/core/ingestion/field-extractors/configs/jvm.js +118 -0
  44. package/dist/core/ingestion/field-extractors/configs/php.d.ts +8 -0
  45. package/dist/core/ingestion/field-extractors/configs/php.js +67 -0
  46. package/dist/core/ingestion/field-extractors/configs/python.d.ts +12 -0
  47. package/dist/core/ingestion/field-extractors/configs/python.js +91 -0
  48. package/dist/core/ingestion/field-extractors/configs/ruby.d.ts +16 -0
  49. package/dist/core/ingestion/field-extractors/configs/ruby.js +75 -0
  50. package/dist/core/ingestion/field-extractors/configs/rust.d.ts +9 -0
  51. package/dist/core/ingestion/field-extractors/configs/rust.js +55 -0
  52. package/dist/core/ingestion/field-extractors/configs/swift.d.ts +8 -0
  53. package/dist/core/ingestion/field-extractors/configs/swift.js +63 -0
  54. package/dist/core/ingestion/field-extractors/configs/typescript-javascript.d.ts +3 -0
  55. package/dist/core/ingestion/field-extractors/configs/typescript-javascript.js +60 -0
  56. package/dist/core/ingestion/field-extractors/generic.d.ts +46 -0
  57. package/dist/core/ingestion/field-extractors/generic.js +111 -0
  58. package/dist/core/ingestion/field-extractors/typescript.d.ts +77 -0
  59. package/dist/core/ingestion/field-extractors/typescript.js +291 -0
  60. package/dist/core/ingestion/field-types.d.ts +59 -0
  61. package/dist/core/ingestion/field-types.js +2 -0
  62. package/dist/core/ingestion/framework-detection.d.ts +87 -0
  63. package/dist/core/ingestion/framework-detection.js +65 -2
  64. package/dist/core/ingestion/heritage-processor.js +15 -17
  65. package/dist/core/ingestion/import-processor.d.ts +9 -10
  66. package/dist/core/ingestion/import-processor.js +59 -14
  67. package/dist/core/ingestion/{resolvers → import-resolvers}/csharp.d.ts +6 -9
  68. package/dist/core/ingestion/{resolvers → import-resolvers}/csharp.js +20 -2
  69. package/dist/core/ingestion/import-resolvers/dart.d.ts +7 -0
  70. package/dist/core/ingestion/import-resolvers/dart.js +44 -0
  71. package/dist/core/ingestion/{resolvers → import-resolvers}/go.d.ts +4 -5
  72. package/dist/core/ingestion/{resolvers → import-resolvers}/go.js +17 -0
  73. package/dist/core/ingestion/{resolvers → import-resolvers}/jvm.d.ts +9 -1
  74. package/dist/core/ingestion/{resolvers → import-resolvers}/jvm.js +56 -0
  75. package/dist/core/ingestion/{resolvers → import-resolvers}/php.d.ts +6 -10
  76. package/dist/core/ingestion/{resolvers → import-resolvers}/php.js +7 -2
  77. package/dist/core/ingestion/{resolvers → import-resolvers}/python.d.ts +9 -3
  78. package/dist/core/ingestion/{resolvers → import-resolvers}/python.js +35 -3
  79. package/dist/core/ingestion/{resolvers → import-resolvers}/ruby.d.ts +5 -2
  80. package/dist/core/ingestion/{resolvers → import-resolvers}/ruby.js +7 -2
  81. package/dist/core/ingestion/{resolvers → import-resolvers}/rust.d.ts +5 -2
  82. package/dist/core/ingestion/{resolvers → import-resolvers}/rust.js +41 -2
  83. package/dist/core/ingestion/{resolvers → import-resolvers}/standard.d.ts +15 -7
  84. package/dist/core/ingestion/{resolvers → import-resolvers}/standard.js +22 -3
  85. package/dist/core/ingestion/import-resolvers/swift.d.ts +7 -0
  86. package/dist/core/ingestion/import-resolvers/swift.js +23 -0
  87. package/dist/core/ingestion/import-resolvers/types.d.ts +44 -0
  88. package/dist/core/ingestion/import-resolvers/types.js +6 -0
  89. package/dist/core/ingestion/{resolvers → import-resolvers}/utils.d.ts +0 -3
  90. package/dist/core/ingestion/{resolvers → import-resolvers}/utils.js +0 -9
  91. package/dist/core/ingestion/language-config.d.ts +4 -1
  92. package/dist/core/ingestion/language-provider.d.ts +121 -0
  93. package/dist/core/ingestion/language-provider.js +24 -0
  94. package/dist/core/ingestion/languages/c-cpp.d.ts +12 -0
  95. package/dist/core/ingestion/languages/c-cpp.js +71 -0
  96. package/dist/core/ingestion/languages/cobol.d.ts +1 -0
  97. package/dist/core/ingestion/languages/cobol.js +26 -0
  98. package/dist/core/ingestion/languages/csharp.d.ts +8 -0
  99. package/dist/core/ingestion/languages/csharp.js +49 -0
  100. package/dist/core/ingestion/languages/dart.d.ts +12 -0
  101. package/dist/core/ingestion/languages/dart.js +58 -0
  102. package/dist/core/ingestion/languages/go.d.ts +11 -0
  103. package/dist/core/ingestion/languages/go.js +28 -0
  104. package/dist/core/ingestion/languages/index.d.ts +38 -0
  105. package/dist/core/ingestion/languages/index.js +63 -0
  106. package/dist/core/ingestion/languages/java.d.ts +9 -0
  107. package/dist/core/ingestion/languages/java.js +29 -0
  108. package/dist/core/ingestion/languages/kotlin.d.ts +9 -0
  109. package/dist/core/ingestion/languages/kotlin.js +53 -0
  110. package/dist/core/ingestion/languages/php.d.ts +8 -0
  111. package/dist/core/ingestion/languages/php.js +145 -0
  112. package/dist/core/ingestion/languages/python.d.ts +12 -0
  113. package/dist/core/ingestion/languages/python.js +39 -0
  114. package/dist/core/ingestion/languages/ruby.d.ts +9 -0
  115. package/dist/core/ingestion/languages/ruby.js +44 -0
  116. package/dist/core/ingestion/languages/rust.d.ts +12 -0
  117. package/dist/core/ingestion/languages/rust.js +44 -0
  118. package/dist/core/ingestion/languages/swift.d.ts +12 -0
  119. package/dist/core/ingestion/languages/swift.js +133 -0
  120. package/dist/core/ingestion/languages/typescript.d.ts +10 -0
  121. package/dist/core/ingestion/languages/typescript.js +60 -0
  122. package/dist/core/ingestion/mro-processor.js +14 -15
  123. package/dist/core/ingestion/{named-binding-extraction.d.ts → named-binding-processor.d.ts} +0 -9
  124. package/dist/core/ingestion/named-binding-processor.js +42 -0
  125. package/dist/core/ingestion/named-bindings/csharp.d.ts +3 -0
  126. package/dist/core/ingestion/named-bindings/csharp.js +37 -0
  127. package/dist/core/ingestion/named-bindings/java.d.ts +3 -0
  128. package/dist/core/ingestion/named-bindings/java.js +29 -0
  129. package/dist/core/ingestion/named-bindings/kotlin.d.ts +3 -0
  130. package/dist/core/ingestion/named-bindings/kotlin.js +36 -0
  131. package/dist/core/ingestion/named-bindings/php.d.ts +3 -0
  132. package/dist/core/ingestion/named-bindings/php.js +61 -0
  133. package/dist/core/ingestion/named-bindings/python.d.ts +3 -0
  134. package/dist/core/ingestion/named-bindings/python.js +49 -0
  135. package/dist/core/ingestion/named-bindings/rust.d.ts +3 -0
  136. package/dist/core/ingestion/named-bindings/rust.js +64 -0
  137. package/dist/core/ingestion/named-bindings/types.d.ts +16 -0
  138. package/dist/core/ingestion/named-bindings/types.js +6 -0
  139. package/dist/core/ingestion/named-bindings/typescript.d.ts +3 -0
  140. package/dist/core/ingestion/named-bindings/typescript.js +58 -0
  141. package/dist/core/ingestion/parsing-processor.d.ts +5 -1
  142. package/dist/core/ingestion/parsing-processor.js +115 -16
  143. package/dist/core/ingestion/pipeline.js +925 -424
  144. package/dist/core/ingestion/resolution-context.js +1 -1
  145. package/dist/core/ingestion/route-extractors/expo.d.ts +1 -0
  146. package/dist/core/ingestion/route-extractors/expo.js +36 -0
  147. package/dist/core/ingestion/route-extractors/middleware.d.ts +47 -0
  148. package/dist/core/ingestion/route-extractors/middleware.js +143 -0
  149. package/dist/core/ingestion/route-extractors/nextjs.d.ts +3 -0
  150. package/dist/core/ingestion/route-extractors/nextjs.js +76 -0
  151. package/dist/core/ingestion/route-extractors/php.d.ts +7 -0
  152. package/dist/core/ingestion/route-extractors/php.js +21 -0
  153. package/dist/core/ingestion/route-extractors/response-shapes.d.ts +20 -0
  154. package/dist/core/ingestion/route-extractors/response-shapes.js +290 -0
  155. package/dist/core/ingestion/tree-sitter-queries.d.ts +8 -7
  156. package/dist/core/ingestion/tree-sitter-queries.js +231 -9
  157. package/dist/core/ingestion/type-env.d.ts +14 -17
  158. package/dist/core/ingestion/type-env.js +66 -14
  159. package/dist/core/ingestion/type-extractors/c-cpp.d.ts +1 -1
  160. package/dist/core/ingestion/type-extractors/csharp.js +1 -1
  161. package/dist/core/ingestion/type-extractors/dart.d.ts +15 -0
  162. package/dist/core/ingestion/type-extractors/dart.js +371 -0
  163. package/dist/core/ingestion/type-extractors/jvm.js +1 -1
  164. package/dist/core/ingestion/type-extractors/shared.d.ts +1 -13
  165. package/dist/core/ingestion/type-extractors/shared.js +9 -102
  166. package/dist/core/ingestion/type-extractors/swift.js +334 -4
  167. package/dist/core/ingestion/type-extractors/types.d.ts +3 -1
  168. package/dist/core/ingestion/{ast-helpers.d.ts → utils/ast-helpers.d.ts} +16 -13
  169. package/dist/core/ingestion/{ast-helpers.js → utils/ast-helpers.js} +111 -32
  170. package/dist/core/ingestion/{call-analysis.js → utils/call-analysis.js} +37 -0
  171. package/dist/core/ingestion/utils/event-loop.d.ts +5 -0
  172. package/dist/core/ingestion/utils/event-loop.js +5 -0
  173. package/dist/core/ingestion/utils/language-detection.d.ts +9 -0
  174. package/dist/core/ingestion/utils/language-detection.js +70 -0
  175. package/dist/core/ingestion/utils/verbose.d.ts +1 -0
  176. package/dist/core/ingestion/utils/verbose.js +7 -0
  177. package/dist/core/ingestion/workers/parse-worker.d.ts +43 -2
  178. package/dist/core/ingestion/workers/parse-worker.js +361 -150
  179. package/dist/core/lbug/csv-generator.js +34 -1
  180. package/dist/core/lbug/lbug-adapter.js +6 -0
  181. package/dist/core/lbug/schema.d.ts +5 -3
  182. package/dist/core/lbug/schema.js +39 -2
  183. package/dist/core/tree-sitter/parser-loader.js +7 -1
  184. package/dist/core/wiki/cursor-client.d.ts +31 -0
  185. package/dist/core/wiki/cursor-client.js +127 -0
  186. package/dist/core/wiki/generator.d.ts +28 -9
  187. package/dist/core/wiki/generator.js +115 -18
  188. package/dist/core/wiki/graph-queries.d.ts +4 -0
  189. package/dist/core/wiki/graph-queries.js +7 -1
  190. package/dist/core/wiki/llm-client.d.ts +2 -0
  191. package/dist/core/wiki/llm-client.js +8 -4
  192. package/dist/core/wiki/prompts.d.ts +3 -3
  193. package/dist/core/wiki/prompts.js +6 -0
  194. package/dist/mcp/core/lbug-adapter.d.ts +5 -0
  195. package/dist/mcp/core/lbug-adapter.js +11 -1
  196. package/dist/mcp/local/local-backend.d.ts +16 -5
  197. package/dist/mcp/local/local-backend.js +711 -74
  198. package/dist/mcp/tools.js +71 -2
  199. package/dist/storage/repo-manager.d.ts +3 -0
  200. package/package.json +14 -14
  201. package/dist/core/ingestion/import-resolution.d.ts +0 -101
  202. package/dist/core/ingestion/import-resolution.js +0 -251
  203. package/dist/core/ingestion/named-binding-extraction.js +0 -373
  204. package/dist/core/ingestion/resolvers/index.d.ts +0 -18
  205. package/dist/core/ingestion/resolvers/index.js +0 -13
  206. package/dist/core/ingestion/type-extractors/index.d.ts +0 -22
  207. package/dist/core/ingestion/type-extractors/index.js +0 -31
  208. package/dist/core/ingestion/utils.d.ts +0 -20
  209. package/dist/core/ingestion/utils.js +0 -242
  210. package/scripts/patch-tree-sitter-swift.cjs +0 -74
  211. /package/dist/core/ingestion/{call-analysis.d.ts → utils/call-analysis.d.ts} +0 -0
@@ -2,11 +2,13 @@
2
2
  * Rust module import resolution.
3
3
  * Handles crate::, super::, self:: prefix paths and :: separators.
4
4
  */
5
+ import { SupportedLanguages } from '../../../config/supported-languages.js';
6
+ import { resolveStandard } from './standard.js';
5
7
  /**
6
- * Resolve Rust use-path to a file.
8
+ * Resolve Rust use-path to a file (low-level helper).
7
9
  * Handles crate::, super::, self:: prefixes and :: path separators.
8
10
  */
9
- export function resolveRustImport(currentFile, importPath, allFiles) {
11
+ export function resolveRustImportInternal(currentFile, importPath, allFiles) {
10
12
  let rustPath;
11
13
  if (importPath.startsWith('crate::')) {
12
14
  // crate:: resolves from src/ directory (standard Rust layout)
@@ -71,3 +73,40 @@ export function tryRustModulePath(modulePath, allFiles) {
71
73
  }
72
74
  return null;
73
75
  }
76
+ /** Rust: expand grouped imports: use {crate::a, crate::b} and use crate::models::{User, Repo}. */
77
+ export function resolveRustImport(rawImportPath, filePath, ctx) {
78
+ // Top-level grouped: use {crate::a, crate::b}
79
+ if (rawImportPath.startsWith('{') && rawImportPath.endsWith('}')) {
80
+ const inner = rawImportPath.slice(1, -1);
81
+ const parts = inner.split(',').map(p => p.trim()).filter(Boolean);
82
+ const resolved = [];
83
+ for (const part of parts) {
84
+ const r = resolveRustImportInternal(filePath, part, ctx.allFilePaths);
85
+ if (r)
86
+ resolved.push(r);
87
+ }
88
+ return resolved.length > 0 ? { kind: 'files', files: resolved } : null;
89
+ }
90
+ // Scoped grouped: use crate::models::{User, Repo}
91
+ const braceIdx = rawImportPath.indexOf('::{');
92
+ if (braceIdx !== -1 && rawImportPath.endsWith('}')) {
93
+ const pathPrefix = rawImportPath.substring(0, braceIdx);
94
+ const braceContent = rawImportPath.substring(braceIdx + 3, rawImportPath.length - 1);
95
+ const items = braceContent.split(',').map(s => s.trim()).filter(Boolean);
96
+ const resolved = [];
97
+ for (const item of items) {
98
+ // Handle `use crate::models::{User, Repo as R}` — strip alias for resolution
99
+ const itemName = item.includes(' as ') ? item.split(' as ')[0].trim() : item;
100
+ const r = resolveRustImportInternal(filePath, `${pathPrefix}::${itemName}`, ctx.allFilePaths);
101
+ if (r)
102
+ resolved.push(r);
103
+ }
104
+ if (resolved.length > 0)
105
+ return { kind: 'files', files: resolved };
106
+ // Fallback: resolve the prefix path itself (e.g. crate::models -> models.rs)
107
+ const prefixResult = resolveRustImportInternal(filePath, pathPrefix, ctx.allFilePaths);
108
+ if (prefixResult)
109
+ return { kind: 'files', files: [prefixResult] };
110
+ }
111
+ return resolveStandard(rawImportPath, filePath, ctx, SupportedLanguages.Rust);
112
+ }
@@ -5,13 +5,8 @@
5
5
  */
6
6
  import type { SuffixIndex } from './utils.js';
7
7
  import { SupportedLanguages } from '../../../config/supported-languages.js';
8
- /** TypeScript path alias config parsed from tsconfig.json */
9
- export interface TsconfigPaths {
10
- /** Map of alias prefix -> target prefix (e.g., "@/" -> "src/") */
11
- aliases: Map<string, string>;
12
- /** Base URL for path resolution (relative to repo root) */
13
- baseUrl: string;
14
- }
8
+ import type { ImportResult, ImportResolverFn, ResolveCtx } from './types.js';
9
+ import type { TsconfigPaths } from '../language-config.js';
15
10
  /** Max entries in the resolve cache. Beyond this, entries are evicted.
16
11
  * 100K entries ≈ 15MB — covers the most common import patterns. */
17
12
  export declare const RESOLVE_CACHE_CAP = 100000;
@@ -26,3 +21,16 @@ export declare const RESOLVE_CACHE_CAP = 100000;
26
21
  * because they resolve to multiple files.
27
22
  */
28
23
  export declare const resolveImportPath: (currentFile: string, importPath: string, allFiles: Set<string>, allFileList: string[], normalizedFileList: string[], resolveCache: Map<string, string | null>, language: SupportedLanguages, tsconfigPaths: TsconfigPaths | null, index?: SuffixIndex) => string | null;
24
+ /**
25
+ * Standard single-file resolution (TS/JS/C/C++ and fallback for other languages).
26
+ * Handles relative imports, tsconfig path aliases, and suffix matching.
27
+ */
28
+ export declare function resolveStandard(rawImportPath: string, filePath: string, ctx: ResolveCtx, language: SupportedLanguages): ImportResult;
29
+ /** JavaScript: standard single-file resolution. */
30
+ export declare const resolveJavascriptImport: ImportResolverFn;
31
+ /** TypeScript: standard single-file resolution. */
32
+ export declare const resolveTypescriptImport: ImportResolverFn;
33
+ /** C: standard single-file resolution for #include directives. */
34
+ export declare const resolveCImport: ImportResolverFn;
35
+ /** C++: standard single-file resolution for #include directives. */
36
+ export declare const resolveCppImport: ImportResolverFn;
@@ -4,7 +4,7 @@
4
4
  * Used as the fallback when language-specific resolvers don't match.
5
5
  */
6
6
  import { tryResolveWithExtensions, suffixResolve } from './utils.js';
7
- import { resolveRustImport } from './rust.js';
7
+ import { resolveRustImportInternal } from './rust.js';
8
8
  import { SupportedLanguages } from '../../../config/supported-languages.js';
9
9
  /** Max entries in the resolve cache. Beyond this, entries are evicted.
10
10
  * 100K entries ≈ 15MB — covers the most common import patterns. */
@@ -78,13 +78,13 @@ export const resolveImportPath = (currentFile, importPath, allFiles, allFileList
78
78
  const inner = importPath.slice(1, -1);
79
79
  const parts = inner.split(',').map(p => p.trim()).filter(Boolean);
80
80
  for (const part of parts) {
81
- const partResult = resolveRustImport(currentFile, part, allFiles);
81
+ const partResult = resolveRustImportInternal(currentFile, part, allFiles);
82
82
  if (partResult)
83
83
  return cache(partResult);
84
84
  }
85
85
  return cache(null);
86
86
  }
87
- const rustResult = resolveRustImport(currentFile, rustImportPath, allFiles);
87
+ const rustResult = resolveRustImportInternal(currentFile, rustImportPath, allFiles);
88
88
  if (rustResult)
89
89
  return cache(rustResult);
90
90
  // Fall through to generic resolution if Rust-specific didn't match
@@ -121,3 +121,22 @@ export const resolveImportPath = (currentFile, importPath, allFiles, allFileList
121
121
  const resolved = suffixResolve(pathParts, normalizedFileList, allFileList, index);
122
122
  return cache(resolved);
123
123
  };
124
+ // ============================================================================
125
+ // Per-language dispatch functions (moved from import-resolution.ts)
126
+ // ============================================================================
127
+ /**
128
+ * Standard single-file resolution (TS/JS/C/C++ and fallback for other languages).
129
+ * Handles relative imports, tsconfig path aliases, and suffix matching.
130
+ */
131
+ export function resolveStandard(rawImportPath, filePath, ctx, language) {
132
+ const resolvedPath = resolveImportPath(filePath, rawImportPath, ctx.allFilePaths, ctx.allFileList, ctx.normalizedFileList, ctx.resolveCache, language, ctx.configs.tsconfigPaths, ctx.index);
133
+ return resolvedPath ? { kind: 'files', files: [resolvedPath] } : null;
134
+ }
135
+ /** JavaScript: standard single-file resolution. */
136
+ export const resolveJavascriptImport = (raw, fp, ctx) => resolveStandard(raw, fp, ctx, SupportedLanguages.JavaScript);
137
+ /** TypeScript: standard single-file resolution. */
138
+ export const resolveTypescriptImport = (raw, fp, ctx) => resolveStandard(raw, fp, ctx, SupportedLanguages.TypeScript);
139
+ /** C: standard single-file resolution for #include directives. */
140
+ export const resolveCImport = (raw, fp, ctx) => resolveStandard(raw, fp, ctx, SupportedLanguages.C);
141
+ /** C++: standard single-file resolution for #include directives. */
142
+ export const resolveCppImport = (raw, fp, ctx) => resolveStandard(raw, fp, ctx, SupportedLanguages.CPlusPlus);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Swift module import resolution.
3
+ * Handles module imports via Package.swift target map.
4
+ */
5
+ import type { ImportResult, ResolveCtx } from './types.js';
6
+ /** Swift: module imports via Package.swift target map. */
7
+ export declare function resolveSwiftImport(rawImportPath: string, _filePath: string, ctx: ResolveCtx): ImportResult;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Swift module import resolution.
3
+ * Handles module imports via Package.swift target map.
4
+ */
5
+ /** Swift: module imports via Package.swift target map. */
6
+ export function resolveSwiftImport(rawImportPath, _filePath, ctx) {
7
+ const swiftPackageConfig = ctx.configs.swiftPackageConfig;
8
+ if (swiftPackageConfig) {
9
+ const targetDir = swiftPackageConfig.targets.get(rawImportPath);
10
+ if (targetDir) {
11
+ const dirPrefix = targetDir + '/';
12
+ const files = [];
13
+ for (let i = 0; i < ctx.normalizedFileList.length; i++) {
14
+ if (ctx.normalizedFileList[i].startsWith(dirPrefix) && ctx.normalizedFileList[i].endsWith('.swift')) {
15
+ files.push(ctx.allFileList[i]);
16
+ }
17
+ }
18
+ if (files.length > 0)
19
+ return { kind: 'files', files };
20
+ }
21
+ }
22
+ return null; // External framework (Foundation, UIKit, etc.)
23
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Import resolution types — shared across all per-language resolvers.
3
+ *
4
+ * Extracted from import-resolution.ts to co-locate types with their consumers.
5
+ */
6
+ import type { TsconfigPaths, GoModuleConfig, CSharpProjectConfig, ComposerConfig } from '../language-config.js';
7
+ import type { SwiftPackageConfig } from '../language-config.js';
8
+ import type { SuffixIndex } from './utils.js';
9
+ /**
10
+ * Result of resolving an import via language-specific dispatch.
11
+ * - 'files': resolved to one or more files -> add to ImportMap
12
+ * - 'package': resolved to a directory -> add graph edges + store dirSuffix in PackageMap
13
+ * - null: no resolution (external dependency, etc.)
14
+ */
15
+ export type ImportResult = {
16
+ kind: 'files';
17
+ files: string[];
18
+ } | {
19
+ kind: 'package';
20
+ files: string[];
21
+ dirSuffix: string;
22
+ } | null;
23
+ /** Bundled language-specific configs loaded once per ingestion run. */
24
+ export interface ImportConfigs {
25
+ tsconfigPaths: TsconfigPaths | null;
26
+ goModule: GoModuleConfig | null;
27
+ composerConfig: ComposerConfig | null;
28
+ swiftPackageConfig: SwiftPackageConfig | null;
29
+ csharpConfigs: CSharpProjectConfig[];
30
+ }
31
+ /** Pre-built lookup structures for import resolution. Build once, reuse across chunks. */
32
+ export interface ImportResolutionContext {
33
+ allFilePaths: Set<string>;
34
+ allFileList: string[];
35
+ normalizedFileList: string[];
36
+ index: SuffixIndex;
37
+ resolveCache: Map<string, string | null>;
38
+ }
39
+ /** Full context for import resolution: file lookups + language configs. */
40
+ export interface ResolveCtx extends ImportResolutionContext {
41
+ configs: ImportConfigs;
42
+ }
43
+ /** Per-language import resolver -- function alias matching ExportChecker/CallRouter pattern. */
44
+ export type ImportResolverFn = (rawImportPath: string, filePath: string, resolveCtx: ResolveCtx) => ImportResult;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Import resolution types — shared across all per-language resolvers.
3
+ *
4
+ * Extracted from import-resolution.ts to co-locate types with their consumers.
5
+ */
6
+ export {};
@@ -2,7 +2,6 @@
2
2
  * Shared utilities for import resolution.
3
3
  * Extracted from import-processor.ts to reduce file size.
4
4
  */
5
- import type { SyntaxNode } from '../utils.js';
6
5
  /** All file extensions to try during resolution */
7
6
  export declare const EXTENSIONS: string[];
8
7
  /**
@@ -34,5 +33,3 @@ export declare function buildSuffixIndex(normalizedFileList: string[], allFileLi
34
33
  * Suffix-based resolution using index. O(1) per lookup instead of O(files).
35
34
  */
36
35
  export declare function suffixResolve(pathParts: string[], normalizedFileList: string[], allFileList: string[], index?: SuffixIndex): string | null;
37
- /** Find the first direct named child of a tree-sitter node matching the given type. */
38
- export declare function findChild(node: SyntaxNode, type: string): SyntaxNode | null;
@@ -127,12 +127,3 @@ export function suffixResolve(pathParts, normalizedFileList, allFileList, index)
127
127
  }
128
128
  return null;
129
129
  }
130
- /** Find the first direct named child of a tree-sitter node matching the given type. */
131
- export function findChild(node, type) {
132
- for (let i = 0; i < node.namedChildCount; i++) {
133
- const child = node.namedChild(i);
134
- if (child?.type === type)
135
- return child;
136
- }
137
- return null;
138
- }
@@ -1,4 +1,4 @@
1
- import type { ImportConfigs } from './import-resolution.js';
1
+ import type { ImportConfigs } from './import-resolvers/types.js';
2
2
  /** TypeScript path alias config parsed from tsconfig.json */
3
3
  export interface TsconfigPaths {
4
4
  /** Map of alias prefix -> target prefix (e.g., "@/" -> "src/") */
@@ -15,6 +15,9 @@ export interface GoModuleConfig {
15
15
  export interface ComposerConfig {
16
16
  /** Map of namespace prefix -> directory (e.g., "App\\" -> "app/") */
17
17
  psr4: Map<string, string>;
18
+ /** PSR-4 entries sorted by namespace length descending (longest match wins).
19
+ * Cached once at config load time to avoid re-sorting on every import. */
20
+ psr4Sorted?: readonly [string, string][];
18
21
  }
19
22
  /** C# project config parsed from .csproj files */
20
23
  export interface CSharpProjectConfig {
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Language Provider interface — the complete capability contract for a supported language.
3
+ *
4
+ * Each language implements this interface in a single file under `languages/`.
5
+ * The pipeline accesses all per-language behavior through this interface.
6
+ *
7
+ * Design pattern: Strategy pattern with compile-time exhaustiveness.
8
+ * The providers table in `languages/index.ts` uses `satisfies Record<SupportedLanguages, LanguageProvider>`
9
+ * so adding a language to the enum without creating a provider is a compiler error.
10
+ */
11
+ import type { SupportedLanguages } from '../../config/supported-languages.js';
12
+ import type { LanguageTypeConfig } from './type-extractors/types.js';
13
+ import type { CallRouter } from './call-routing.js';
14
+ import type { ExportChecker } from './export-detection.js';
15
+ import type { FieldExtractor } from './field-extractor.js';
16
+ import type { ImportResolverFn } from './import-resolvers/types.js';
17
+ import type { NamedBindingExtractorFn } from './named-bindings/types.js';
18
+ import type { SyntaxNode } from './utils/ast-helpers.js';
19
+ import type { NodeLabel } from '../graph/types.js';
20
+ /** Tree-sitter query captures: capture name → AST node (or undefined if not captured). */
21
+ export type CaptureMap = Record<string, SyntaxNode | undefined>;
22
+ /** MRO strategy for multiple inheritance resolution. */
23
+ export type MroStrategy = 'first-wins' | 'c3' | 'leftmost-base' | 'implements-split' | 'qualified-syntax';
24
+ /** How a language handles imports — determines wildcard synthesis behavior. */
25
+ export type ImportSemantics = 'named' | 'wildcard' | 'namespace';
26
+ /**
27
+ * Everything a language needs to provide.
28
+ * Required fields must be explicitly set; optional fields have defaults
29
+ * applied by defineLanguage().
30
+ */
31
+ interface LanguageProviderConfig {
32
+ readonly id: SupportedLanguages;
33
+ /** File extensions that map to this language (e.g., ['.ts', '.tsx']) */
34
+ readonly extensions: readonly string[];
35
+ /** Parse strategy: 'tree-sitter' (default) uses AST parsing via tree-sitter.
36
+ * 'standalone' means the language has its own regex-based processor and
37
+ * should be skipped by the tree-sitter pipeline (e.g., COBOL, Markdown). */
38
+ readonly parseStrategy?: 'tree-sitter' | 'standalone';
39
+ /** Tree-sitter query strings for definitions, imports, calls, heritage.
40
+ * Required for tree-sitter languages; empty string for standalone processors. */
41
+ readonly treeSitterQueries: string;
42
+ /** Type extraction: declarations, initializers, for-loop bindings */
43
+ readonly typeConfig: LanguageTypeConfig;
44
+ /** Export detection: is this AST node a public/exported symbol? */
45
+ readonly exportChecker: ExportChecker;
46
+ /** Import resolution: resolves raw import path to file system path */
47
+ readonly importResolver: ImportResolverFn;
48
+ /** Call routing for languages that express imports/heritage as calls (e.g., Ruby).
49
+ * Default: no routing (all calls are normal call expressions). */
50
+ readonly callRouter?: CallRouter;
51
+ /** Named binding extraction from import statements.
52
+ * Default: undefined (language uses wildcard/whole-module imports). */
53
+ readonly namedBindingExtractor?: NamedBindingExtractorFn;
54
+ /** How this language handles imports.
55
+ * - 'named': per-symbol imports (JS/TS, Java, C#, Rust, PHP, Kotlin)
56
+ * - 'wildcard': whole-module imports, needs synthesis (Go, Ruby, C/C++, Swift)
57
+ * - 'namespace': namespace imports, needs moduleAliasMap (Python)
58
+ * Default: 'named'. */
59
+ readonly importSemantics?: ImportSemantics;
60
+ /** Language-specific transformation of raw import path text before resolution.
61
+ * Called after sanitization. E.g., Kotlin appends wildcard suffixes.
62
+ * Default: undefined (no preprocessing). */
63
+ readonly importPathPreprocessor?: (cleaned: string, importNode: SyntaxNode) => string;
64
+ /** Wire implicit inter-file imports for languages where all files in a module
65
+ * see each other (e.g., Swift targets, C header inclusion units).
66
+ * Called with only THIS language's files (pre-grouped by the processor).
67
+ * Default: undefined (no implicit imports). */
68
+ readonly implicitImportWirer?: (languageFiles: string[], importMap: ReadonlyMap<string, ReadonlySet<string>>, addImportEdge: (src: string, target: string) => void, projectConfig: unknown) => void;
69
+ /** Resolve the enclosing function name + label from an AST ancestor node
70
+ * that is NOT a standard FUNCTION_NODE_TYPE. For languages where the
71
+ * function body is a sibling of the signature (e.g. Dart: function_body ↔
72
+ * function_signature are siblings under program/class_body), the default
73
+ * parent walk cannot find the enclosing function. This hook lets the
74
+ * language provider inspect each ancestor and return the resolved result.
75
+ * Return null to continue the default walk.
76
+ * Default: undefined (standard parent walk only). */
77
+ readonly enclosingFunctionFinder?: (ancestorNode: SyntaxNode) => {
78
+ funcName: string;
79
+ label: NodeLabel;
80
+ } | null;
81
+ /** Override the default node label for definition.function captures.
82
+ * Return null to skip (C/C++ duplicate), a different label to reclassify
83
+ * (e.g., 'Method' for Kotlin), or defaultLabel to keep as-is.
84
+ * Default: undefined (standard label assignment). */
85
+ readonly labelOverride?: (functionNode: SyntaxNode, defaultLabel: NodeLabel) => NodeLabel | null;
86
+ /** Default edge type when parent symbol is ambiguous (interface vs class).
87
+ * Default: 'EXTENDS'. */
88
+ readonly heritageDefaultEdge?: 'EXTENDS' | 'IMPLEMENTS';
89
+ /** Regex to detect interface names by convention (e.g., /^I[A-Z]/ for C#/Java).
90
+ * When matched, IMPLEMENTS edge is used instead of heritageDefaultEdge. */
91
+ readonly interfaceNamePattern?: RegExp;
92
+ /** MRO strategy for multiple inheritance resolution.
93
+ * Default: 'first-wins'. */
94
+ readonly mroStrategy?: MroStrategy;
95
+ /** Field extractor for extracting field/property definitions from class/struct
96
+ * declarations. Produces FieldInfo[] with name, type, visibility, static,
97
+ * readonly metadata. Default: undefined (no field extraction). */
98
+ readonly fieldExtractor?: FieldExtractor;
99
+ /** Extract a semantic description for a definition node (e.g., PHP Eloquent
100
+ * property arrays, relation method descriptions).
101
+ * Default: undefined (no description extraction). */
102
+ readonly descriptionExtractor?: (nodeLabel: NodeLabel, nodeName: string, captureMap: CaptureMap) => string | undefined;
103
+ /** Detect if a file contains framework route definitions (e.g., Laravel routes.php).
104
+ * When true, the worker extracts routes via the language's route extraction logic.
105
+ * Default: undefined (no route files). */
106
+ readonly isRouteFile?: (filePath: string) => boolean;
107
+ /** Built-in/stdlib names that should be filtered from the call graph for this language.
108
+ * Default: undefined (no language-specific filtering). */
109
+ readonly builtInNames?: ReadonlySet<string>;
110
+ }
111
+ /** Runtime type — same as LanguageProviderConfig but with defaults guaranteed present. */
112
+ export interface LanguageProvider extends Omit<LanguageProviderConfig, 'importSemantics' | 'heritageDefaultEdge' | 'mroStrategy'> {
113
+ readonly importSemantics: ImportSemantics;
114
+ readonly heritageDefaultEdge: 'EXTENDS' | 'IMPLEMENTS';
115
+ readonly mroStrategy: MroStrategy;
116
+ /** Check if a name is a built-in/stdlib function that should be filtered from the call graph. */
117
+ readonly isBuiltInName: (name: string) => boolean;
118
+ }
119
+ /** Define a language provider — required fields must be supplied, optional fields get sensible defaults. */
120
+ export declare function defineLanguage(config: LanguageProviderConfig): LanguageProvider;
121
+ export {};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Language Provider interface — the complete capability contract for a supported language.
3
+ *
4
+ * Each language implements this interface in a single file under `languages/`.
5
+ * The pipeline accesses all per-language behavior through this interface.
6
+ *
7
+ * Design pattern: Strategy pattern with compile-time exhaustiveness.
8
+ * The providers table in `languages/index.ts` uses `satisfies Record<SupportedLanguages, LanguageProvider>`
9
+ * so adding a language to the enum without creating a provider is a compiler error.
10
+ */
11
+ const DEFAULTS = {
12
+ importSemantics: 'named',
13
+ heritageDefaultEdge: 'EXTENDS',
14
+ mroStrategy: 'first-wins',
15
+ };
16
+ /** Define a language provider — required fields must be supplied, optional fields get sensible defaults. */
17
+ export function defineLanguage(config) {
18
+ const builtIns = config.builtInNames;
19
+ return {
20
+ ...DEFAULTS,
21
+ ...config,
22
+ isBuiltInName: builtIns ? (name) => builtIns.has(name) : () => false,
23
+ };
24
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * C and C++ language providers.
3
+ *
4
+ * Both languages use wildcard import semantics (headers expose all symbols
5
+ * via #include). Neither language has named binding extraction.
6
+ *
7
+ * C uses 'first-wins' MRO (no inheritance). C++ uses 'leftmost-base' MRO
8
+ * for its left-to-right multiple inheritance resolution order.
9
+ */
10
+ import type { LanguageProvider } from '../language-provider.js';
11
+ export declare const cProvider: LanguageProvider;
12
+ export declare const cppProvider: LanguageProvider;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * C and C++ language providers.
3
+ *
4
+ * Both languages use wildcard import semantics (headers expose all symbols
5
+ * via #include). Neither language has named binding extraction.
6
+ *
7
+ * C uses 'first-wins' MRO (no inheritance). C++ uses 'leftmost-base' MRO
8
+ * for its left-to-right multiple inheritance resolution order.
9
+ */
10
+ import { SupportedLanguages } from '../../../config/supported-languages.js';
11
+ import { defineLanguage } from '../language-provider.js';
12
+ import { typeConfig as cCppConfig } from '../type-extractors/c-cpp.js';
13
+ import { cCppExportChecker } from '../export-detection.js';
14
+ import { resolveCImport, resolveCppImport } from '../import-resolvers/standard.js';
15
+ import { C_QUERIES, CPP_QUERIES } from '../tree-sitter-queries.js';
16
+ import { isCppInsideClassOrStruct } from '../utils/ast-helpers.js';
17
+ import { createFieldExtractor } from '../field-extractors/generic.js';
18
+ import { cConfig as cFieldConfig, cppConfig as cppFieldConfig } from '../field-extractors/configs/c-cpp.js';
19
+ const C_BUILT_INS = new Set([
20
+ 'printf', 'fprintf', 'sprintf', 'snprintf', 'vprintf', 'vfprintf', 'vsprintf', 'vsnprintf',
21
+ 'scanf', 'fscanf', 'sscanf',
22
+ 'malloc', 'calloc', 'realloc', 'free', 'memcpy', 'memmove', 'memset', 'memcmp',
23
+ 'strlen', 'strcpy', 'strncpy', 'strcat', 'strncat', 'strcmp', 'strncmp', 'strstr', 'strchr', 'strrchr',
24
+ 'atoi', 'atol', 'atof', 'strtol', 'strtoul', 'strtoll', 'strtoull', 'strtod',
25
+ 'sizeof', 'offsetof', 'typeof',
26
+ 'assert', 'abort', 'exit', '_exit',
27
+ 'fopen', 'fclose', 'fread', 'fwrite', 'fseek', 'ftell', 'rewind', 'fflush', 'fgets', 'fputs',
28
+ 'likely', 'unlikely', 'BUG', 'BUG_ON', 'WARN', 'WARN_ON', 'WARN_ONCE',
29
+ 'IS_ERR', 'PTR_ERR', 'ERR_PTR', 'IS_ERR_OR_NULL',
30
+ 'ARRAY_SIZE', 'container_of', 'list_for_each_entry', 'list_for_each_entry_safe',
31
+ 'min', 'max', 'clamp', 'abs', 'swap',
32
+ 'pr_info', 'pr_warn', 'pr_err', 'pr_debug', 'pr_notice', 'pr_crit', 'pr_emerg',
33
+ 'printk', 'dev_info', 'dev_warn', 'dev_err', 'dev_dbg',
34
+ 'GFP_KERNEL', 'GFP_ATOMIC',
35
+ 'spin_lock', 'spin_unlock', 'spin_lock_irqsave', 'spin_unlock_irqrestore',
36
+ 'mutex_lock', 'mutex_unlock', 'mutex_init',
37
+ 'kfree', 'kmalloc', 'kzalloc', 'kcalloc', 'krealloc', 'kvmalloc', 'kvfree',
38
+ 'get', 'put',
39
+ ]);
40
+ /** Label override shared by C and C++: skip function_definition captures inside class/struct
41
+ * bodies (they're duplicates of definition.method captures). */
42
+ const cppLabelOverride = (functionNode, defaultLabel) => {
43
+ if (defaultLabel !== 'Function')
44
+ return defaultLabel;
45
+ return isCppInsideClassOrStruct(functionNode) ? null : defaultLabel;
46
+ };
47
+ export const cProvider = defineLanguage({
48
+ id: SupportedLanguages.C,
49
+ extensions: ['.c'],
50
+ treeSitterQueries: C_QUERIES,
51
+ typeConfig: cCppConfig,
52
+ exportChecker: cCppExportChecker,
53
+ importResolver: resolveCImport,
54
+ importSemantics: 'wildcard',
55
+ fieldExtractor: createFieldExtractor(cFieldConfig),
56
+ labelOverride: cppLabelOverride,
57
+ builtInNames: C_BUILT_INS,
58
+ });
59
+ export const cppProvider = defineLanguage({
60
+ id: SupportedLanguages.CPlusPlus,
61
+ extensions: ['.cpp', '.cc', '.cxx', '.h', '.hpp', '.hxx', '.hh'],
62
+ treeSitterQueries: CPP_QUERIES,
63
+ typeConfig: cCppConfig,
64
+ exportChecker: cCppExportChecker,
65
+ importResolver: resolveCppImport,
66
+ importSemantics: 'wildcard',
67
+ mroStrategy: 'leftmost-base',
68
+ fieldExtractor: createFieldExtractor(cppFieldConfig),
69
+ labelOverride: cppLabelOverride,
70
+ builtInNames: C_BUILT_INS,
71
+ });
@@ -0,0 +1 @@
1
+ export declare const cobolProvider: import("../language-provider.js").LanguageProvider;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * COBOL Language Provider
3
+ *
4
+ * Standalone regex-based processor — no tree-sitter grammar.
5
+ * COBOL files (.cbl, .cob, .cobol, .cpy, .copybook) are detected and
6
+ * processed by cobol-processor.ts in pipeline Phase 2.6, not by the
7
+ * tree-sitter pipeline.
8
+ *
9
+ * This provider exists to satisfy the SupportedLanguages exhaustiveness
10
+ * checks and to declare parseStrategy: 'standalone'.
11
+ */
12
+ import { SupportedLanguages } from '../../../config/supported-languages.js';
13
+ import { defineLanguage } from '../language-provider.js';
14
+ export const cobolProvider = defineLanguage({
15
+ id: SupportedLanguages.Cobol,
16
+ parseStrategy: 'standalone',
17
+ extensions: [], // COBOL files detected by cobol-processor's isCobolFile/isJclFile
18
+ treeSitterQueries: '',
19
+ typeConfig: {
20
+ declarationNodeTypes: new Set(),
21
+ extractDeclaration: () => null,
22
+ extractParameter: () => null,
23
+ },
24
+ exportChecker: () => false,
25
+ importResolver: () => null,
26
+ });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * C# language provider.
3
+ *
4
+ * C# uses named imports (using directives), modifier-based export detection,
5
+ * and an implements-split MRO strategy for multiple interface implementation.
6
+ * Interface names follow the I-prefix convention (e.g., IDisposable).
7
+ */
8
+ export declare const csharpProvider: import("../language-provider.js").LanguageProvider;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * C# language provider.
3
+ *
4
+ * C# uses named imports (using directives), modifier-based export detection,
5
+ * and an implements-split MRO strategy for multiple interface implementation.
6
+ * Interface names follow the I-prefix convention (e.g., IDisposable).
7
+ */
8
+ import { SupportedLanguages } from '../../../config/supported-languages.js';
9
+ import { defineLanguage } from '../language-provider.js';
10
+ import { typeConfig as csharpConfig } from '../type-extractors/csharp.js';
11
+ import { csharpExportChecker } from '../export-detection.js';
12
+ import { resolveCSharpImport } from '../import-resolvers/csharp.js';
13
+ import { extractCSharpNamedBindings } from '../named-bindings/csharp.js';
14
+ import { CSHARP_QUERIES } from '../tree-sitter-queries.js';
15
+ import { createFieldExtractor } from '../field-extractors/generic.js';
16
+ import { csharpConfig as csharpFieldConfig } from '../field-extractors/configs/csharp.js';
17
+ const BUILT_INS = new Set([
18
+ 'Console', 'WriteLine', 'ReadLine', 'Write',
19
+ 'Task', 'Run', 'Wait', 'WhenAll', 'WhenAny', 'FromResult', 'Delay', 'ContinueWith',
20
+ 'ConfigureAwait', 'GetAwaiter', 'GetResult',
21
+ 'ToString', 'GetType', 'Equals', 'GetHashCode', 'ReferenceEquals',
22
+ 'Add', 'Remove', 'Contains', 'Clear', 'Count', 'Any', 'All',
23
+ 'Where', 'Select', 'SelectMany', 'OrderBy', 'OrderByDescending', 'GroupBy',
24
+ 'First', 'FirstOrDefault', 'Single', 'SingleOrDefault', 'Last', 'LastOrDefault',
25
+ 'ToList', 'ToArray', 'ToDictionary', 'AsEnumerable', 'AsQueryable',
26
+ 'Aggregate', 'Sum', 'Average', 'Min', 'Max', 'Distinct', 'Skip', 'Take',
27
+ 'String', 'Format', 'IsNullOrEmpty', 'IsNullOrWhiteSpace', 'Concat', 'Join',
28
+ 'Trim', 'TrimStart', 'TrimEnd', 'Split', 'Replace', 'StartsWith', 'EndsWith',
29
+ 'Convert', 'ToInt32', 'ToDouble', 'ToBoolean', 'ToByte',
30
+ 'Math', 'Abs', 'Ceiling', 'Floor', 'Round', 'Pow', 'Sqrt',
31
+ 'Dispose', 'Close',
32
+ 'TryParse', 'Parse',
33
+ 'AddRange', 'RemoveAt', 'RemoveAll', 'FindAll', 'Exists', 'TrueForAll',
34
+ 'ContainsKey', 'TryGetValue', 'AddOrUpdate',
35
+ 'Throw', 'ThrowIfNull',
36
+ ]);
37
+ export const csharpProvider = defineLanguage({
38
+ id: SupportedLanguages.CSharp,
39
+ extensions: ['.cs'],
40
+ treeSitterQueries: CSHARP_QUERIES,
41
+ typeConfig: csharpConfig,
42
+ exportChecker: csharpExportChecker,
43
+ importResolver: resolveCSharpImport,
44
+ namedBindingExtractor: extractCSharpNamedBindings,
45
+ interfaceNamePattern: /^I[A-Z]/,
46
+ mroStrategy: 'implements-split',
47
+ fieldExtractor: createFieldExtractor(csharpFieldConfig),
48
+ builtInNames: BUILT_INS,
49
+ });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Dart Language Provider
3
+ *
4
+ * Dart traits:
5
+ * - importSemantics: 'wildcard' (Dart imports bring everything public into scope)
6
+ * - exportChecker: public if no leading underscore
7
+ * - Dart SDK imports (dart:*) and external packages are skipped
8
+ * - enclosingFunctionFinder: Dart's tree-sitter grammar places function_body
9
+ * as a sibling of function_signature/method_signature (not as a child).
10
+ * The hook resolves the enclosing function by inspecting the previous sibling.
11
+ */
12
+ export declare const dartProvider: import("../language-provider.js").LanguageProvider;