-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extension: check cueCommand path at config change time
Move the sanity check for the cueCommand value to the config change handler. Moving this check here ensures that we can assert that after a config change event, we can safely rely (in a happy path case) that the value of cueCommand can be used, i.e. that it is a simple relative or absolute path. The binary might still fail to resolve/exist but we handle that at each call site. In case we don't have a valid cueCommand value as a result of this check, unconditionally stop the LSP. It will be started again when the user provides a valid config value. Also update the error handling approach in extensionConfigurationChange. Because the caller of the handler does not handle a rejected promise, we were swallowing errors. Switch instead to use a new helper method showErrorMessage, which provides a void wrapper around vscode.window.showErrorMessage. Also provide and use a helper method absCueCommand which resolves the cueCommand config value to an absolute path. This is used for now in startCueLsp, but will also be used in later CLs. Signed-off-by: Paul Jolly <[email protected]> Change-Id: Ifd6ded2b0006cf6ce8930dc75eb65276eef25da0 Reviewed-on: https://review.gerrithub.io/c/cue-lang/vscode-cue/+/1206539 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information
Showing
1 changed file
with
87 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters