-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vscode] Provide generic user goal request hook.
This allows extensions to register without having to modify ours; it should subsume previous hooks for `VIXZ` and `VIZCAR` visualizers. There are many more improvements we can do to this API. Fixes #538
- Loading branch information
Showing
6 changed files
with
88 additions
and
47 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Welcome to `coq-lsp` documentation | ||
|
||
For now this is just a stub, we will add more information here | ||
soon. You can find some useful documents here: | ||
|
||
- `coq-lsp` core [README](../../README.md) | ||
- `coq-lsp` [contributing guide](../../CONTRIBUTING.md) | ||
- `coq-lsp` users manual (upcoming) | ||
- [`coq-lsp` LSP Protocol Documentation](./PROTOCOL.md) | ||
- [VSCode client API documentation](./VSCODE_API.md) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Welcome to the developer documentation for the coq-lsp VSCode extension | ||
|
||
As of today, the extension provides two extensions for other | ||
developers to use: | ||
|
||
```typescript | ||
export interface CoqLspAPI { | ||
/** | ||
* Query goals from Coq | ||
*/ | ||
goalsRequest(params: GoalRequest): Promise<GoalAnswer<PpString>>; | ||
|
||
/** | ||
* Register callback action on user-initiated goals request | ||
*/ | ||
onUserGoals(fn: (goals: GoalAnswer<String>) => void): Disposable; | ||
} | ||
``` | ||
|
||
Types are for now in the `lib/types.ts` file, we would be happy to | ||
provide a separate package soon. | ||
|
||
## Querying goals from Coq: | ||
|
||
Use `goalsRequest` to perform your own queries to Coq, and handle the | ||
answer in your own extension. | ||
|
||
## Reacting to user demands for Goals: | ||
|
||
Alternatively, you can instead have `coq-lsp` call your code when the | ||
user request the goals. In order to register the callback, you can use | ||
the `onUserGoals` API function. | ||
|
||
Don't forget to dispose of your callback when your extension is | ||
de-activated. |