-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support installation of clangd server. #5
Conversation
This supports downloading the latest zip release from github (on supported platforms), extracting it within the extension's 'global storage', and running it from there. Several flows are supported: - install triggered via command palette - check for updates triggered via command palette - check for updates automatically on startup (OFF by default in this patch) - offer to install if we can't find clangd (ON by default in this patch)
Demo of install flow: https://dump.video/i/RSJf9j.mp4 I do want to work out how to make this testable, and may even reusable with coc.nvim. But wanted to get some feedback on the UI decisions and structure too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do want to work out how to make this testable, and may even reusable with coc.nvim. But wanted to get some feedback on the UI decisions and structure too.
The UI workflow looks great!
I just leave some nits on the code. Yeah, the concern is that the current code seems to be coupled with vscode UI, I think we can extract the code (at least the download & install bits) to a separate node module, so that it can be reused, and easier to write tests (I don't think there is an easy way to test the vscode UI bits, maybe we just leave them untested). And likely we will end up with storing the same clangd binary multiple times (e.g. storing clangd binary in a coc-specific/vscode-specific directory).
a603aa1
to
12a287a
Compare
(I'd still like to take a look at the structure to see how to make this reusable for coc and for testing) |
Verified isolation by using it with coc-clangd. Actual tests still to come.
Also has auto-update checks, but turned off by default for now. See: - Library with main logic: clangd/node-clangd@3ce82ac - PR for vscode-clangd: clangd/vscode-clangd#5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! the install code now is pretty clear.
} | ||
|
||
class UI { | ||
constructor(private context: vscode.ExtensionContext, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to say the parameters are unused, then realized the TS compiler will generate the class members for us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's weird syntax but pretty handy...
* Support installation of clangd binaries if not found. Also has auto-update checks, but turned off by default for now. See: - Library with main logic: clangd/node-clangd@3ce82ac - PR for vscode-clangd: clangd/vscode-clangd#5 * chore(package): bundle @clangd/install * feat(install): restart coc after download Co-authored-by: Heyward Fann <fannheyward@gmail.com> Co-authored-by: Heyward Fann <fannheyward@users.noreply.github.com>
This supports downloading the latest zip release from github (on
supported platforms), extracting it within the extension's 'global storage',
and running it from there.
Several flows are supported: