Skip to content

Conversation

catrielmuller
Copy link
Contributor

@catrielmuller catrielmuller commented Aug 26, 2025

Context

This PR introduces comprehensive JetBrains extension support for the Kilocode project. The implementation provides a bridge between JetBrains IDEs and the existing VS Code extension ecosystem, enabling Kilocode extensions to run natively within IntelliJ IDEA and other JetBrains IDEs.

Implementation

  • Complete RPC protocol implementation for extension communication
  • Extension process management and lifecycle handling
  • Editor state synchronization between IDE and extensions
  • File system event monitoring and workspace management

Screenshots

@catrielmuller catrielmuller requested a review from Copilot August 26, 2025 20:15
Copy link

changeset-bot bot commented Aug 26, 2025

🦋 Changeset detected

Latest commit: c654a6a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces comprehensive JetBrains extension support for the Kilocode project. The implementation provides a bridge between JetBrains IDEs and the existing VS Code extension ecosystem, enabling Kilocode extensions to run natively within IntelliJ IDEA and other JetBrains IDEs.

Key changes include:

  • Complete RPC protocol implementation for extension communication
  • Extension process management and lifecycle handling
  • Editor state synchronization between IDE and extensions
  • File system event monitoring and workspace management

Reviewed Changes

Copilot reviewed 113 out of 218 changed files in this pull request and generated no comments.

Show a summary per file
File Description
jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/ipc/*.kt Core IPC infrastructure including message passing protocols, sockets, and load estimation
jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/editor/*.kt Editor state management, tab handling, and document synchronization
jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/events/*.kt Event bus system for workspace and webview events
jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/*.kt Core extension management, RPC protocols, and process lifecycle
jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/commands/*.kt Command registry and execution framework
jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/actors/*.kt Main thread service implementations
Comments suppressed due to low confidence (32)

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/ipc/MessageListener.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/ipc/LoadEstimator.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/ipc/ISocket.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/ipc/IMessagePassingProtocol.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/ipc/ILoadEstimator.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/ipc/ChunkStream.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/ipc/BufferedEmitter.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/events/WorkspaceEvents.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/events/WebviewEvents.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/events/EventBus.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/editor/WorkspaceEdit.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/editor/TabTypes.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/editor/TabStateManager.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/editor/EditorTypes.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/editor/EditorStateService.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/editor/EditorListener.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/editor/EditorHolder.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/editor/EditorCommands.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/editor/EditorAndDocManager.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/WorkspaceManager.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ServiceProxyRegistry.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/RPCManager.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/PluginContext.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// Copyright 2009-2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionUnixDomainSocketServer.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionSocketServer.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionProcessManager.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionManager.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// Copyright 2009-2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionIdentifier.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionHostMessageType.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/core/ExtensionHostManager.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// Copyright 2009-2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/commands/Commands.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// Copyright 2009-2025 Weibo, Inc.

jetbrains/plugin/src/main/kotlin/ai/kilocode/jetbrains/actors/MainThreadWindowShape.kt:1

  • New file is missing the required kilocode_change comment at the top. Add the comment '// kilocode_change - new file' as the first line.
// SPDX-FileCopyrightText: 2025 Weibo, Inc.

@catrielmuller catrielmuller force-pushed the catrielmuller/jetbrains branch from c73dc88 to f4e0f1e Compare August 26, 2025 21:00
Chris Hasson added 3 commits August 26, 2025 17:20
…ove deps handling

This commit introduces significant improvements to how native modules and dependencies are handled within the JetBrains plugin.

Key changes include:
- **Architecture-specific native module loading**: The `genPlatform.gradle` script has been updated to support different architectures (arm64, x64) for native `.node` modules. It now creates architecture-specific directories and generates a JavaScript loader to dynamically select the correct native module at runtime based on the OS and architecture. This ensures compatibility across various macOS, Windows, and Linux environments.
- **Enhanced dependency checking**: New `deps:check` scripts have been added to `jetbrains/host/package.json` and integrated into `turbo.json`. This ensures that the VS Code submodule is initialized and up-to-date before patching or copying dependencies, preventing issues with missing files.
- **Streamlined dependency copying**: The `deps:copy` script now includes `mkdir -p` to ensure the target directory exists before copying, improving robustness.
- **Simplified `npm install` for resources**: The `copy:resource-nodemodules` script in `jetbrains/plugin/package.json` now uses `npm install` directly instead of `npm ci` and removes the `package-lock.json` copy, simplifying the resource bundling process.

These changes improve the build reliability, cross-platform compatibility, and overall maintainability of the JetBrains plugin.
Migrates the `check-dependencies.sh` script to a cross-platform Node.js version (`check-dependencies.js`).
This change improves compatibility across Windows, macOS, and Linux environments for the JetBrains plugin build process.

Updates `package.json` to use the new Node.js script and bumps `glob` and `rimraf` dependencies.
The shell script is retained but modified to call the new Node.js script and include retry logic for CI environments.
@hassoncs hassoncs force-pushed the catrielmuller/jetbrains branch from abee4a6 to b324387 Compare August 27, 2025 04:38
@hassoncs hassoncs force-pushed the catrielmuller/jetbrains branch 2 times, most recently from 0b60e7c to 871a4f4 Compare August 27, 2025 05:25
Adjust the CI pipeline to gracefully handle Java version discrepancies, particularly for JetBrains plugin builds. This update enables the `code-qa.yml` workflow to conditionally build the VSIX on Windows runners by excluding JetBrains components, acknowledging the platform's Java 17 limitations. Concurrently, the Java dependency check script now provides nuanced feedback in CI environments, issuing warnings for non-Java 17 versions on Linux/macOS and allowing continuation, while explicitly bypassing JetBrains plugin compilation on Windows CI where Java 17 is not guaranteed.
@hassoncs hassoncs force-pushed the catrielmuller/jetbrains branch from 871a4f4 to 2990d37 Compare August 27, 2025 05:27
@hassoncs hassoncs force-pushed the catrielmuller/jetbrains branch from 1a9964e to 8b5b03a Compare August 27, 2025 05:48
Copy link
Contributor

@hassoncs hassoncs left a comment

Choose a reason for hiding this comment

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

woof, what a monster PR! I left a bunch of comments, but let's meet up tomorrow and chat about things. Some of that kotlin code is absolutely wild, haha. Approving since all the changes in the extension are benign, but let's chat briefly and then merge tomorrow!


// Create ExtensionManager instance and register extension
const extensionManager = new ExtensionManager()
const rooCodeIdentifier = extensionManager.registerExtension("kilocode").identifier
Copy link
Contributor

Choose a reason for hiding this comment

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

roo - not sure if we want to rename all of these

Comment on lines +34 to +43
// Promisify Node.js fs functions
const fsStat = promisify(fs.stat)
const fsReadDir = promisify(fs.readdir)
const fsReadFile = promisify(fs.readFile)
const fsWriteFile = promisify(fs.writeFile)
const fsRename = promisify(fs.rename)
const fsCopyFile = promisify(fs.copyFile)
const fsUnlink = promisify(fs.unlink)
const fsLstat = promisify(fs.lstat)
const fsMkdir = promisify(fs.mkdir)
Copy link
Contributor

Choose a reason for hiding this comment

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

import { promises as fs } from "fs"
Could just use this?

/**
* Update change-notes in plugin.xml based on version from gradle.properties and CHANGELOG.md
*/
function updateChangeNotes() {
Copy link
Contributor

Choose a reason for hiding this comment

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

cool!

Comment on lines +123 to +131
// Remove "Thanks @username!" mentions at the beginning
.replace(/^Thanks\s+@[^!]+!\s*-?\s*/g, "")
// Remove "Thanks @username!" mentions anywhere
.replace(/Thanks\s+@[^!]+!\s*-?\s*/g, "")
// Remove "Thanks @username" mentions (without exclamation)
.replace(/Thanks\s+@[^,)]+[,)]\s*/g, "")
// Remove standalone contributor mentions like "(thanks @username!)"
.replace(/\(thanks\s+@[^)]+\)\s*/g, "")
// Remove leftover "Thanks !" patterns
Copy link
Contributor

