From acb08272459732739a9acfda49169969e769e030 Mon Sep 17 00:00:00 2001 From: Keisuke KATO Date: Mon, 7 Nov 2016 22:39:14 +0900 Subject: [PATCH] fixed #23 (#25) --- README.md | 9 ++-- package.json | 78 ++++++++++++++++++----------------- src/package-with-comment.json | 69 +++++++++++++++++-------------- 3 files changed, 83 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index 6d148f0..d117eb6 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ alt+q | ctrl+shift+q | Context info | N/A alt+enter | alt+enter | Show intention actions and quick-fixes | ✅ ctrl+y | cmd+backspace | Delete line at caret | ✅ ctrl+alt+l | cmd+alt+l | Reformat code | ✅ +ctrl+alt+l | cmd+alt+l | Reformat selected code | ✅ ctrl+alt+o | ctrl+alt+o | Optimize imports | N/A ctrl+alt+i | ctrl+alt+i | Auto-indent line(s) | N/A tab | tab | Indent selected lines | N/A @@ -143,8 +144,8 @@ ctrl+shift+h | cmd+shift+h | Method hierarchy | N/A ctrl+alt+h | ctrl+alt+h | Call hierarchy | N/A f2 | f2 | Next highlighted error | N/A shift+f2 | shift+f2 | Previous highlighted error | N/A -f4 | f4 | Edit source | N/A -ctrl+enter | cmd+down | View source | N/A +f4 | f4 | Edit source | ✅ +ctrl+enter | cmd+down | View source | ✅ alt+home | alt+home | Show navigation bar | N/A f11 | f3 | Toggle bookmark | N/A ctrl+f11 | alt+f3 | Toggle bookmark with mnemonic | N/A @@ -219,8 +220,8 @@ shift+ctrl+enter | shift+cmd+enter | Start new line | ✅ 1. Install Visual Studio Code 1.6.0 or higher 1. Launch Code 1. From the command palette `Ctrl`-`Shift`-`P` (Windows, Linux) or `Cmd`-`Shift`-`P` (macOS) -1. Select `Install Extension` -1. Choose the extension '`intellij-idea-keybindings`' *or* run `ext install intellijkeybind` +1. Select `Extensions: Install Extension` +1. Choose the extension '`intellij-idea-keybindings`' 1. Reload Visual Studio Code diff --git a/package.json b/package.json index dd4ea31..32e1975 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "intellij-idea-keybindings", - "version": "0.1.9", + "version": "0.1.10", "publisher": "k--kato", "engines": { "vscode": "1.6.x" @@ -52,7 +52,7 @@ "key": "ctrl+space", "mac": "ctrl+space", "command": "editor.action.triggerSuggest", - "when": "editorTextFocus", + "when": "editorHasCompletionItemProvider && editorTextFocus && !editorReadonly", "intellij": "Basic code completion (the name of any class, method or variable)" }, @@ -75,7 +75,7 @@ "key": "ctrl+p", "mac": "cmd+p", "command": "editor.action.triggerParameterHints", - "when": "editorTextFocus", + "when": "editorHasSignatureHelpProvider && editorTextFocus", "intellij": "Parameter info (within method call arguments)" }, @@ -159,25 +159,25 @@ "key": "ctrl+/", "mac": "cmd+/", "command": "editor.action.commentLine", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Comment/uncomment with line comment" }, { "key": "ctrl+numpad_divide", "mac": "cmd+numpad_divide", "command": "editor.action.commentLine", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Comment/uncomment with line comment" }, { "key": "ctrl+alt+/", "mac": "cmd+alt+/", "command": "editor.action.blockComment", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Comment/uncomment with block comment" }, { "key": "ctrl+alt+numpad_divide", "mac": "cmd+alt+numpad_divide", "command": "editor.action.blockComment", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Comment/uncomment with block comment" }, { "key": "ctrl+w", @@ -206,7 +206,7 @@ "key": "alt+enter", "mac": "alt+enter", "command": "editor.action.quickFix", - "when": "editorTextFocus", + "when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly", "intellij": "Show intention actions and quick-fixes" }, { "key": "ctrl+y", @@ -217,9 +217,15 @@ }, { "key": "ctrl+alt+l", "mac": "cmd+alt+l", - "command": "editor.action.format", - "when": "editorTextFocus", + "command": "editor.action.formatDocument", + "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly", "intellij": "Reformat code" + }, { + "key": "ctrl+alt+l", + "mac": "cmd+alt+l", + "command": "editor.action.formatSelection", + "when": "editorHasDocumentFormattingProvider && editorHasSelection && editorTextFocus && !editorReadonly", + "intellij": "Reformat selected code" }, @@ -263,7 +269,7 @@ "key": "ctrl+x", "mac": "cmd+x", "command": "editor.action.clipboardCutAction", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Cut current line or selected block to clipboard" }, { "key": "ctrl+c", @@ -275,7 +281,7 @@ "key": "ctrl+v", "mac": "cmd+v", "command": "editor.action.clipboardPasteAction", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Paste from clipboard" }, @@ -292,13 +298,13 @@ "key": "ctrl+d", "mac": "cmd+d", "command": "editor.action.copyLinesDownAction", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Duplicate current line or selected block" }, { "key": "ctrl+backspace", "mac": "cmd+backspace", "command": "deleteAllRight", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Delete line at caret" }, @@ -315,13 +321,13 @@ "key": "ctrl+enter", "mac": "cmd+enter", "command": "lineBreakInsert", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Smart line split" }, { "key": "shift+enter", "mac": "shift+enter", "command": "editor.action.insertLineAfter", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Start new line" }, @@ -358,13 +364,13 @@ "key": "ctrl+delete", "mac": "alt+delete", "command": "deleteWordLeft", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Delete to word end" }, { "key": "ctrl+backspace", "mac": "alt+backspace", "command": "deleteWordRight", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Delete to word start" }, @@ -484,7 +490,7 @@ "key": "alt+f7", "mac": "alt+f7", "command": "editor.action.referenceSearch.trigger", - "when": "editorTextFocus", + "when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor", "intellij": "Find usages" }, @@ -754,7 +760,7 @@ "key": "ctrl+b", "mac": "cmd+b", "command": "editor.action.goToDeclaration", - "when": "editorTextFocus", + "when": "editorHasDefinitionProvider && editorTextFocus", "intellij": "Go to declaration" }, @@ -771,15 +777,8 @@ "key": "ctrl+shift+i", "mac": "alt+space", "command": "editor.action.previewDeclaration", - "when": "editorTextFocus", + "when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor", "intellij": "Open quick definition lookup" - }, { - "key": "ctrl+shift+b", - "mac": "ctrl+shift+b", - "command": "editor.action.goToTypeDeclaration", - "when": "editorTextFocus", - "intellij": "Go to type declaration", - "todo": "not working" }, @@ -899,14 +898,19 @@ - - - - - - - - + { + "key": "f4", + "mac": "f4", + "command": "editor.action.goToDeclaration", + "when": "editorHasDefinitionProvider && editorTextFocus", + "intellij": "Edit source" + }, { + "key": "ctrl+enter", + "mac": "cmd+down", + "command": "editor.action.goToDeclaration", + "when": "editorHasDefinitionProvider && editorTextFocus", + "intellij": "View source" + }, @@ -991,7 +995,7 @@ "key": "shift+f6", "mac": "shift+f6", "command": "editor.action.rename", - "when": "editorTextFocus", + "when": "editorHasRenameProvider && editorTextFocus && !editorReadonly", "intellij": "Rename" }, diff --git a/src/package-with-comment.json b/src/package-with-comment.json index 447b5bc..900b83a 100644 --- a/src/package-with-comment.json +++ b/src/package-with-comment.json @@ -1,6 +1,6 @@ { "name": "intellij-idea-keybindings", - "version": "0.1.9", + "version": "0.1.10", "publisher": "k--kato", "engines": { "vscode": "1.6.x" @@ -54,7 +54,7 @@ "key": "ctrl+space", "mac": "ctrl+space", "command": "editor.action.triggerSuggest", - "when": "editorTextFocus", + "when": "editorHasCompletionItemProvider && editorTextFocus && !editorReadonly", "intellij": "Basic code completion (the name of any class, method or variable)" }, /* @@ -78,7 +78,7 @@ "key": "ctrl+p", "mac": "cmd+p", "command": "editor.action.triggerParameterHints", - "when": "editorTextFocus", + "when": "editorHasSignatureHelpProvider && editorTextFocus", "intellij": "Parameter info (within method call arguments)" }, /* @@ -162,28 +162,28 @@ "key": "ctrl+/", "mac": "cmd+/", "command": "editor.action.commentLine", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Comment/uncomment with line comment" }, { "key": "ctrl+numpad_divide", "mac": "cmd+numpad_divide", "command": "editor.action.commentLine", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Comment/uncomment with line comment" }, { "key": "ctrl+alt+/", "mac": "cmd+alt+/", "command": "editor.action.blockComment", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Comment/uncomment with block comment" }, { "key": "ctrl+alt+numpad_divide", "mac": "cmd+alt+numpad_divide", "command": "editor.action.blockComment", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Comment/uncomment with block comment" }, { @@ -214,7 +214,7 @@ "key": "alt+enter", "mac": "alt+enter", "command": "editor.action.quickFix", - "when": "editorTextFocus", + "when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly", "intellij": "Show intention actions and quick-fixes" }, { "key": "ctrl+y", @@ -226,10 +226,17 @@ { "key": "ctrl+alt+l", "mac": "cmd+alt+l", - "command": "editor.action.format", - "when": "editorTextFocus", + "command": "editor.action.formatDocument", + "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly", "intellij": "Reformat code" }, + { + "key": "ctrl+alt+l", + "mac": "cmd+alt+l", + "command": "editor.action.formatSelection", + "when": "editorHasDocumentFormattingProvider && editorHasSelection && editorTextFocus && !editorReadonly", + "intellij": "Reformat selected code" + }, /* { "key": "ctrl+alt+o", @@ -272,7 +279,7 @@ "key": "ctrl+x", "mac": "cmd+x", "command": "editor.action.clipboardCutAction", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Cut current line or selected block to clipboard" }, { @@ -286,7 +293,7 @@ "key": "ctrl+v", "mac": "cmd+v", "command": "editor.action.clipboardPasteAction", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Paste from clipboard" }, /* @@ -303,14 +310,14 @@ "key": "ctrl+d", "mac": "cmd+d", "command": "editor.action.copyLinesDownAction", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Duplicate current line or selected block" }, { "key": "ctrl+backspace", "mac": "cmd+backspace", "command": "deleteAllRight", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Delete line at caret" }, /* @@ -327,14 +334,14 @@ "key": "ctrl+enter", "mac": "cmd+enter", "command": "lineBreakInsert", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Smart line split" }, { "key": "shift+enter", "mac": "shift+enter", "command": "editor.action.insertLineAfter", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Start new line" }, /* @@ -371,14 +378,14 @@ "key": "ctrl+delete", "mac": "alt+delete", "command": "deleteWordLeft", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Delete to word end" }, { "key": "ctrl+backspace", "mac": "alt+backspace", "command": "deleteWordRight", - "when": "editorTextFocus", + "when": "editorTextFocus && !editorReadonly", "intellij": "Delete to word start" }, @@ -508,7 +515,7 @@ "key": "alt+f7", "mac": "alt+f7", "command": "editor.action.referenceSearch.trigger", - "when": "editorTextFocus", + "when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor", "intellij": "Find usages" }, /* @@ -793,7 +800,7 @@ "key": "ctrl+b", "mac": "cmd+b", "command": "editor.action.goToDeclaration", - "when": "editorTextFocus", + "when": "editorHasDefinitionProvider && editorTextFocus", "intellij": "Go to declaration" }, /* @@ -810,9 +817,10 @@ "key": "ctrl+shift+i", "mac": "alt+space", "command": "editor.action.previewDeclaration", - "when": "editorTextFocus", + "when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor", "intellij": "Open quick definition lookup" }, +/* { "key": "ctrl+shift+b", "mac": "ctrl+shift+b", @@ -821,6 +829,7 @@ "intellij": "Go to type declaration", "todo": "not working" }, +*/ /* { "key": "ctrl+u", @@ -929,24 +938,20 @@ "todo": "N/A" }, */ -/* { "key": "f4", "mac": "f4", - "command": "", - "intellij": "Edit source", - "todo": "N/A" + "command": "editor.action.goToDeclaration", + "when": "editorHasDefinitionProvider && editorTextFocus", + "intellij": "Edit source" }, -*/ -/* { "key": "ctrl+enter", "mac": "cmd+down", - "command": "", - "intellij": "View source", - "todo": "N/A" + "command": "editor.action.goToDeclaration", + "when": "editorHasDefinitionProvider && editorTextFocus", + "intellij": "View source" }, -*/ /* { "key": "alt+home", @@ -1031,7 +1036,7 @@ "key": "shift+f6", "mac": "shift+f6", "command": "editor.action.rename", - "when": "editorTextFocus", + "when": "editorHasRenameProvider && editorTextFocus && !editorReadonly", "intellij": "Rename" }, /*