6 Commits

Author SHA1 Message Date
Giancarlo Erra c2c616f4a3 fix(indexing): normalize extension casing and tighten docs/test (#77)
Address CodeRabbit review:
- getLanguageFromExtension/getAstGrepLang lowercase the extension before
  consulting the override map, so an uppercase ext still matches the
  lowercased keys (production callers already lowercase; .R collapses to
  .r with the same value, so no other behavior changes).
- README: clarify EXTRA_EXTENSIONS indexes as plaintext / leaf nodes,
  versus EXTENSION_LANGUAGE_MAP's full language treatment.
- Make the isIndexableFile override test hermetic (save/restore the prior
  map entry, assert against the captured baseline).
2026-06-28 20:59:25 +01:00
Giancarlo Erra 1c5ddf52be feat(indexing): map custom extensions to languages via EXTENSION_LANGUAGE_MAP (#77)
EXTRA_EXTENSIONS indexes unknown extensions as plaintext, losing AST
chunking, symbols, and the call graph. EXTENSION_LANGUAGE_MAP lets you
map an extension to a real language (e.g. .inc:php) so it gets full
language treatment end to end.

Format `.inc:php,.module:php`. Each entry resolves to the target
language's canonical extension, so both the language label
(getLanguageFromExtension) and the AST grammar (getAstGrepLang) come
from the existing maps and stay consistent, without re-encoding their
different vocabularies (shell vs bash, Lang enums for JS/TS/HTML/CSS).
Mapped extensions are auto-discovered (indexer + watcher) without also
needing EXTRA_EXTENSIONS, and can override built-ins (e.g. .h:cpp).
Targets with no AST grammar (the reporter's .foo:bar) and malformed
entries are rejected and warned about at startup.

Additive and backward compatible: with the var unset, behavior is
unchanged; no new dependency; no data migration.
2026-06-28 20:22:08 +01:00
Giancarlo Erra 7bd9eb5308 feat(graph): full Dart support via tree-sitter AST (#71)
Dart previously fell through to the regex symbol fallback, which cannot
match type-first signatures (void foo(), Future<int> baz() async), so
classes, methods, and calls were invisible to codebase_symbol,
codebase_flow, and codebase_impact, and files were chunked by line
count instead of declaration boundaries.

- Register @ast-grep/lang-dart as a dynamic grammar (per-grammar
  failure isolation keeps missing prebuilds on the regex fallback).
- Add extractFromDart: classes, mixins (trait), enums, extensions,
  typedefs, type-first top-level functions, getters/setters, and
  constructors including named and factory forms. Scope ranges are
  stitched from Dart's sibling function_signature/function_body pairs.
  Calls are recovered from argument_part nodes: method calls, bare
  calls, constructor invocations, prefixed calls, and cascades.
- Add dart to TOP_LEVEL_KINDS so chunking follows declaration
  boundaries; signature and body kinds are both listed so the
  overlap-merge fuses each pair into one region.
- Add dart main() to ENTRY_POINT_NAMES for entry-point detection.
- Move Dart to Full Support in the README language matrix.
2026-06-11 12:12:18 +01:00
midwestE 7265247d83 feat: add env support for controlling indexing of dotfiles 2026-03-17 07:11:25 -05:00
Csaba Tuncsik 505fbd722b fix: use relative paths for index keys to support shared worktree indexes
When SOCRATICODE_PROJECT_ID is set to share a Qdrant collection across
git worktrees, the indexer still used absolute paths as keys in the file
hash map, chunk IDs, and for deleting file chunks. This caused every
worktree to see all files as "new" and trigger a full re-index, defeating
the purpose of the shared project ID feature.

Switch all internal keying from absolute paths to relative paths:
- chunkId() now hashes on relativePath for stable IDs across worktrees
- File hash map (change detection) keyed by relativePath
- deleteFileChunks() filters on relativePath Qdrant field
- Deleted file detection uses relative path sets

Absolute paths are now only used for actual file I/O (stat, readFile).
2026-03-16 08:39:22 +01:00
Giancarlo Erra 3f0ed5a286 feat: SocratiCode v1.0.0 — initial release 2026-02-28 17:06:21 +00:00