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

Commands: Add support for the platform key #332

Merged
merged 6 commits into from
Feb 3, 2021

Conversation

Ultra-Instinct-05
Copy link
Contributor

This PR

  1. Adds support for the platform key in .sublime-commands introduced in Build 4094 to support platform specific entries in the command palette.
  2. Added completions for platform names.

This is essentially just a copy of what exists for the .sublime-menu file (Both the contexts and the completions). Maybe we need a way to reuse them ?

This commit adds support for highlighting the platform key in
sublime-commands file. Just used the contexts available in sublime-menu
syntax file.
This commit adds completions for the platform names in sublime-commands
file. Just copied the one used for menu files.
Copy link
Member

@FichteFoll FichteFoll left a comment

Choose a reason for hiding this comment

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

Thanks, just a few minor issues. Also, could you add a test, please?

Having platform matching twice is fine for me. While they are similar, I wouldn't say one is referencing the other and they are just using the same concept. We also wouldn't be able to use the correct scope suffix.

@FichteFoll FichteFoll added this to the 3.3.2 milestone Jan 31, 2021
@Ultra-Instinct-05
Copy link
Contributor Author

@FichteFoll regarding the tests, I wanted to add them but it seems the test file is a .json file. Does that mean I have to manually add the .sublime- specific scopes ?

@FichteFoll
Copy link
Member

I don't understand the question regarding the test file? The file works like any other, but does not have the .sublime-commands extension so it isn't picked up by ST as a resource file.

@Ultra-Instinct-05
Copy link
Contributor Author

it isn't picked up by ST as a resource file.

That makes sense, but what I am saying is suppose I have the "platform" in the syntax_test_commands.json and use PD to ^ and get the scope completions. It completes it as meta.sequence.json meta.mapping.key.json string.quoted.double.json rather than keyword.other.main.sublime-commands (so the .sublime- specific scopes are missing). I was wondering if I am doing something wrong.

@FichteFoll
Copy link
Member

Did you set the file to use the correct syntax?

Add tests for the new platform key addition.
Remove non needed comments from command & menu syntax.
Correct incorrect scopes for command & menu syntax.
@FichteFoll FichteFoll changed the title [ST4] Add support for the platform key in sublime commands file. Commands: Add support for the platform key Feb 3, 2021
@FichteFoll FichteFoll merged commit 3f858fd into SublimeText:master Feb 3, 2021
@FichteFoll
Copy link
Member

I realized that the invalid scope probably makes the experience while typing quite uncomfortable and will likely tame that to a generic string instead.

@Ultra-Instinct-05 Ultra-Instinct-05 deleted the platform_key branch February 4, 2021 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants