-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add skills for contributing commands and localization in VS Code extensions #557
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,21 @@ | ||
| --- | ||
| name: vscode-ext-commands | ||
| description: 'Guidelines for contributing commands in VS Code extensions. Indicates naming convention, visibility, localization and other relevant attributes, following VS Code extension develoment guidelines, libraries and good practices' | ||
alefragnani marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --- | ||
|
|
||
| # VS Code extension command contribution | ||
|
|
||
| This skill helps you to contribute commands in VS Code extensions | ||
|
|
||
| ## When to use this skill | ||
|
|
||
| Use this skill when you need to: | ||
| - Add or update commands to your VS Code extension | ||
|
|
||
| # Instructions | ||
|
|
||
| VS Code commands must always define a `title`, independent of its category, visibility or location. We use a few patterns for each "kind" of command, with some characteristics, described below: | ||
|
|
||
| * Regular commands: By default, all commands should be accessible in the Command Palette, must define a `category`, and don't need an `icon`, unless the command will be used in the Side Bar. | ||
|
|
||
| * Side Bar commands: It's name follow a special pattern, starting with underscore (`_`) and suffixed with `#sideBar`, like `_extensionId.someCommand#sideBar` for instance. Must define an `icon`, and may or may not have some rule for `enablement`. Side Bar exclusive commands should not be visible in the Command Palette. Contributing it to the `view/title` or `view/item/context`, we must inform _order/position_ that it will be displayed, and we can use terms "relative to other command/button" in order to you identify the correct `group` to be used. Also, it's a good practice define the condition (`when`) for the new command is visible. | ||
alefragnani marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
alefragnani marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or 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,25 @@ | ||
| --- | ||
| name: vscode-ext-localization | ||
| description: 'Guidelines for proper localization of VS Code extensions, following VS Code extension development guidelines, libraries and good practices' | ||
| --- | ||
|
|
||
| # VS Code extension localization | ||
|
|
||
| This skill helps you localize every aspect of VS Code extensions | ||
|
|
||
| ## When to use this skill | ||
|
|
||
| Use this skill when you need to: | ||
| - Localize new or existing contributed configurations (settings), commands, menus, views or walkthroughs | ||
| - Localize new or existing messages or other string resources contained in extension source code, that are used displayed to end user | ||
alefragnani marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Instructions | ||
|
|
||
| VS Code localization is composed by three different approaches, depending on the resource that is being localized. When a new localizable resource is created or updated, the corresponding localization for all currently available languages must be created/updated. | ||
|
|
||
| 1. Configurations like Settings, Commands, Menus, Views, ViewsWelcome, Walkthrough Titles and Descriptions, defined in `package.json` | ||
| -> An exclusive `package.nls.LANGID.json` file, like `package.nls.pt-br.json` of Brazilian Portuguese (`pt-br`) localization | ||
| 2. Walkthough content (defined in its own `Markdown` files) | ||
alefragnani marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| -> An exclusive `Markdown` file like `walkthrough/someStep.pt-br.md` for Brazilian Portuguese localization | ||
| 3. Messages and string located in extension source code (JavaScript or TypeScript files) | ||
| -> An exclusive `bundle.l10n.pt-br.json` for Brazilian Portuguese localization | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.