Skip to content

Commit 05f8eb9

Browse files
committed
standardize on POST /webview/
1 parent fb28f82 commit 05f8eb9

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

jetbrains/src/main/kotlin/com/boundaryml/jetbrains_ext/BamlLanguageClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class BamlLanguageClient(project: Project) :
138138

139139
private fun sendCursorNotification(port: Int, payload: CursorNotificationPayload) {
140140
try {
141-
val webviewUrl = "http://localhost:$port/ide/SEND_LSP_NOTIFICATION_TO_WEBVIEW"
141+
val webviewUrl = "http://localhost:$port/webview/SEND_LSP_NOTIFICATION_TO_WEBVIEW"
142142
val jsonBody = json.encodeToString(CursorNotificationPayload.serializer(), payload)
143143

144144
log.debug("Sending cursor notification to $webviewUrl: $jsonBody")

typescript/packages/playground-common/src/baml_wasm_web/EventListener.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ export const EventListener: React.FC = () => {
344344
break;
345345

346346
case 'lsp_message':
347+
// TODO(sam): this is only textDocument/codeAction right now, but we want to add the others here (e.g. runtime_updated)
347348
console.debug('lsp_message', content);
348349

349350
const fileName = content.params.textDocument.uri.replace('file://', '');

typescript/packages/playground-common/src/shared/baml-project-panel/vscode.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import {
1818
type SendLspNotificationToIdeRequest,
1919
type SendLspNotificationToIdeResponse,
2020
decodeBuffer,
21-
JumpToFileRequest,
22-
JumpToFileResponse,
21+
type JumpToFileRequest,
22+
type JumpToFileResponse,
2323
} from './vscode-rpc';
2424

2525
// Define WebviewApi type for VSCode webview context
@@ -195,7 +195,7 @@ class VSCodeAPIWrapper {
195195
// server to forward our notification to the IDE.
196196
private async sendLspNotification({method, params}: {method: string, params: Record<string, any>}) {
197197
await this.rpc<SendLspNotificationToIdeRequest, SendLspNotificationToIdeResponse>({
198-
vscodeCommand: 'SEND_LSP_NOTIFICATION',
198+
vscodeCommand: 'SEND_LSP_NOTIFICATION_TO_IDE',
199199
notification: {
200200
method,
201201
params,
@@ -396,7 +396,7 @@ class VSCodeAPIWrapper {
396396
private async httpPostRpc<TRequest, TResponse>(data: TRequest): Promise<TResponse> {
397397
const command = (data as unknown as { vscodeCommand: string }).vscodeCommand;
398398

399-
const response = await fetch(`/ide/${command}`, {
399+
const response = await fetch(`/webview/${command}`, {
400400
method: 'POST',
401401
headers: {
402402
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)