mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 16:18:58 +01:00
Move TS/JS to use organize imports codeAction instead of command (#47850)
* Move TS/JS to use organize imports code action Fixes #47845 Fixes #46647 - Defines a new standard `SourceOrganizeImports` `CodeActionKind` to be used to implement organize imports in a consistent way. - Add a new `Organize imports` command and keybinding that executes these actions. - Move over the existing js/ts organize imports command to use the new code action kind * Use supportedCodeActions context key * Document code action kind values * Fix regular expression Make sure we only match whole scopes and not `unicorn.source.organizeImports`
This commit is contained in:
@@ -39,7 +39,6 @@
|
||||
"onCommand:javascript.goToProjectConfig",
|
||||
"onCommand:typescript.goToProjectConfig",
|
||||
"onCommand:typescript.openTsServerLog",
|
||||
"onCommand:typescript.organizeImports",
|
||||
"onCommand:workbench.action.tasks.runTask"
|
||||
],
|
||||
"main": "./out/extension",
|
||||
@@ -464,23 +463,6 @@
|
||||
"command": "typescript.restartTsServer",
|
||||
"title": "%typescript.restartTsServer%",
|
||||
"category": "TypeScript"
|
||||
},
|
||||
{
|
||||
"command": "typescript.organizeImports",
|
||||
"title": "%typescript.organizeImports%",
|
||||
"category": "TypeScript"
|
||||
},
|
||||
{
|
||||
"command": "javascript.organizeImports",
|
||||
"title": "%typescript.organizeImports%",
|
||||
"category": "JavaScript"
|
||||
}
|
||||
],
|
||||
"keybindings": [
|
||||
{
|
||||
"command": "typescript.organizeImports",
|
||||
"key": "shift+alt+o",
|
||||
"when": "typescript.isManagedFile && typescript.canOrganizeImports"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
@@ -528,22 +510,6 @@
|
||||
{
|
||||
"command": "typescript.restartTsServer",
|
||||
"when": "typescript.isManagedFile"
|
||||
},
|
||||
{
|
||||
"command": "typescript.organizeImports",
|
||||
"when": "editorLangId == typescriptreact && typescript.isManagedFile && typescript.canOrganizeImports"
|
||||
},
|
||||
{
|
||||
"command": "typescript.organizeImports",
|
||||
"when": "editorLangId == typescript && typescript.isManagedFile && typescript.canOrganizeImports"
|
||||
},
|
||||
{
|
||||
"command": "javascript.organizeImports",
|
||||
"when": "editorLangId == javascriptreact && typescript.isManagedFile && typescript.canOrganizeImports"
|
||||
},
|
||||
{
|
||||
"command": "javascript.organizeImports",
|
||||
"when": "editorLangId == javascript && typescript.isManagedFile && typescript.canOrganizeImports"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user