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", 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.