From f2418dc7e2546a108236cb243fa4b02f60cac3b1 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Tue, 25 Jan 2022 22:12:45 +0100 Subject: [PATCH 1/2] Delete old clangd installation after installing a new one. --- src/install.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/install.ts b/src/install.ts index b1b3318..56ebfb7 100644 --- a/src/install.ts +++ b/src/install.ts @@ -29,6 +29,10 @@ class UI { coc.window.showMessage(`Reusing existing ${release} installation in ${this.storagePath}`); return true; } + async promptDelete(path: string) : Promise { + coc.window.showMessage(`Deleting previous clangd installation in ${path}`); + return true; + } async promptReload() { await coc.commands.executeCommand('editor.action.restart'); } @@ -51,6 +55,12 @@ class UI { set clangdPath(p: string) { this.config.update('path', p.replace(homedir(), '~'), /*isUser=*/ true); } + get cleanupPath(): string|undefined { + return this.context.globalState.get('clangd.install.cleanupPath'); + } + set cleanupPath(p: string|undefined) { + this.context.globalState.update('clangd.install.cleanupPath', p); + } } // Returns the clangd path to use, or null if clangd is not installed. From a7ca01ed53ac25ac59f2a494f78b08f03179d57f Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Tue, 25 Jan 2022 22:15:19 +0100 Subject: [PATCH 2/2] Depend on required version of @clangd/install --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2839028..0ecd3b8 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "prepare": "node esbuild.js" }, "devDependencies": { - "@clangd/install": "^0.1.4", + "@clangd/install": "^1.0.0", "@types/node": "12.12.0", "@types/which": "^2.0.0", "@typescript-eslint/eslint-plugin": "^5.0.0",