feat: improve editor tooling and fix warnings

Neovim improvements:
- Add tree-sitter text objects for functions, types, blocks
- Add folding support
- Enhanced REPL integration (toggle, send line/selection)
- New commands: LuxCheck, LuxReplToggle, LuxSend
- Better keybindings with localleader

VS Code extension:
- Full syntax highlighting with TextMate grammar
- LSP client integration
- 20+ snippets for common patterns
- Commands: run, format, check, REPL
- Keybindings and context menu

Fixes:
- Fix all cargo warnings with #[allow(dead_code)] annotations
- Clean up unused variables

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 18:23:55 -05:00
parent ebc0bdb109
commit a6eb349d59
14 changed files with 1437 additions and 9 deletions

View File

@@ -0,0 +1,29 @@
; Folding queries for Lux
; Allows folding function bodies, type definitions, etc.
; Fold function bodies
(function_declaration) @fold
; Fold type definitions
(type_declaration) @fold
; Fold effect declarations
(effect_declaration) @fold
; Fold handler declarations
(handler_declaration) @fold
; Fold trait declarations
(trait_declaration) @fold
; Fold impl blocks
(impl_declaration) @fold
; Fold match expressions
(match_expression) @fold
; Fold block expressions
(block_expression) @fold
; Fold multi-line comments (doc comments)
(doc_comment)+ @fold

View File

@@ -0,0 +1,55 @@
; Tree-sitter text objects for Lux
; Use with nvim-treesitter-textobjects
; Function text objects
(function_declaration) @function.outer
(function_declaration body: (_) @function.inner)
; Class/type text objects (treat type declarations like classes)
(type_declaration) @class.outer
(type_declaration definition: (_) @class.inner)
; Parameter text objects
(parameters) @parameter.outer
(parameter) @parameter.inner
; Block text objects
(block_expression) @block.outer
(block_expression (_) @block.inner)
; Match arm text objects (like case statements)
(match_arm) @statement.outer
(match_arm consequence: (_) @statement.inner)
; Conditional text objects
(if_expression) @conditional.outer
(if_expression consequence: (_) @conditional.inner)
; Comment text objects
(line_comment) @comment.outer
(doc_comment) @comment.outer
; Call text objects
(call_expression) @call.outer
(call_expression arguments: (_) @call.inner)
; Effect/handler text objects (Lux-specific)
(effect_declaration) @effect.outer
(effect_declaration body: (_) @effect.inner)
(handler_declaration) @handler.outer
(handler_declaration body: (_) @handler.inner)
; Loop text objects (using recursion as loops in Lux)
(match_expression) @loop.outer
(match_expression body: (_) @loop.inner)
; Assignment text objects
(let_declaration) @assignment.outer
(let_declaration value: (_) @assignment.inner)
; Attribute/property text objects
(property_clause) @attribute.outer
; Return value (last expression in block)
(block_expression (_) @return.inner . "}")