-
-
Notifications
You must be signed in to change notification settings - Fork 234
feat(living-canvas): add multi-language support for Python, JavaScript, TypeScript, and Go #2058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Define feature specification for extending Living Canvas to support multiple programming languages beyond Common Lisp. Key decisions: - Pluggable language provider architecture - Static analysis (AST/tree-sitter) as primary approach, LSP optional - Initial support for Common Lisp, Python, and JavaScript/TypeScript - Unified command interface across all languages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…nguage support Complete speckit workflow generating design documents for extending Living Canvas to support Python and JavaScript/TypeScript via tree-sitter-based providers: - plan.md: Technical context, constitution check, project structure - research.md: Analysis approach decisions (tree-sitter over Python AST) - data-model.md: Entity definitions for provider architecture - quickstart.md: Step-by-step implementation guide (~760 LOC scope) - tasks.md: 98 tasks organized by user story (59 in MVP scope) - contracts/provider-interface.lisp: Formal provider API contract - contracts/tree-sitter-queries.md: Query patterns for Python/JS/TS Also applies spec.md remediation edits from analysis phase: - Align Python analysis method with plan (tree-sitter) - Scope module/system-level scenarios to Phase 2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…t, TypeScript, and Go Add tree-sitter based call graph providers for Python, JavaScript/TypeScript, and Go languages. This enables Living Canvas to visualize function call graphs for these languages in addition to Common Lisp. Changes: - Add provider registry system in call-graph extension for managing multiple language providers with priority-based selection - Add language detection module that identifies file language by major mode or file extension - Implement tree-sitter Python provider with function/method extraction and call relationship analysis - Implement tree-sitter JavaScript/TypeScript provider supporting function declarations, arrow functions, and method definitions - Implement tree-sitter Go provider for functions and methods - Add living-canvas-current-buffer command for multi-language support - Add living-canvas-diagnose command for troubleshooting provider status - Add living-canvas-reload-providers command for manual provider registration - Update flake.nix with tree-sitter grammars for Python, JS, TS, and Go - Add comprehensive test suites for all new components - Add sample files for testing each supported language The new living-canvas-current-buffer command automatically detects the programming language and selects the appropriate provider. Common Lisp continues to use the existing micros-based provider. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
❌ Code Contractor Validation: FAILED Fix Suggestions
📚 About Code ContractorDeclarative Code Standards That Learn and Improve Define domain-specific validation rules in YAML. Want this for your repo? |
Move tree-sitter call-graph providers from living-canvas to their language-specific mode directories: - python-provider.lisp → extensions/python-mode/call-graph-provider.lisp - js-provider.lisp → extensions/js-mode/call-graph-provider.lisp - go-provider.lisp → extensions/go-mode/call-graph-provider.lisp Each mode now defines a subsystem (e.g., lem-python-mode/call-graph) that can be loaded independently. Living-canvas depends on these subsystems rather than bundling the providers directly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- file_structure_rule: Move defvar before defclass in registry.lisp, initialize to nil and set after class definition - docstring_rule: Add defgeneric declarations with docstrings for exported condition readers (provider-error-provider, etc.) - functional_style_rule: Remove :register option from macro that used *provider-registry* directly; document global as well-documented exception - macro_style_rule: Extract option parsing to %parse-provider-options helper function, keeping macro minimal 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Contractor validation failed ❌ — see the sticky comment for full results.
| (let ((provider (make-go-provider))) | ||
| (when (provider-ts-language provider) | ||
| ;; Only register if not already registered | ||
| (unless (find-provider *provider-registry* :go) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Contractor: functional_style_rule
AI check failed: "functional_style_rule"
Reason:
Uses the dynamic global *provider-registry* as shared state instead of passing the registry explicitly via function arguments, violating the preference for explicit arguments over dynamic variables (and relying on defvar-based cross-function state).
…t, TypeScript, and Go (lem-project#2058) * feat(living-canvas): add multi-language support specification Define feature specification for extending Living Canvas to support multiple programming languages beyond Common Lisp. Key decisions: - Pluggable language provider architecture - Static analysis (AST/tree-sitter) as primary approach, LSP optional - Initial support for Common Lisp, Python, and JavaScript/TypeScript - Unified command interface across all languages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(living-canvas): add implementation design artifacts for multi-language support Complete speckit workflow generating design documents for extending Living Canvas to support Python and JavaScript/TypeScript via tree-sitter-based providers: - plan.md: Technical context, constitution check, project structure - research.md: Analysis approach decisions (tree-sitter over Python AST) - data-model.md: Entity definitions for provider architecture - quickstart.md: Step-by-step implementation guide (~760 LOC scope) - tasks.md: 98 tasks organized by user story (59 in MVP scope) - contracts/provider-interface.lisp: Formal provider API contract - contracts/tree-sitter-queries.md: Query patterns for Python/JS/TS Also applies spec.md remediation edits from analysis phase: - Align Python analysis method with plan (tree-sitter) - Scope module/system-level scenarios to Phase 2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(living-canvas): add multi-language support for Python, JavaScript, TypeScript, and Go Add tree-sitter based call graph providers for Python, JavaScript/TypeScript, and Go languages. This enables Living Canvas to visualize function call graphs for these languages in addition to Common Lisp. Changes: - Add provider registry system in call-graph extension for managing multiple language providers with priority-based selection - Add language detection module that identifies file language by major mode or file extension - Implement tree-sitter Python provider with function/method extraction and call relationship analysis - Implement tree-sitter JavaScript/TypeScript provider supporting function declarations, arrow functions, and method definitions - Implement tree-sitter Go provider for functions and methods - Add living-canvas-current-buffer command for multi-language support - Add living-canvas-diagnose command for troubleshooting provider status - Add living-canvas-reload-providers command for manual provider registration - Update flake.nix with tree-sitter grammars for Python, JS, TS, and Go - Add comprehensive test suites for all new components - Add sample files for testing each supported language The new living-canvas-current-buffer command automatically detects the programming language and selects the appropriate provider. Common Lisp continues to use the existing micros-based provider. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor(call-graph): move language providers to respective mode modules Move tree-sitter call-graph providers from living-canvas to their language-specific mode directories: - python-provider.lisp → extensions/python-mode/call-graph-provider.lisp - js-provider.lisp → extensions/js-mode/call-graph-provider.lisp - go-provider.lisp → extensions/go-mode/call-graph-provider.lisp Each mode now defines a subsystem (e.g., lem-python-mode/call-graph) that can be loaded independently. Living-canvas depends on these subsystems rather than bundling the providers directly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(call-graph): address code-contractor review violations - file_structure_rule: Move defvar before defclass in registry.lisp, initialize to nil and set after class definition - docstring_rule: Add defgeneric declarations with docstrings for exported condition readers (provider-error-provider, etc.) - functional_style_rule: Remove :register option from macro that used *provider-registry* directly; document global as well-documented exception - macro_style_rule: Extract option parsing to %parse-provider-options helper function, keeping macro minimal 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Description
Add tree-sitter based call graph providers for Python, JavaScript/TypeScript, and Go languages. This enables Living Canvas to visualize function call graphs for these languages in addition to Common Lisp.
New Features
living-canvas-current-buffer- Multi-language support with auto-detectionliving-canvas-diagnose- Troubleshoot provider statusliving-canvas-reload-providers- Manual provider registrationSupported Languages
Future Work (separate PR)
AI Usage Disclosure
Did you use LLMs/AI tools for this PR?
Tooling Used: Claude Code (Claude Opus 4.5)
The "Human-in-the-Loop" Verification
1. Logic Walkthrough
The implementation follows a provider-based architecture for extensibility:
Provider Registry (
call-graph/registry.lisp): A central registry that manages multiple language providers. Each provider has a priority, and the registry selects the highest-priority provider that supports a given language/source.Language Detection (
living-canvas/language-detection.lisp): Uses a two-tier detection strategy:Tree-sitter Providers (Python, JS, Go): Each provider:
*after-init-hook*(handles Nix build timing)Command Flow:
living-canvas-current-buffer→detect-language→find-provider→provider-analyze→ render graphKey design decisions:
*after-init-hook*solves Nix build issue where grammars aren't available at compile time2. Reviewer's Guide
High-risk areas:
find-enclosing-functionin each provider - usesreturn-fromto correctly exit the function (not just the loop)Suggested focus for reviewer:
Related Issues
N/A (New feature based on spec in
specs/001-multi-language-canvas/)