Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class UI {
coc.window.showMessage(`Reusing existing ${release} installation in ${this.storagePath}`);
return true;
}
async promptDelete(path: string) : Promise<boolean|undefined> {
coc.window.showMessage(`Deleting previous clangd installation in ${path}`);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure what the best behavior is here: for vscode we'll prompt and let the user choose delete/keep/dismiss: https://github.com/clangd/vscode-clangd/pull/288/files#diff-66f6667b405ea9ee158525b6f12729e879388bcc95af6a683118aceb012685b0

coc-clangd mostly does the preferred option silently so far.
I'd be happy with delete+log, keep+log, or coc.window.showPrompt(). Modal dialogs are annoying, though...

return true;
}
async promptReload() {
await coc.commands.executeCommand('editor.action.restart');
}
Expand All @@ -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.
Expand Down