Conversation
Migrated from FalkorDB/code-graph-backend PR #59. Original issue: FalkorDB/code-graph-backend#51 Resolves #540 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds JavaScript language support to the backend source analysis pipeline by introducing a Tree-sitter-based analyzer and wiring it into SourceAnalyzer, enabling JS projects to be parsed into the graph model.
Changes:
- Added
JavaScriptAnalyzer(Tree-sitter JavaScript) to extract JS entities (functions/classes/methods). - Wired
.jsintoSourceAnalyzer’s analyzer registry and file discovery. - Added
tree-sitter-javascriptas a Python dependency.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
pyproject.toml |
Adds the tree-sitter-javascript dependency required for JS parsing. |
api/analyzers/source_analyzer.py |
Registers .js analyzer, includes JS files in discovery, and includes a JS LSP placeholder in second pass. |
api/analyzers/javascript/analyzer.py |
Implements Tree-sitter-based JavaScript entity extraction and symbol collection/resolution hooks. |
api/analyzers/javascript/__init__.py |
Declares the new analyzer package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "tree-sitter-c>=0.24.1,<0.25.0", | ||
| "tree-sitter-python>=0.25.0,<0.26.0", | ||
| "tree-sitter-java>=0.23.5,<0.24.0", | ||
| "tree-sitter-javascript>=0.23.0", |
| def analyze_sources(self, path: Path, ignore: list[str], graph: Graph) -> None: | ||
| path = path.resolve() | ||
| files = list(path.rglob("*.java")) + list(path.rglob("*.py")) + list(path.rglob("*.cs")) | ||
| files = list(path.rglob("*.java")) + list(path.rglob("*.py")) + list(path.rglob("*.cs")) + list(path.rglob("*.js")) |
| captures = query.captures(entity.node) | ||
| if 'reference.call' in captures: | ||
| for caller in captures['reference.call']: | ||
| entity.add_symbol("call", caller) | ||
| query = self.language.query("(formal_parameters (identifier) @parameter)") | ||
| captures = query.captures(entity.node) |
| heritage = entity.node.child_by_field_name('body') | ||
| if heritage is None: | ||
| return | ||
| superclass_node = entity.node.child_by_field_name('name') |
| analyzers: dict[str, AbstractAnalyzer] = { | ||
| # '.c': CAnalyzer(), | ||
| # '.h': CAnalyzer(), | ||
| '.py': PythonAnalyzer(), | ||
| '.java': JavaAnalyzer(), | ||
| '.cs': CSharpAnalyzer()} | ||
| '.cs': CSharpAnalyzer(), | ||
| '.js': JavaScriptAnalyzer()} |
Migrated from falkordb/code-graph-backend#59
Summary
Add support for JavaScript code analysis using tree-sitter.
Changes:
JavaScriptAnalyzerclass using tree-sitter for JavaScriptsource_analyzer.pyto include JavaScripttree-sitter-javascriptdependencyResolves #540
Originally authored by @gkorland in falkordb/code-graph-backend#59