aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-25 08:14:43 +0100
committerGitHub <[email protected]>2020-05-25 08:14:43 +0100
commit1527feb744c7911b6ca482554f0399d3ef0ebfdc (patch)
tree7393ee6defa8951afafe90f0c180e7c0f4f1db70 /editors/code/src/commands
parentfbb8b884a2dbc3ced720c84f4604466e223f6d69 (diff)
parent5dab5e737909532e4a65390541393af6ee72f65b (diff)
Merge #4601
4601: Introduce `toggle inlay hints` vscode command r=matklad a=Veetaha Users now can assign a shortcut for this command via the general vscode keybindings ui or `keybindings.json` file <details> <summary>Demo</summary> ![demo](https://user-images.githubusercontent.com/36276403/82768941-b4fd1c80-9e3a-11ea-9d5b-a40fa1e4dbc6.gif) </details> <details> <summary>Howto assign a shortcut</summary> ![demo2](https://user-images.githubusercontent.com/36276403/82769350-c8a98280-9e3c-11ea-8a95-1266a539826d.gif) </details> Closes: #4599 Co-authored-by: veetaha <[email protected]>
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r--editors/code/src/commands/index.ts1
-rw-r--r--editors/code/src/commands/toggle_inlay_hints.ts11
2 files changed, 12 insertions, 0 deletions
diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts
index abb53a248..c2a232d5f 100644
--- a/editors/code/src/commands/index.ts
+++ b/editors/code/src/commands/index.ts
@@ -16,6 +16,7 @@ export * from './expand_macro';
16export * from './runnables'; 16export * from './runnables';
17export * from './ssr'; 17export * from './ssr';
18export * from './server_version'; 18export * from './server_version';
19export * from './toggle_inlay_hints';
19 20
20export function collectGarbage(ctx: Ctx): Cmd { 21export function collectGarbage(ctx: Ctx): Cmd {
21 return async () => ctx.client.sendRequest(ra.collectGarbage, null); 22 return async () => ctx.client.sendRequest(ra.collectGarbage, null);
diff --git a/editors/code/src/commands/toggle_inlay_hints.ts b/editors/code/src/commands/toggle_inlay_hints.ts
new file mode 100644
index 000000000..7606af8d0
--- /dev/null
+++ b/editors/code/src/commands/toggle_inlay_hints.ts
@@ -0,0 +1,11 @@
1import * as vscode from 'vscode';
2import { Ctx, Cmd } from '../ctx';
3
4export function toggleInlayHints(ctx: Ctx): Cmd {
5 return async () => {
6 await vscode
7 .workspace
8 .getConfiguration(`${ctx.config.rootSection}.inlayHints`)
9 .update('enable', !ctx.config.inlayHints.enable, vscode.ConfigurationTarget.Workspace);
10 };
11}