Rework IntelliJ Plugin#2
Merged
Merged
Conversation
Updated the NES engine and IntelliJ plugin to use UTF-16 offsets for more accurate cursor positioning and edit resolution. Introduced a toggle for changes-above-cursor mode and implemented logic to limit context chunks for local base URLs. - **Core**: Added `utf16_offset_to_byte_offset` and `resolve_edit_start_offset` to handle cross-platform coordinate mapping. - **Core**: Enhanced `compute_prefill` with `force_ghost_text` support and improved line break counting for CRLF compatibility. - **Core**: Updated `build_sweep_prompt` to support optional context chunk capping and forced prefixes. - **IntelliJ**: Added `nesChangesAboveCursorEnabled` setting and UI toggle in `OxideCodeConfigurable`. - **IntelliJ**: Updated `NesEditorListener` to pass `cursorOffsetUtf16` and conditional `limitContextChunks` based on the base URL. - **JNI/Node**: Updated bindings to include UTF-16 offset and context limit parameters.
Migrated the next-edit autocomplete fetching logic from the Kotlin-based `AutocompleteIpResolverService` to the native `CoreBridge`. This change delegates HTTP requests and JSON processing to the underlying Rust core via JNI, improving consistency between platforms. - **IntelliJ**: Introduced `CoreBridge` service to handle native library loading and JNI calls. - **IntelliJ**: Replaced manual `HttpRequest` and compression logic in `AutocompleteIpResolverService` with `CoreBridge.fetchNextEditAutocomplete`. - **JNI**: Added `fetchNextEditAutocomplete` implementation in Rust using `reqwest` and `tokio`. - **JNI**: Implemented `parse_last_json_object` to handle responses and integrated `CancellationToken` for request management. - **Build**: Added `reqwest` dependency to `Cargo.toml`.
…NesEngine Integrated a comprehensive settings menu for OxideCode and moved the next-edit prediction logic into the Rust core's `NesEngine`. This refactor replaces the previous HTTP-based proxy in the JNI layer with a direct engine implementation, providing better control over prompt styles and model parameters. - **IntelliJ**: Added `OxideCodeConfigurable` to manage API keys, base URLs, model names, and NES prompt styles. - **IntelliJ**: Introduced `OxideCodeStartupActivity` to initialize project services on startup. - **IntelliJ**: Updated `AutocompleteIpResolverService` and `CoreBridge` to pass user-defined settings to the native layer. - **JNI**: Replaced manual `reqwest` calls in `lib.rs` with `NesEngine` predictions using `OmniProvider`. - **JNI**: Implemented coordinate conversion utilities (`utf16_offset_to_line_col`, `byte_offset_for_line_col`) to bridge IDE and core offsets. - **Core**: Enhanced `OxideCodeSettings` with default values for model names and prompt styles.
Updated the `CoreBridge` and JNI layers to include a debug log directory parameter, enabling the `NesEngine` to record calibration logs. - **IntelliJ**: Updated `AutocompleteIpResolverService` and `CoreBridge` to pass `debugLogDir` from settings. - **JNI**: Refactored native bindings in `lib.rs` to accept `debug_log_dir` and configure `NesConfig` accordingly.
- **Cargo**: Bumped workspace and crate versions from 0.1.0 to 0.4.0. - **CI**: Updated `build-universal.yml` to use `intellij-plugin-v2` directory. - **CI**: Reduced artifact retention period to 14 days.
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 several significant improvements and feature additions to the NES engine and prompt system, along with related workflow and dependency updates. The main focus is on improved cursor and offset handling, enhanced context chunk management, and better support for ghost text/forced prefix completions. There are also workflow changes to support a new IntelliJ plugin location and version updates.
NES Engine and Prompt System Enhancements:
core/src/nes/engine.rs[1] [2] [3] [4] [5] [6] [7]limit_context_chunksparameter to restrict the number of context chunks used when needed, improving performance and allowing for more flexible prompt construction. (core/src/nes/engine.rs[1] [2] [3] [4]\nand\r\nline endings robustly, ensuring consistent behavior across platforms. (core/src/nes/prompt.rs[1] [2] [3]Ghost Text and Forced Prefix Support:
core/src/nes/prompt.rs[1] [2] [3] [4] [5] [6] [7] [8]Workflow and Dependency Updates:
intellij-plugin-v2instead ofintellij-plugin, including all related paths and artifact retention settings. (.github/workflows/build-universal.yml[1] [2]0.4.0and addedserdeas a workspace dependency for the JVM bindings. (Cargo.toml[1]bindings/jvm/Cargo.toml[2]Other Notable Changes:
TokenFamilyenum to the config for future extensibility. (core/src/config.rscore/src/config.rsR32-R38)EditDeltaand related prompt logic for better maintainability. (core/src/nes/delta.rscore/src/nes/delta.rsR33-R34)These changes collectively improve the accuracy, flexibility, and maintainability of the NES engine and its integration points.