From c99bd1eb1592a1603c5d2c4885e4ecb35d360e6b Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Mon, 27 May 2024 15:48:15 +0800 Subject: [PATCH] fix(vscode): fix position type convert. --- clients/tabby-agent/tsup.config.ts | 1 + clients/vscode/src/InlineCompletionProvider.ts | 5 ++++- clients/vscode/src/chat/ChatViewProvider.ts | 2 -- clients/vscode/src/lsp/WorkspaceFileSystemFeature.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/clients/tabby-agent/tsup.config.ts b/clients/tabby-agent/tsup.config.ts index 6ca5cff34a92..3427b4578bfe 100644 --- a/clients/tabby-agent/tsup.config.ts +++ b/clients/tabby-agent/tsup.config.ts @@ -84,6 +84,7 @@ export default defineConfig(async () => { outDir: "dist/browser", platform: "browser", format: "esm", + treeshake: "smallest", // Required for browser to cleanup fs related libs sourcemap: true, banner: { js: banner, diff --git a/clients/vscode/src/InlineCompletionProvider.ts b/clients/vscode/src/InlineCompletionProvider.ts index 6137bb75c786..eefd6bce1e6a 100644 --- a/clients/vscode/src/InlineCompletionProvider.ts +++ b/clients/vscode/src/InlineCompletionProvider.ts @@ -89,7 +89,10 @@ export class InlineCompletionProvider extends EventEmitter implements InlineComp textDocument: { uri: document.uri.toString(), }, - position, + position: { + line: position.line, + character: position.character, + }, }; let request: Promise | undefined = undefined; try { diff --git a/clients/vscode/src/chat/ChatViewProvider.ts b/clients/vscode/src/chat/ChatViewProvider.ts index b89e720fe3e2..772ffe238cb0 100644 --- a/clients/vscode/src/chat/ChatViewProvider.ts +++ b/clients/vscode/src/chat/ChatViewProvider.ts @@ -24,10 +24,8 @@ export class ChatViewProvider implements WebviewViewProvider { enableScripts: true, localResourceRoots: [extensionUri], }; - console.log("resolveWebviewView", { config: this.config.server }); webviewView.webview.html = this._getWebviewContent(this.config.server); this.config.on("updatedServerConfig", () => { - console.log("updatedServerConfig", { config: this.config.server }); webviewView.webview.html = this._getWebviewContent(this.config.server); }); diff --git a/clients/vscode/src/lsp/WorkspaceFileSystemFeature.ts b/clients/vscode/src/lsp/WorkspaceFileSystemFeature.ts index f2b2a192af7b..bfdfa165ed98 100644 --- a/clients/vscode/src/lsp/WorkspaceFileSystemFeature.ts +++ b/clients/vscode/src/lsp/WorkspaceFileSystemFeature.ts @@ -28,7 +28,7 @@ export class WorkspaceFileSystemFeature implements StaticFeature { initialize(): void { this.disposables.push( - this.client.onRequest(ReadFileRequest.method, async (params: ReadFileParams) => { + this.client.onRequest(ReadFileRequest.type, async (params: ReadFileParams) => { if (params.format !== "text") { return null; }