Skip to content

VIM-4134 Split plugin into frontend/backend modules for rem dev#1584

Open
1grzyb1 wants to merge 18 commits intomasterfrom
VIM-4134/split
Open

VIM-4134 Split plugin into frontend/backend modules for rem dev#1584
1grzyb1 wants to merge 18 commits intomasterfrom
VIM-4134/split

Conversation

@1grzyb1
Copy link
Collaborator

@1grzyb1 1grzyb1 commented Feb 23, 2026

IdeaVim was a monolith that only worked when the IDE ran locally. JetBrains' Remote Dev and Fleet run the backend (project model, file system, processes) on a remote host while the frontend (UI, editor, keybindings) runs on the user's machine. A monolithic plugin can't participate in this split — every file operation, shell command, bookmark, and jump that touches the backend would fail.

This branch carves IdeaVim into three new modules — common (shared RPC contracts), backend (server-side implementations), and frontend (everything visible to the user) — connected by four Fleet RPC interfaces. The frontend never touches the file system directly; the backend never touches the injector or Vim options. Every cross-boundary call is an explicit, serializable RPC message.

@1grzyb1 1grzyb1 marked this pull request as draft February 23, 2026 08:39
@1grzyb1 1grzyb1 force-pushed the VIM-4134/split branch 2 times, most recently from b201f8b to 041115e Compare February 26, 2026 07:28
@1grzyb1 1grzyb1 force-pushed the VIM-4134/split branch 2 times, most recently from 278afd6 to 787f492 Compare March 5, 2026 08:14
@1grzyb1
Copy link
Collaborator Author

1grzyb1 commented Mar 5, 2026

/claude-review

@1grzyb1 1grzyb1 marked this pull request as ready for review March 5, 2026 08:24
@1grzyb1 1grzyb1 force-pushed the VIM-4134/split branch 2 times, most recently from 34b7eba to 066cecd Compare March 6, 2026 08:10
@slavam2605
Copy link

Two main points so far:

  1. Use platform RPC IDs for Project, FileEditor, VirtualFiles, and similar classes. This will remove a lot of boilerplate code from this MR.
  2. For each feature, think about whether it's possible to implement it entirely on the frontend. If yes, move it and its settings to the frontend. Settings are preferred to be on the frontend, since they are shared with the monolith IDE. So you will get your local settings if you use IdeaVim in remote development mode.

I'll wait for at least (1) to be fixed and will continue reviewing the code afterwards.

@1grzyb1 1grzyb1 force-pushed the VIM-4134/split branch 4 times, most recently from 407b41e to c8fdd5e Compare March 10, 2026 13:08
Copy link

@slavam2605 slavam2605 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good.
I could missed something, because this MR is big and contains refactorings, code style changes and a lot of changes that don't look directly connected to split.

import com.maddyhome.idea.vim.ui.ShowCmd
import java.awt.Toolkit

@Service

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a lot of services are not annotated with @Service anymore? Do you have a reason to register them in XML (if they are)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided we want to leave code in src but want to load services only on frontend so we register them in modules/frotnend. If we would leave @Service those would load both on frontend and backend

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Why didn't you move the code, though? To avoid big changes in MR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's one thing but more important is that there are other plugins and PR that are dependent on that code and we didn't want to break backward compatibility

@1grzyb1 1grzyb1 force-pushed the VIM-4134/split branch 2 times, most recently from cf3366d to 23279cd Compare March 11, 2026 12:48
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1grzyb1 and others added 16 commits March 11, 2026 14:15
The field was used to break out of the mapping replay loop when max
recursion depth was hit. This is unnecessary since handleKey already
returns early on max depth, stopping further processing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use this.javaClass.classLoader instead of object {}.javaClass.classLoader
- Alphabetize imports in VimInjector.kt
- Remove outdated TODO in VimMotionGroupBase.kt
- Fix missing trailing newline in VimPsiService.kt

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…resources

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All operations uses rpc interface right now and on backend we detect if we are in disptch thread if so we won't use EDT.
Add focusNew parameter to splitWindow to allow NERDTree preview
mappings (gs, gi, ga) to keep focus on the tree.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Commentary was doing visual selection on frontend and actual commenting
on backend which resulted in strange undo behaviour.
Moving whole commenting logic fixes all undo issues by making all actions single undo group.
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.

2 participants