Fix organize imports (#164035)

Fixes #163994

This fixes the organize imports command (it was using the wrong id) and also cleans up the implementation
This commit is contained in:
Matt Bierner
2022-10-19 09:27:41 -07:00
committed by GitHub
parent ee71fefcec
commit 33378c2ec0
2 changed files with 63 additions and 109 deletions

View File

@@ -1351,19 +1351,19 @@
},
{
"command": "typescript.sortImports",
"when": "tsSupportsSortImports && editorLangId =~ /^typescript(react)?$/"
"when": "supportedCodeAction =~ /(\\s|^)source\\.sortImports\\b/ && editorLangId =~ /^typescript(react)?$/"
},
{
"command": "javascript.sortImports",
"when": "tsSupportsSortImports && editorLangId =~ /^javascript(react)?$/"
"when": "supportedCodeAction =~ /(\\s|^)source\\.sortImports\\b/ && editorLangId =~ /^javascript(react)?$/"
},
{
"command": "typescript.removeUnusedImports",
"when": "tsSupportsRemoveUnusedImports && editorLangId =~ /^typescript(react)?$/"
"when": "supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^typescript(react)?$/"
},
{
"command": "javascript.removeUnusedImports",
"when": "tsSupportsRemoveUnusedImports && editorLangId =~ /^javascript(react)?$/"
"when": "supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^javascript(react)?$/"
}
],
"editor/context": [