Elffuss BraidHub

kikocis/continue public

main · 1.2 KiBRenderedRawPermalink
1---
2name: New protocol message
3description: Create a new protocol message from core/gui/ide to core/gui/ide
4alwaysApply: false
5---
6
7Create a new protocol message by taking the following steps:
8
9## 1. Define the message type
10
11Add your new message type definition to the appropriate file in the `protocol/` directory with correct TypeScript typing.
12
13## 2. Check for duplicates
14
15Verify that no existing message type already provides the same functionality.
16
17## 3. Add to passThrough (if webview ↔ core)
18
19If your message is between webview and core, add it to `core/protocol/passThrough.ts`.
20
21## 4. Add to IntelliJ constants (if webview ↔ core)
22
23If your message is between webview and core, add it to `extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt`.
24
25## 5. Implement the message handler
26
27Implement the message in the appropriate location:
28
29- **Messages to core**: `core/core.ts`
30- **Messages to GUI**: `useWebviewListener` hook
31- **Messages to VS Code IDE**: `VsCodeMessenger.ts`
32- **Messages to JetBrains IDE**: `IdeProtocolClient.kt`
33
34## 6. Test the implementation
35
36Verify that your message works correctly in both VS Code and JetBrains IDEs if applicable.