Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vscode] Read args from keybindings #9126 #9372

Merged
merged 1 commit into from
Apr 21, 2021

Conversation

xcariba
Copy link
Contributor

@xcariba xcariba commented Apr 18, 2021

What it does

Reads and stores args from keybindings field from package.json

How to test

Initialize a vscode extension following https://code.visualstudio.com/api/get-started/your-first-extension
Add a shortcut in extension's package.json:

	 "contributes": {
		"keybindings": [
			{
				"command": "type",
				"args": {
                                	 "text": "test"
                                },
				"key": "alt+7",
                                "when": "editorTextFocus"
			}
		]
	}

Install extension.
Open text editor on any file, be shure that cursor is located somewhere in file and fire alt+7 in text editor.
It should insert "test" text on selection.

Review checklist

Reminder for reviewers

@vince-fugnitto vince-fugnitto added keybindings issues related to keybindings vscode issues related to VSCode compatibility labels Apr 19, 2021
@@ -718,6 +722,8 @@ export interface Keybinding {
mac?: string;
linux?: string;
win?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
args?: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a PR to remove the duplicated interface #9374
Please remove this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@RomanNikitenko
Copy link
Contributor

The changes look good to me!

I added the example from the How to test section to my test extension
It works well:

keybindings_args

@xcariba
please take a look #9372 (review)

@RomanNikitenko
Copy link
Contributor

I'm going to merge the PR in the evening if there are no objections

@RomanNikitenko RomanNikitenko merged commit 82c2bc4 into eclipse-theia:master Apr 21, 2021
@vince-fugnitto vince-fugnitto added this to the 1.13.0 milestone Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keybindings issues related to keybindings vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants