Skip to content

Rework IntelliJ Plugin#2

Merged
Henrik-3 merged 12 commits into
mainfrom
rework/sweep-parity
Apr 23, 2026
Merged

Rework IntelliJ Plugin#2
Henrik-3 merged 12 commits into
mainfrom
rework/sweep-parity

Conversation

@Henrik-3
Copy link
Copy Markdown
Member

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:

  • Added support for passing and resolving UTF-16 cursor offsets throughout the NES engine, ensuring accurate cursor positioning and edit application, especially for multi-byte character encodings. (core/src/nes/engine.rs [1] [2] [3] [4] [5] [6] [7]
  • Introduced a limit_context_chunks parameter 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]
  • Improved line counting and splitting logic to handle both \n and \r\n line endings robustly, ensuring consistent behavior across platforms. (core/src/nes/prompt.rs [1] [2] [3]

Ghost Text and Forced Prefix Support:

  • Added ghost text/forced prefix support to the prompt system, allowing the model to be forced to complete a specific prefix when required. This includes new logic for splitting and managing forced prefixes, and stitching them to the model output. (core/src/nes/prompt.rs [1] [2] [3] [4] [5] [6] [7] [8]

Workflow and Dependency Updates:

  • Updated the build workflow to use intellij-plugin-v2 instead of intellij-plugin, including all related paths and artifact retention settings. (.github/workflows/build-universal.yml [1] [2]
  • Bumped workspace package version to 0.4.0 and added serde as a workspace dependency for the JVM bindings. (Cargo.toml [1] bindings/jvm/Cargo.toml [2]

Other Notable Changes:

  • Added a new TokenFamily enum to the config for future extensibility. (core/src/config.rs core/src/config.rsR32-R38)
  • Refactored and clarified code in EditDelta and related prompt logic for better maintainability. (core/src/nes/delta.rs core/src/nes/delta.rsR33-R34)

These changes collectively improve the accuracy, flexibility, and maintainability of the NES engine and its integration points.

Henrik-3 and others added 12 commits April 22, 2026 00:31
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.
@Henrik-3 Henrik-3 merged commit ac8da99 into main Apr 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant