Skip to content

Commit 4d748bc

Browse files
committed
refactor: EditorActionMapping.ForImport change to DisableImport, this simplify codes and make config meaning is more specific
1 parent 73884c7 commit 4d748bc

17 files changed

Lines changed: 82 additions & 86 deletions

action-support-matrix.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
|--------|--------|-----|----------|-------|-------------|-----------|
1414
| Go to bracket |||| N/A | Go to bracket | actions.go.bracket |
1515
| Call hierarchy || ❌ (not supported yet, see [`Support 'Show Call Hierarchy' as an LSP action` issue](https://github.com/zed-industries/zed/issues/14203)) || N/A | Show call hierarchy | actions.go.callHierarchy |
16-
| Go to definition ||| N/A | N/A | Go to definition | actions.go.definition |
16+
| Go to definition ||| ❌ (There is not `Go to definition` in intellij, use `Go to declaration` instead) | N/A | Go to definition | actions.go.definition |
1717
| Go to declaration |||| N/A | Go to declaration or usages | actions.go.goToDeclaration |
1818
| Go to super || ❌ (not supported yet, no issue tracked) || N/A | Go to super class/super method | actions.go.goToSuper |
1919
| Go to test || ❌ (not supported yet, see [`Go to test` discussion](https://github.com/zed-industries/zed/discussions/40859)) || N/A | Go to test | actions.go.goToTest |
20-
| Go to implementations |||| N/A | Go to implementations | actions.go.implementations |
20+
| Go to implementations |||| N/A | Go to implementations, For an interface, this shows all the implementors of that interface and for abstract methods, this shows all concrete implementations of that method. | actions.go.implementations |
2121
| Peek declaration |||| N/A | Peek declaration | actions.go.peekDeclaration |
2222
| Reference peek || ❌ (Peek is not supported yet, see [`Peek or Preview Definitions Inline` discussion](https://github.com/zed-industries/zed/discussions/28282)) || N/A | Show usages / reference search | actions.go.referencePeek |
2323
| Go to references |||| N/A | Go to references | actions.go.references |
@@ -30,7 +30,7 @@
3030
|--------|--------|-----|----------|-------|-------------|-----------|
3131
| Code action ||||| Code Action... | actions.refactor.codeAction |
3232
| Organize imports |||| N/A | Organize Imports | actions.refactor.organizeImports |
33-
| Quick fix || ❌ (not supported yet, no issue tracked) | N/A | N/A | Quick Fix... | actions.refactor.quickFix |
33+
| Quick fix || ❌ (not supported yet, no issue tracked) | | N/A | Quick Fix... | actions.refactor.quickFix |
3434
| Refactor code || ❌ (not supported yet, see [Code refactoring in Zed ](https://github.com/zed-industries/zed/discussions/8623)) ||| Refactor This... | actions.refactor.refactor |
3535
| Rename symbol ||||| Rename | actions.refactor.rename |
3636

@@ -183,8 +183,8 @@
183183
| Action | VSCode | Zed | IntelliJ | Helix | Description | Action ID |
184184
|--------|--------|-----|----------|-------|-------------|-----------|
185185
| Delete previous word |||| N/A | Delete to the start of the previous word | actions.edit.deleteWordLeft |
186-
| Delete previous subword ||| N/A | N/A | Delete to the start of the previous subword (hump) | actions.edit.deleteWordPartLeft |
187-
| Delete next subword ||| N/A | N/A | Delete to the end of the next subword (hump) | actions.edit.deleteWordPartRight |
186+
| Delete previous subword ||| ❌ (behaviour is controlled by `CamelHumps` setting) | N/A | Delete to the start of the previous subword (hump) | actions.edit.deleteWordPartLeft |
187+
| Delete next subword ||| ❌ (behaviour is controlled by `CamelHumps` setting) | N/A | Delete to the end of the next subword (hump) | actions.edit.deleteWordPartRight |
188188

189189
## File
190190

@@ -224,7 +224,7 @@
224224
|--------|--------|-----|----------|-------|-------------|-----------|
225225
| Go back |||| N/A | Go to previous cursor location | actions.go.back |
226226
| Go forward |||| N/A | Go to next cursor location | actions.go.forward |
227-
| Go to last edit location || N/A || N/A | Go to last edit location | actions.go.lastEditLocation |
227+
| Go to last edit location || ❌ (not supported yet, see [Implement "Go To Last Edit Location" issue](https://github.com/zed-industries/zed/issues/19731)) || N/A | Go to last edit location | actions.go.lastEditLocation |
228228

229229
## Navigation.Problems
230230

config/action_mappings/clipboard.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ mappings:
66
vscode:
77
- command: "editor.action.clipboardCutAction"
88
when: "editorTextFocus"
9-
forImport: true
109
# cut in file explorer
1110
- command: "filesExplorer.cut"
1211
when: "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
12+
disableImport: true
1313
# underlying cut
1414
- command: "execCut"
15+
disableImport: true
1516
zed:
1617
- action: "editor::Cut"
1718
context: "Editor"
@@ -29,15 +30,17 @@ mappings:
2930
vscode:
3031
- command: "editor.action.clipboardCopyAction"
3132
when: "editorTextFocus"
32-
forImport: true
3333
# copy in file explorer
3434
- command: "filesExplorer.copy"
35+
disableImport: true
3536
when: "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !inputFocus"
3637
# copy in problem view
3738
- command: "problems.action.copy"
3839
when: "problemsVisibility && !relatedInformationFocus && focusedView == 'workbench.panel.markers.view'"
40+
disableImport: true
3941
# underlying copy
4042
- command: "execCopy"
43+
disableImport: true
4144
zed:
4245
- action: "editor::Copy"
4346
context: "Editor"
@@ -61,12 +64,13 @@ mappings:
6164
vscode:
6265
- command: "editor.action.clipboardPasteAction"
6366
when: "editorTextFocus && !editorReadonly"
64-
forImport: true
6567
# paste in file explorer
6668
- command: "filesExplorer.paste"
6769
when: "filesExplorerFocus && foldersViewVisible && !explorerResourceReadonly && !inputFocus"
70+
disableImport: true
6871
# underlying paste
6972
- command: "execPaste"
73+
disableImport: true
7074
zed:
7175
- action: "editor::Paste"
7276
context: "Editor"

config/action_mappings/diff.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ mappings:
3232
when: "textCompareEditorVisible"
3333
intellij:
3434
action: "PreviousDiff"
35+
# TODO(xinnjie): compare editor not available in zed?
3536
zed:
3637
action: "editor::GoToPreviousChange"
3738
context: "Editor && mode == full"

config/action_mappings/editor_format.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ mappings:
66
vscode:
77
- command: "editor.action.formatDocument"
88
when: "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
9-
forImport: true
109
- command: "notebook.format"
1110
when: "notebookEditable && !editorTextFocus && activeEditor == 'workbench.editor.notebook'"
11+
disableImport: true
1212
zed:
1313
action: "editor::Format"
1414
context: "Editor"
@@ -21,9 +21,9 @@ mappings:
2121
vscode:
2222
- command: "editor.action.formatSelection"
2323
when: "editorHasDocumentSelectionFormattingProvider && editorTextFocus && !editorReadonly"
24-
forImport: true
2524
- command: "notebook.formatCell"
2625
when: "editorHasDocumentFormattingProvider && editorTextFocus && inCompositeEditor && notebookEditable && !editorReadonly && activeEditor == 'workbench.editor.notebook'"
26+
disableImport: true
2727
zed:
2828
action: "editor::FormatSelections"
2929
context: "Editor"

config/action_mappings/editor_refactor.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ mappings:
66
vscode:
77
- command: "editor.action.rename"
88
when: "editorHasRenameProvider && editorTextFocus && !editorReadonly"
9-
forImport: true
109
- command: "editor.action.changeAll"
1110
when: "!editorHasRenameProvider &&editorTextFocus && !editorReadonly"
11+
disableImport: true
1212
- command: "renameFile"
13+
disableImport: true
1314
when: "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
1415
intellij:
1516
action: "RenameElement"
@@ -56,7 +57,8 @@ mappings:
5657
command: "editor.action.quickFix"
5758
when: "editorHasCodeActionsProvider && textInputFocus && !editorReadonly"
5859
intellij:
59-
notSupported: true
60+
action: "ShowIntentionActions"
61+
disableImport: true
6062
zed:
6163
notSupported: true
6264
notSupportedReason: "not supported yet, no issue tracked"
@@ -71,6 +73,7 @@ mappings:
7173
when: "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly"
7274
intellij:
7375
action: "ShowIntentionActions"
76+
disableImport: true
7477
zed:
7578
action: "editor::ToggleCodeActions"
7679
context: "Editor"

config/action_mappings/editor_word.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ mappings:
99
zed:
1010
action: "editor::DeleteToNextSubwordEnd"
1111
context: "Editor"
12-
# intellij need to turn on `CamelHumps` setting
1312
intellij:
1413
notSupported: true
14+
notSupportedReason: "behaviour is controlled by `CamelHumps` setting"
1515
- id: "actions.edit.deleteWordLeft"
1616
name: "Delete previous word"
1717
description: "Delete to the start of the previous word"
@@ -34,6 +34,6 @@ mappings:
3434
zed:
3535
action: "editor::DeleteToPreviousSubwordStart"
3636
context: "Editor"
37-
# intellij need to turn on `CamelHumps` setting
3837
intellij:
3938
notSupported: true
39+
notSupportedReason: "behaviour is controlled by `CamelHumps` setting"

config/action_mappings/go_code.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mappings:
2525
context: "Editor"
2626
- id: "actions.go.implementations"
2727
name: "Go to implementations"
28-
description: "Go to implementations"
28+
description: "Go to implementations, For an interface, this shows all the implementors of that interface and for abstract methods, this shows all concrete implementations of that method."
2929
category: "Code.Go"
3030
vscode:
3131
command: "editor.action.goToImplementation"
@@ -69,6 +69,9 @@ mappings:
6969
zed:
7070
action: "editor::GoToDefinition"
7171
context: "Editor"
72+
intellij:
73+
notSupported: true
74+
notSupportedReason: "There is not `Go to definition` in intellij, use `Go to declaration` instead"
7275
- id: "actions.go.typeDefinition"
7376
name: "Go to type definition"
7477
description: "Go to type definition"

config/action_mappings/go_history.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ mappings:
2929
command: "workbench.action.navigateToLastEditLocation"
3030
zed:
3131
notSupported: true
32+
notSupportedReason: "not supported yet, see [Implement \"Go To Last Edit Location\" issue](https://github.com/zed-industries/zed/issues/19731)"
3233
intellij:
3334
action: "JumpToLastChange"
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
# Additional mappings for ForImport importer tests
1+
# Additional mappings for DisableImport importer tests
22
mappings:
3-
# ForImport preference among command+args ignoring when
3+
# DisableImport preference among command+args ignoring when
44
- id: "actions.test.forimport.withArgs.A"
5-
description: "ForImport args candidate A"
5+
description: "DisableImport args candidate A (disabled)"
66
category: "Testing"
77
vscode:
88
- command: "cmd.forimp.args"
99
when: "W_A"
1010
args:
1111
x: 1
12+
disableImport: true
1213
- id: "actions.test.forimport.withArgs.B"
13-
description: "ForImport args candidate B (preferred)"
14+
description: "DisableImport args candidate B (enabled, preferred)"
1415
category: "Testing"
1516
vscode:
1617
- command: "cmd.forimp.args"
1718
when: "W_B"
1819
args:
1920
x: 1
20-
forImport: true
21-
# ForImport preference in command-only fallback (no args)
21+
# DisableImport preference in command-only fallback (no args)
2222
- id: "actions.test.forimport.cmdOnly.A"
23-
description: "ForImport cmd-only candidate A"
23+
description: "DisableImport cmd-only candidate A (disabled)"
2424
category: "Testing"
2525
vscode:
2626
- command: "cmd.forimp.noargs"
2727
when: "Y_A"
28+
disableImport: true
2829
- id: "actions.test.forimport.cmdOnly.B"
29-
description: "ForImport cmd-only candidate B (preferred)"
30+
description: "DisableImport cmd-only candidate B (enabled, preferred)"
3031
category: "Testing"
3132
vscode:
3233
- command: "cmd.forimp.noargs"
3334
when: "Y_B"
34-
forImport: true
35-
# Single-entry implicit ForImport vs multi-entry
35+
# Single-entry implicit enabled vs multi-entry
3636
- id: "actions.test.forimport.singleImplicit"
37-
description: "Single-entry mapping implicitly preferred"
37+
description: "Single-entry mapping implicitly enabled"
3838
category: "Testing"
3939
vscode:
4040
command: "cmd.forimp.single"
@@ -45,6 +45,6 @@ mappings:
4545
vscode:
4646
- command: "could.be.imported"
4747
when: "SomeCondition"
48-
forImport: true
4948
- command: "should.not.import.command"
5049
when: "OtherCondition"
50+
disableImport: true

config/action_mappings/tab_switcher.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ mappings:
66
vscode:
77
- command: "workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup"
88
when: "editorFocus"
9-
forImport: true
109
- command: "workbench.action.quickOpenNavigateNextInEditorPicker"
1110
when: "inEditorsPicker && inQuickOpen"
11+
disableImport: true
1212
- command: "workbench.action.quickOpenNavigateNext"
13+
disableImport: true
1314
when: "inQuickOpen"
1415
- command: "workbench.action.terminal.focusNext"
1516
when: "terminalFocus"
@@ -25,10 +26,11 @@ mappings:
2526
vscode:
2627
- command: "workbench.action.quickOpenLeastRecentlyUsedEditorInGroup"
2728
when: "editorFocus"
28-
forImport: true
2929
- command: "workbench.action.quickOpenNavigatePreviousInEditorPicker"
3030
when: "inEditorsPicker && inQuickOpen"
31+
disableImport: true
3132
- command: "workbench.action.terminal.focusPrevious"
33+
disableImport: true
3234
when: "terminalFocus"
3335
zed:
3436
action: "tab_switcher::Toggle"

0 commit comments

Comments
 (0)