Have distinct js/ts commands for organize imports

Fixes #46701
This commit is contained in:
Matt Bierner
2018-03-27 14:33:34 -07:00
parent ddd967559b
commit c059826ba2
3 changed files with 25 additions and 5 deletions

View File

@@ -468,6 +468,11 @@
"command": "typescript.organizeImports",
"title": "%typescript.organizeImports%",
"category": "TypeScript"
},
{
"command": "javascript.organizeImports",
"title": "%typescript.organizeImports%",
"category": "JavaScript"
}
],
"keybindings": [
@@ -525,7 +530,19 @@
},
{
"command": "typescript.organizeImports",
"when": "typescript.isManagedFile && typescript.canOrganizeImports"
"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"
}
]
},