Choose a reason for hiding this comment

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

lol but I get it

* Collection of predefined prompt configurations for different use cases.
* Each configuration contains a template with placeholders for dynamic content.
*/
object SupportPromptConfigs {
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting that we are keeping these in Kotlin! It'd think we'd want all prompt stuff to live in our core host and this would just delegate?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, we have this for storybook! we could consolidate
apps/storybook/generated-theme-styles/dark-modern.css

Copy link
Contributor

Choose a reason for hiding this comment

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

wait, didn't I see this file already??

turbo.json Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

#nit maybe add anywhere but the end to avoid conflicts when / if roo changes this

@adamhill
Copy link
Contributor

adamhill commented Sep 4, 2025

@hassoncs I am convinced the plugin was heavily vibed by Copilot - when I looked at the branch list on GH back when I did my PR, there were dozens and dozens of copilot/xxxx branches in there.

But hey it works – we will just need lots of Kilo credits to work on it now.

Welcome to the new technical debt! :-P

@catrielmuller catrielmuller merged commit 984b5c4 into main Sep 4, 2025
12 checks passed
@catrielmuller catrielmuller deleted the catrielmuller/jetbrains branch September 4, 2025 19:25
Copy link

@khaled65442 khaled65442 left a comment

Choose a reason for hiding this comment

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

Uploading Generated Image September 03, 2025 - 1_45AM.jpeg…

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.

4 participants