Skip to content

Commit

Permalink
Merge branch 'main' into feat/diag-annotations
Browse files Browse the repository at this point in the history
* main:
  Filter out non-quickfix actions in view (#2081)
  Fix crash on generating schema with mixed-type enum
  • Loading branch information
rchl committed Oct 11, 2022
2 parents 2230be5 + 18a533d commit 81870b8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
17 changes: 14 additions & 3 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
{
"caption": "LSP: Goto Diagnostic",
"command": "lsp_goto_diagnostic",
"args": {"uri": "$view_uri"}
"args": {
"uri": "$view_uri"
}
},
{
"caption": "LSP: Goto Diagnostic in Project",
Expand All @@ -107,11 +109,20 @@
"command": "lsp_symbol_rename"
},
{
"caption": "LSP: Run Code Action",
"caption": "LSP: Code Action",
"command": "lsp_code_actions"
},
{
"caption": "LSP: Run Source Action",
"caption": "LSP: Refactor…",
"command": "lsp_code_actions",
"args": {
"only_kinds": [
"refactor"
]
},
},
{
"caption": "LSP: Source Action…",
"command": "lsp_code_actions",
"args": {
"only_kinds": [
Expand Down
1 change: 1 addition & 0 deletions docs/src/keyboard_shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Refer to the [Customization section](customization.md#keyboard-shortcuts-key-bin
| Restart Server | unbound | `lsp_restart_server`
| Run Code Action | unbound | `lsp_code_actions`
| Run Code Lens | unbound | `lsp_code_lens`
| Run Refactor Action | unbound | `lsp_code_actions` (with args: `{"only_kinds": ["refactor"]}`)
| Run Source Action | unbound | `lsp_code_actions` (with args: `{"only_kinds": ["source"]}`)
| Signature Help | <kbd>ctrl</kbd> <kbd>alt</kbd> <kbd>space</kbd> | `lsp_signature_help_show`
| Toggle Diagnostics Panel | <kbd>ctrl</kbd> <kbd>alt</kbd> <kbd>m</kbd> | `lsp_show_diagnostics_panel`
Expand Down
8 changes: 7 additions & 1 deletion plugin/tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ def _preprocess_properties(translations: Optional[Dict[str, str]], properties: D
_preprocess_properties(translations, child_properties)


def _enum_to_str(value: Any) -> str:
if isinstance(value, str):
return '"{}"'.format(value)
return str(value)


class BasePackageNameInputHandler(sublime_plugin.TextInputHandler):

def initial_text(self) -> str:
Expand Down Expand Up @@ -185,7 +191,7 @@ def run(self, base_package_name: str) -> None:
has_default = "default" in v
default = v.get("default")
if isinstance(enum, list):
self.writeline4('// possible values: {}'.format(", ".join(enum)))
self.writeline4('// possible values: {}'.format(", ".join(map(_enum_to_str, enum))))
if has_default:
value = default
else:
Expand Down

0 comments on commit 81870b8

Please sign in to comment.