Elffuss BraidHub

kikocis/continue public

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