|
1 | 1 | {
|
2 | 2 | "name": "intellij-idea-keybindings",
|
3 |
| - "version": "0.1.9", |
| 3 | + "version": "0.1.10", |
4 | 4 | "publisher": "k--kato",
|
5 | 5 | "engines": {
|
6 | 6 | "vscode": "1.6.x"
|
|
52 | 52 | "key": "ctrl+space",
|
53 | 53 | "mac": "ctrl+space",
|
54 | 54 | "command": "editor.action.triggerSuggest",
|
55 |
| - "when": "editorTextFocus", |
| 55 | + "when": "editorHasCompletionItemProvider && editorTextFocus && !editorReadonly", |
56 | 56 | "intellij": "Basic code completion (the name of any class, method or variable)"
|
57 | 57 | },
|
58 | 58 |
|
|
75 | 75 | "key": "ctrl+p",
|
76 | 76 | "mac": "cmd+p",
|
77 | 77 | "command": "editor.action.triggerParameterHints",
|
78 |
| - "when": "editorTextFocus", |
| 78 | + "when": "editorHasSignatureHelpProvider && editorTextFocus", |
79 | 79 | "intellij": "Parameter info (within method call arguments)"
|
80 | 80 | },
|
81 | 81 |
|
|
159 | 159 | "key": "ctrl+/",
|
160 | 160 | "mac": "cmd+/",
|
161 | 161 | "command": "editor.action.commentLine",
|
162 |
| - "when": "editorTextFocus", |
| 162 | + "when": "editorTextFocus && !editorReadonly", |
163 | 163 | "intellij": "Comment/uncomment with line comment"
|
164 | 164 | }, {
|
165 | 165 | "key": "ctrl+numpad_divide",
|
166 | 166 | "mac": "cmd+numpad_divide",
|
167 | 167 | "command": "editor.action.commentLine",
|
168 |
| - "when": "editorTextFocus", |
| 168 | + "when": "editorTextFocus && !editorReadonly", |
169 | 169 | "intellij": "Comment/uncomment with line comment"
|
170 | 170 | }, {
|
171 | 171 | "key": "ctrl+alt+/",
|
172 | 172 | "mac": "cmd+alt+/",
|
173 | 173 | "command": "editor.action.blockComment",
|
174 |
| - "when": "editorTextFocus", |
| 174 | + "when": "editorTextFocus && !editorReadonly", |
175 | 175 | "intellij": "Comment/uncomment with block comment"
|
176 | 176 | }, {
|
177 | 177 | "key": "ctrl+alt+numpad_divide",
|
178 | 178 | "mac": "cmd+alt+numpad_divide",
|
179 | 179 | "command": "editor.action.blockComment",
|
180 |
| - "when": "editorTextFocus", |
| 180 | + "when": "editorTextFocus && !editorReadonly", |
181 | 181 | "intellij": "Comment/uncomment with block comment"
|
182 | 182 | }, {
|
183 | 183 | "key": "ctrl+w",
|
|
206 | 206 | "key": "alt+enter",
|
207 | 207 | "mac": "alt+enter",
|
208 | 208 | "command": "editor.action.quickFix",
|
209 |
| - "when": "editorTextFocus", |
| 209 | + "when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly", |
210 | 210 | "intellij": "Show intention actions and quick-fixes"
|
211 | 211 | }, {
|
212 | 212 | "key": "ctrl+y",
|
|
217 | 217 | }, {
|
218 | 218 | "key": "ctrl+alt+l",
|
219 | 219 | "mac": "cmd+alt+l",
|
220 |
| - "command": "editor.action.format", |
221 |
| - "when": "editorTextFocus", |
| 220 | + "command": "editor.action.formatDocument", |
| 221 | + "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly", |
222 | 222 | "intellij": "Reformat code"
|
| 223 | + }, { |
| 224 | + "key": "ctrl+alt+l", |
| 225 | + "mac": "cmd+alt+l", |
| 226 | + "command": "editor.action.formatSelection", |
| 227 | + "when": "editorHasDocumentFormattingProvider && editorHasSelection && editorTextFocus && !editorReadonly", |
| 228 | + "intellij": "Reformat selected code" |
223 | 229 | },
|
224 | 230 |
|
225 | 231 |
|
|
263 | 269 | "key": "ctrl+x",
|
264 | 270 | "mac": "cmd+x",
|
265 | 271 | "command": "editor.action.clipboardCutAction",
|
266 |
| - "when": "editorTextFocus", |
| 272 | + "when": "editorTextFocus && !editorReadonly", |
267 | 273 | "intellij": "Cut current line or selected block to clipboard"
|
268 | 274 | }, {
|
269 | 275 | "key": "ctrl+c",
|
|
275 | 281 | "key": "ctrl+v",
|
276 | 282 | "mac": "cmd+v",
|
277 | 283 | "command": "editor.action.clipboardPasteAction",
|
278 |
| - "when": "editorTextFocus", |
| 284 | + "when": "editorTextFocus && !editorReadonly", |
279 | 285 | "intellij": "Paste from clipboard"
|
280 | 286 | },
|
281 | 287 |
|
|
292 | 298 | "key": "ctrl+d",
|
293 | 299 | "mac": "cmd+d",
|
294 | 300 | "command": "editor.action.copyLinesDownAction",
|
295 |
| - "when": "editorTextFocus", |
| 301 | + "when": "editorTextFocus && !editorReadonly", |
296 | 302 | "intellij": "Duplicate current line or selected block"
|
297 | 303 | }, {
|
298 | 304 | "key": "ctrl+backspace",
|
299 | 305 | "mac": "cmd+backspace",
|
300 | 306 | "command": "deleteAllRight",
|
301 |
| - "when": "editorTextFocus", |
| 307 | + "when": "editorTextFocus && !editorReadonly", |
302 | 308 | "intellij": "Delete line at caret"
|
303 | 309 | },
|
304 | 310 |
|
|
315 | 321 | "key": "ctrl+enter",
|
316 | 322 | "mac": "cmd+enter",
|
317 | 323 | "command": "lineBreakInsert",
|
318 |
| - "when": "editorTextFocus", |
| 324 | + "when": "editorTextFocus && !editorReadonly", |
319 | 325 | "intellij": "Smart line split"
|
320 | 326 | }, {
|
321 | 327 | "key": "shift+enter",
|
322 | 328 | "mac": "shift+enter",
|
323 | 329 | "command": "editor.action.insertLineAfter",
|
324 |
| - "when": "editorTextFocus", |
| 330 | + "when": "editorTextFocus && !editorReadonly", |
325 | 331 | "intellij": "Start new line"
|
326 | 332 | },
|
327 | 333 |
|
|
358 | 364 | "key": "ctrl+delete",
|
359 | 365 | "mac": "alt+delete",
|
360 | 366 | "command": "deleteWordLeft",
|
361 |
| - "when": "editorTextFocus", |
| 367 | + "when": "editorTextFocus && !editorReadonly", |
362 | 368 | "intellij": "Delete to word end"
|
363 | 369 | }, {
|
364 | 370 | "key": "ctrl+backspace",
|
365 | 371 | "mac": "alt+backspace",
|
366 | 372 | "command": "deleteWordRight",
|
367 |
| - "when": "editorTextFocus", |
| 373 | + "when": "editorTextFocus && !editorReadonly", |
368 | 374 | "intellij": "Delete to word start"
|
369 | 375 | },
|
370 | 376 |
|
|
484 | 490 | "key": "alt+f7",
|
485 | 491 | "mac": "alt+f7",
|
486 | 492 | "command": "editor.action.referenceSearch.trigger",
|
487 |
| - "when": "editorTextFocus", |
| 493 | + "when": "editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor", |
488 | 494 | "intellij": "Find usages"
|
489 | 495 | },
|
490 | 496 |
|
|
754 | 760 | "key": "ctrl+b",
|
755 | 761 | "mac": "cmd+b",
|
756 | 762 | "command": "editor.action.goToDeclaration",
|
757 |
| - "when": "editorTextFocus", |
| 763 | + "when": "editorHasDefinitionProvider && editorTextFocus", |
758 | 764 | "intellij": "Go to declaration"
|
759 | 765 | },
|
760 | 766 |
|
|
771 | 777 | "key": "ctrl+shift+i",
|
772 | 778 | "mac": "alt+space",
|
773 | 779 | "command": "editor.action.previewDeclaration",
|
774 |
| - "when": "editorTextFocus", |
| 780 | + "when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor", |
775 | 781 | "intellij": "Open quick definition lookup"
|
776 |
| - }, { |
777 |
| - "key": "ctrl+shift+b", |
778 |
| - "mac": "ctrl+shift+b", |
779 |
| - "command": "editor.action.goToTypeDeclaration", |
780 |
| - "when": "editorTextFocus", |
781 |
| - "intellij": "Go to type declaration", |
782 |
| - "todo": "not working" |
783 | 782 | },
|
784 | 783 |
|
785 | 784 |
|
|
899 | 898 |
|
900 | 899 |
|
901 | 900 |
|
902 |
| - |
903 |
| - |
904 |
| - |
905 |
| - |
906 |
| - |
907 |
| - |
908 |
| - |
909 |
| - |
| 901 | + { |
| 902 | + "key": "f4", |
| 903 | + "mac": "f4", |
| 904 | + "command": "editor.action.goToDeclaration", |
| 905 | + "when": "editorHasDefinitionProvider && editorTextFocus", |
| 906 | + "intellij": "Edit source" |
| 907 | + }, { |
| 908 | + "key": "ctrl+enter", |
| 909 | + "mac": "cmd+down", |
| 910 | + "command": "editor.action.goToDeclaration", |
| 911 | + "when": "editorHasDefinitionProvider && editorTextFocus", |
| 912 | + "intellij": "View source" |
| 913 | + }, |
910 | 914 |
|
911 | 915 |
|
912 | 916 |
|
|
991 | 995 | "key": "shift+f6",
|
992 | 996 | "mac": "shift+f6",
|
993 | 997 | "command": "editor.action.rename",
|
994 |
| - "when": "editorTextFocus", |
| 998 | + "when": "editorHasRenameProvider && editorTextFocus && !editorReadonly", |
995 | 999 | "intellij": "Rename"
|
996 | 1000 | },
|
997 | 1001 |
|
|
0 commit comments