-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extension: first cut of lsp-aware extension
This gives the vscode-cue extension the basic capabilities to start an instance of 'cue lsp'. The code is heavily commented to: * caveat my poor handle on TypeScript; * explain the code structure of the extension; * capture my understanding and assumptions about the behaviour of VSCode and an extension instance in relation to a running LSP server; * state opinions/assumptions about error handling style in code. * state understanding about the best method of handling runtime errors, and how/when to report those to the user. The bulk of the changes sit within src/main.ts: * The extension creates a LanguageClient instance which is the bridge between a running 'cue lsp' instance (which it, the LanguageClient starts) and a VSCode window. * We use output channels for more clear logging of info and errors. * We establish a clearer policy on when to notify the end user of errors via showErrorMessage. * We handle runtime configuration changes of an extension instance. There are various other helper functions, types etc in support of these changes. At an extension configuration level this change: * Exposes two additional commands: start CUE LSP, stop CUE LSP; * aligns the engine version required by the extension with the npm dependency on the VSCode types; * sets an explicit activation event of 'onLanguage:cue', so an instance of the extension is created whenever a CUE file is opened. Note the comment 'Extension instances and configuration' on caveats in this space; * exposes the extension's configuration schema as a JSON Schema. A TODO captures moving this to CUE when we can (noting that we also need to code generate TypeScript ultimately, as well as runtime unifying a configuration value with some documented defaults). We also add various npm dependencies required by the code changes described above. Note that this change does not include any tests. This is intentional however undesirable. Adding end-to-end tests will follow later. For now, testing is limited to offline running through various scenarios using VSCode. The scenarios covered are documented in testing.md. Signed-off-by: Paul Jolly <[email protected]> Change-Id: I6a1879a603ff2db693f045d26fe14018c01c6332 Reviewed-on: https://review.gerrithub.io/c/cue-lang/vscode-cue/+/1201041 Reviewed-by: Matthew Sackman <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information
Showing
9 changed files
with
950 additions
and
45 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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.