clangd / vscode-clangd

Visual Studio Code extension for clangd
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
MIT License
592 stars 97 forks source link

Write tests for the clangd.restart command #602

Open HighCommander4 opened 3 months ago

HighCommander4 commented 3 months ago

The clangd.restart command does not have any test coverage.

We should write some tests to help ensure that regressions like #599 are caught before release.

HighCommander4 commented 3 months ago

I looked a bit at how we might write tests for clangd.restart, and in particular looked at the sinon mocking library used in our inactive regions tests.

However, the code implementing the clangd.restart command is found in activate() (i.e. the extension's entry point), and my TS-fu is not quite strong enough to figure out how to mock out enough things to invoke that function in a test environment.

If perhaps someone is interested in helping with this, please let me know.