From 4290c59e9466db1fe4d5a64ebca5da27da54e796 Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Thu, 4 Jul 2024 11:58:06 +0800 Subject: [PATCH] chore: remove outdated example-vscode-lsp project. (#2575) * chore: remove outdated vscode lsp example project. * chore: update pnpm-lock. * chore: update README of outdated vscode-lsp-example project. --- clients/example-vscode-lsp/.gitattributes | 1 - clients/example-vscode-lsp/.gitignore | 3 - clients/example-vscode-lsp/README.md | 13 ++-- clients/example-vscode-lsp/demo.png | 3 - clients/example-vscode-lsp/package.json | 26 -------- clients/example-vscode-lsp/src/extension.ts | 37 ----------- clients/example-vscode-lsp/tsconfig.json | 10 --- clients/example-vscode-lsp/tsup.config.ts | 30 --------- pnpm-lock.yaml | 68 --------------------- 9 files changed, 5 insertions(+), 186 deletions(-) delete mode 100644 clients/example-vscode-lsp/.gitattributes delete mode 100644 clients/example-vscode-lsp/.gitignore delete mode 100644 clients/example-vscode-lsp/demo.png delete mode 100644 clients/example-vscode-lsp/package.json delete mode 100644 clients/example-vscode-lsp/src/extension.ts delete mode 100644 clients/example-vscode-lsp/tsconfig.json delete mode 100644 clients/example-vscode-lsp/tsup.config.ts diff --git a/clients/example-vscode-lsp/.gitattributes b/clients/example-vscode-lsp/.gitattributes deleted file mode 100644 index c091529f367f..000000000000 --- a/clients/example-vscode-lsp/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.png filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/clients/example-vscode-lsp/.gitignore b/clients/example-vscode-lsp/.gitignore deleted file mode 100644 index d2703e4fe658..000000000000 --- a/clients/example-vscode-lsp/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -dist -*.vsix diff --git a/clients/example-vscode-lsp/README.md b/clients/example-vscode-lsp/README.md index 4573d6e41545..a89eaaf66e23 100644 --- a/clients/example-vscode-lsp/README.md +++ b/clients/example-vscode-lsp/README.md @@ -1,9 +1,6 @@ -# Example VSCode client for Tabby agent (LSP) +This example has been outdated and removed. -This is an example of a VSCode extension for the Tabby agent. It runs the Tabby agent as a language server and creates a client connecting to it. - -![Demo](./demo.png) - -For more information about Tabby agent, please refer to [Tabby agent](https://github.com/TabbyML/tabby/tree/main/clients/tabby-agent). - -For more information about developing a VSCode LSP extension, please refer to [VSCode Language Extensions Guide](https://code.visualstudio.com/api/language-extensions/overview). +As of tabby-agent v1.7, the Language Server Protocol (LSP) has become the only supported method to connect to tabby-agent. +For examples of creating IDE extensions that connect with tabby-agent using LSP, please refer to the source code of our IDE extensions: +- [VSCode Extension](https://github.com/TabbyML/tabby/tree/main/clients/vscode) +- [IntelliJ Platform Plugin](https://github.com/TabbyML/tabby/tree/main/clients/intellij) diff --git a/clients/example-vscode-lsp/demo.png b/clients/example-vscode-lsp/demo.png deleted file mode 100644 index 2bec013800ca..000000000000 --- a/clients/example-vscode-lsp/demo.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:542a3e013ee260fc455eeae21c374f98fa2471186f737c6b535f147eb10ffe6f -size 66601 diff --git a/clients/example-vscode-lsp/package.json b/clients/example-vscode-lsp/package.json deleted file mode 100644 index dcc015f064a5..000000000000 --- a/clients/example-vscode-lsp/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "example-vscode-tabby-lsp-client", - "description": "Example VSCode client for Tabby agent (LSP).", - "publisher": "TabbyML", - "version": "0.0.1", - "engines": { - "vscode": "^1.82.0" - }, - "main": "./dist/extension.js", - "activationEvents": [ - "onLanguage" - ], - "scripts": { - "build": "tsup --minify", - "watch": "tsup --watch ./ --ignore-watch ./dist" - }, - "devDependencies": { - "@types/vscode": "^1.82.0", - "esbuild-plugin-copy": "^2.1.1", - "tabby-agent": "1.5.0", - "tsup": "^7.1.0" - }, - "dependencies": { - "vscode-languageclient": "^9.0.1" - } -} diff --git a/clients/example-vscode-lsp/src/extension.ts b/clients/example-vscode-lsp/src/extension.ts deleted file mode 100644 index 675cbee3ee0c..000000000000 --- a/clients/example-vscode-lsp/src/extension.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { ExtensionContext } from "vscode"; -import { LanguageClient, ServerOptions, TransportKind } from "vscode-languageclient/node"; - -let client: LanguageClient; - -export async function activate(context: ExtensionContext): Promise { - console.debug("Tabby LSP Example: activate"); - - const serverModulePath = context.asAbsolutePath("dist/server/tabby-agent.js"); - const serverOptions: ServerOptions = { - run: { - module: serverModulePath, - args: ["--lsp"], - transport: TransportKind.ipc, - }, - debug: { - module: serverModulePath, - args: ["--lsp"], - transport: TransportKind.ipc, - }, - }; - const clientOptions = { - documentSelector: [{ pattern: "**/*" }], - }; - if (!client) { - client = new LanguageClient("Tabby LSP Example", serverOptions, clientOptions); - } - return await client.start(); -} - -export async function deactivate(): Promise { - console.debug("Tabby LSP Example: deactivate"); - - if (client) { - return await client.stop(); - } -} diff --git a/clients/example-vscode-lsp/tsconfig.json b/clients/example-vscode-lsp/tsconfig.json deleted file mode 100644 index 954a4cc3f267..000000000000 --- a/clients/example-vscode-lsp/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "ES2020", - "lib": ["ES2020"], - "sourceMap": true, - "strict": true - }, - "include": ["./src"] -} diff --git a/clients/example-vscode-lsp/tsup.config.ts b/clients/example-vscode-lsp/tsup.config.ts deleted file mode 100644 index 1efa0a2b4ecb..000000000000 --- a/clients/example-vscode-lsp/tsup.config.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { defineConfig } from "tsup"; -import { copy } from "esbuild-plugin-copy"; -import { dependencies } from "./package.json"; - -export default () => [ - defineConfig({ - name: "node", - entry: ["src/extension.ts"], - outDir: "dist", - platform: "node", - target: "node18", - external: ["vscode"], - noExternal: Object.keys(dependencies), - clean: true, - esbuildPlugins: [ - copy({ - assets: [ - { - from: "../tabby-agent/dist/cli.js", - to: "./server/tabby-agent.js", - }, - { - from: "../tabby-agent/dist/wasm/*", - to: "./server/wasm", - }, - ], - }), - ], - }), -]; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 053257d24424..6781d3aee3b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,25 +12,6 @@ importers: specifier: ^1.13.3 version: 1.13.3 - clients/example-vscode-lsp: - dependencies: - vscode-languageclient: - specifier: ^9.0.1 - version: 9.0.1 - devDependencies: - '@types/vscode': - specifier: ^1.82.0 - version: 1.89.0 - esbuild-plugin-copy: - specifier: ^2.1.1 - version: 2.1.1(esbuild@0.19.12) - tabby-agent: - specifier: 1.5.0 - version: 1.5.0 - tsup: - specifier: ^7.1.0 - version: 7.3.0(@swc/core@1.3.101)(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.3.101)(typescript@5.4.5))(typescript@5.4.5) - clients/intellij: devDependencies: tabby-agent: @@ -9522,23 +9503,6 @@ packages: resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} engines: {node: '>=0.6.x'} - tsup@7.3.0: - resolution: {integrity: sha512-Ja1eaSRrE+QarmATlNO5fse2aOACYMBX+IZRKy1T+gpyH+jXgRrl5l4nHIQJQ1DoDgEjHDTw8cpE085UdBZuWQ==} - engines: {node: '>=18'} - deprecated: Breaking node 16 - hasBin: true - peerDependencies: - '@swc/core': ^1 - postcss: ^8.4.12 - typescript: '>=4.5.0' - peerDependenciesMeta: - '@swc/core': - optional: true - postcss: - optional: true - typescript: - optional: true - tsup@8.0.2: resolution: {integrity: sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ==} engines: {node: '>=18'} @@ -19382,14 +19346,6 @@ snapshots: postcss: 8.4.38 ts-node: 10.9.2(@swc/core@1.3.101)(@types/node@18.19.33)(typescript@5.4.5) - postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.3.101)(typescript@5.4.5)): - dependencies: - lilconfig: 3.1.1 - yaml: 2.4.2 - optionalDependencies: - postcss: 8.4.38 - ts-node: 10.9.2(@swc/core@1.3.101)(@types/node@18.19.33)(typescript@5.4.5) - postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2): dependencies: lilconfig: 3.1.1 @@ -21112,30 +21068,6 @@ snapshots: tsscmp@1.0.6: {} - tsup@7.3.0(@swc/core@1.3.101)(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.3.101)(typescript@5.4.5))(typescript@5.4.5): - dependencies: - bundle-require: 4.1.0(esbuild@0.19.12) - cac: 6.7.14 - chokidar: 3.6.0 - debug: 4.3.4(supports-color@8.1.1) - esbuild: 0.19.12 - execa: 5.1.1 - globby: 11.1.0 - joycon: 3.1.1 - postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.3.101)(typescript@5.4.5)) - resolve-from: 5.0.0 - rollup: 4.17.2 - source-map: 0.8.0-beta.0 - sucrase: 3.35.0 - tree-kill: 1.2.2 - optionalDependencies: - '@swc/core': 1.3.101(@swc/helpers@0.5.2) - postcss: 8.4.38 - typescript: 5.4.5 - transitivePeerDependencies: - - supports-color - - ts-node - tsup@8.0.2(@swc/core@1.3.101)(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.3.101)(@types/node@18.19.33)(typescript@5.3.3))(typescript@5.3.3): dependencies: bundle-require: 4.1.0(esbuild@0.19.12)