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:
29
editors/nvim/after/queries/lux/folds.scm
Normal file
29
editors/nvim/after/queries/lux/folds.scm
Normal 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
|
||||
55
editors/nvim/after/queries/lux/textobjects.scm
Normal file
55
editors/nvim/after/queries/lux/textobjects.scm
Normal 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 . "}")
|
||||
Reference in New Issue
Block a user