90 scala support#91
Conversation
|
Hi! Sorry to drop in cold — I've been working through the open PR backlog and noticed your PR is waiting on the same architectural conflict as a bunch of other language PRs. I've opened a refactor PR (#116) that turns "adding a language" from a 6-file mutation into a 1-file addition. Once that lands, this PR rebases cleanly. Sharing the rebase template inline so you don't have to read the maintainer guide to do it. After #116 merges, the rebase is mechanicalStep 1. Discard your changes to the monolithic files (#116 makes them auto-derived from the registry): git checkout main -- \
src/types.ts \
src/extraction/grammars.ts \
src/extraction/languages/index.ts \
CLAUDE.mdStep 2. Move your extractor's registration into one file, import { yourExtractor } from './your-extractor-config';
import type { LanguageDef } from './types';
export const YOUR_DEF: LanguageDef = {
name: 'yourlang',
displayName: 'Your Language',
extensions: ['.ext'],
includeGlobs: ['**/*.ext'],
// For a tree-sitter grammar:
grammar: { wasmFile: 'tree-sitter-yourlang.wasm', vendored: true, extractor: yourExtractor },
// OR for a custom regex/template extractor (Liquid, HCL pattern):
// customExtractor: (filePath, source) => new YourExtractor(filePath, source).extract(),
};Step 3. Add 2 lines to import { YOUR_DEF } from './yourlang'; // alphabetical
// ...
const ALL_DEFS: readonly LanguageDef[] = [
// ... alphabetical
YOUR_DEF,
// ...
];Step 4. Add Step 5. Your test additions in That's it. If your existing Three of my own language PRs (#92, #94, #95) are already pre-rebased to this pattern as references if you want to see what a finished rebase looks like. Happy to help with the rebase if you'd like — just let me know. |
External PR (firehooper). Originally based on the monolithic grammars.ts; rebased to per-language registry pattern. - src/extraction/languages/scala.ts (scalaExtractor + SCALA_DEF) - 'scala' added to Language union - Vendored tree-sitter-scala.wasm - Extensions: .scala, .sc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@andreinknv sure thing I can help with rebase after the new style has been merged. It will be nice to avoid the conflicts and get many more languages added. Thanks! |
|
I am like 471 commits more on my wip branch, lol. while waiting for pr merges to happen, I have completely refactored the whole codebase. I really like this project, it is actually helps a lot during AI coding. |
Conflict resolution after 2 weeks of main moving:
- src/types.ts: main converted Language to a runtime-iterable
LANGUAGES `as const` array. Kept that shape and added 'scala' near
the end (matches Pascal's position).
- __tests__/extraction.test.ts: kept the PR's full Scala Extraction
describe block AND main's Vue Extraction + Instantiates+Decorates
describe blocks — they don't overlap. Closed the trailing describe
on the Scala side (was hanging open due to where the conflict marker
fell relative to the brace structure).
Verified live on real Scala codebases:
- typelevel/cats (835 .scala files): 15,771 nodes, 24,462 edges,
7,158 methods, 1,835 classes, 1,201 traits — search and context
retrieval both return correct results with proper type signatures.
- circe/circe (230 .scala files): 5,321 nodes, 5,091 edges, plus
Scala 3 enums (10 enums / 150 enum_members) extracted correctly.
Full test suite: 503/503 pass (was 481, +22 Scala tests).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Reviewed and merging — thanks for the contribution! Pushed a conflict-resolution commit to your branch (main moved in 2 weeks):
Verified live on real Scala codebases:
Full test suite: 503/503 passing. Closes #90. |
…anguages (#146) - Reorder Get Started so the per-project init code block sits between the npx install and the GIF — visually contiguous code blocks read better than code → image → code. - Add Scala (`.scala`, `.sc`) to the Supported Languages table now that #91 has landed. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#90