feat(frontend): Expand/Shrink Selection via tree-sitter AST (Shift+Alt+Right/Left)#84
Merged
Conversation
Adds editor.smartSelect IPC op to the C++ backend that walks the tree-sitter parse tree upward from the current selection to find the smallest named node that strictly contains it. Frontend wires Shift+Alt+Right/Left in GpuEditor and the Edit menu commands (editor.action.smartSelect.expand/shrink) in FullscreenIDE. A history stack on the editor enables shrink to reverse each expand step. Works for all tree-sitter-backed languages; falls back to no-op for unsupported files. Closes #71
Ctrl/Cmd+Click toggles items in the selection; Shift+Click selects a contiguous range from the last-clicked anchor. Selected items render with an accent-tinted highlight distinct from the single active-file highlight. Right-clicking a multi-selection shows a batch context menu (Delete Selected, Copy Paths). Delete/Backspace fires the confirmation dialog for all selected items, which now accepts an array and reports the count when multiple targets are involved. Dragging a selection moves all selected files to the drop folder in parallel. Escape clears the selection. Closes #73
a93528a to
6d481ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
editor.smartSelectIPC op to the C++ backend (editor_buffer.cpp) that walks the tree-sitter parse tree from the current selection upward, returning the byte range of the smallest named node that strictly contains the selectionGpuEditorgainsexpandSmartSelect/shrinkSmartSelecton its imperative handle, with a history stack so each Shrink reverses the last Expand step; history clears on any regular cursor movementFullscreenIDEwireseditor.action.smartSelect.expandandeditor.action.smartSelect.shrinkinto the trigger handler, enabling the Edit menu items that were previously no-opsWorks for all tree-sitter-backed languages (JS, TS, TSX, Python, C, C++, Rust, Go, Java, and more). Falls back to a no-op for unsupported files with no parse tree.
Test plan
Closes #71