Enhance Rust Analyzer and Code Editor with New Features and Fixes#118
Merged
Conversation
Reworked discovery order and validation in mod.rs:109. Added explicit override support via PULSAR_RUST_ANALYZER_PATH in mod.rs:110. Added absolute path scanning for GUI-launch environments (macOS app PATH gaps), including HOME/.cargo/bin and CARGO_HOME/bin in mod.rs:168. Added rustup discovery from multiple rustup locations, not just PATH, in mod.rs:197. Added robust executable verification that detects rustup proxy stubs missing the rust-analyzer component in mod.rs:251. Rebuilt rustup install flow to try all rustup candidates and verify installed binary before use in mod.rs:349. Made GitHub fallback download architecture-aware for x86_64 and aarch64 on all major OSes in mod.rs:417. Added downloader fallback behavior (curl/wget on Unix, PowerShell/curl on Windows) in mod.rs:437. Added pre-spawn validation so broken/proxy binaries trigger self-healing install before launch in mod.rs:638. Persisted the resolved/installed analyzer path back into manager state after successful spawn in mod.rs:578.
Minimap (minimap.rs) — full rewrite as a GPUI Element: Gets actual bounds at prepaint time so all heights are real, not hardcoded px(100) Scroll sync: when the doc is taller than the minimap, minimap_scroll_offset slides the density bars to follow the document scroll proportionally Viewport indicator: positioned by scroll_abs / content_h (fraction of document scrolled) × real container_h — no more relative() guessing Click/drag: captures scroll_handle in closures, sets offset.y directly from click fraction — no // TODO left Custom scrollbar (editor_scrollbar.rs) — new file: Thin 12 px track, always visible (no fade-in/out complexity) Thumb: sized by viewport / content ratio, positioned by scroll_abs / max_offset — both using the real ScrollHandle APIs (max_offset().height, bounds().size.height) Drag: click on thumb starts drag, MouseMoveEvent computes delta and scales it by max_offset / track_travel Click on track: jumps to clicked position with thumb centered text_input.rs: Code editor mode: generic Scrollbar removed, EditorScrollbar + optional Minimap added as absolutely-positioned overlay elements Non-code inputs: generic Scrollbar unchanged
Revert "Code editor folding" This reverts commit 1cf8989.
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.
This pull request introduces significant improvements to the code editor's rendering and scrolling logic, focusing on better handling of visible rows (especially with hidden or folded lines), as well as adding a custom VS Code-style scrollbar. The changes refactor how visible lines are tracked and processed, ensuring accurate cursor and selection rendering, and optimize performance for large files.
Editor Scrollbar:
editor_scrollbar.rsfile that implements a custom, thin vertical scrollbar for the code editor, supporting drag and click-to-scroll interactions in a VS Code style.Visible Rows Refactor and Rendering Accuracy:
visible_rangewith explicitvisible_rowsandvisible_row_offsetsthroughoutTextElement, ensuring correct rendering and interaction when lines are hidden or folded. This affects cursor/selection rendering, line highlighting, and layout calculations. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Performance and Maintainability:
Dependency Updates:
engine_class_deriveandpulsar_reflectionas dependencies in the generatedCargo.tomlfor core projects.These changes collectively enhance the editor's usability, visual accuracy, and maintainability, especially in scenarios involving line folding or large documents.