Add 'go to source definition' command

Fixes #147532

Requires TS 4.7+
This commit is contained in:
Matt Bierner
2022-04-19 19:31:58 -07:00
parent 973ebbcdd8
commit d851ea5d49
5 changed files with 157 additions and 0 deletions

View File

@@ -65,6 +65,7 @@
"onCommand:_typescript.configurePlugin",
"onCommand:_typescript.learnMoreAboutRefactorings",
"onCommand:typescript.fileReferences",
"onCommand:typescript.goToSourceDefinition",
"onTaskType:typescript",
"onLanguage:jsonc"
],
@@ -1229,6 +1230,11 @@
"command": "typescript.findAllFileReferences",
"title": "%typescript.findAllFileReferences%",
"category": "TypeScript"
},
{
"command": "typescript.goToSourceDefinition",
"title": "%typescript.goToSourceDefinition%",
"category": "TypeScript"
}
],
"menus": {
@@ -1280,6 +1286,32 @@
{
"command": "typescript.findAllFileReferences",
"when": "tsSupportsFileReferences && typescript.isManagedFile"
},
{
"command": "typescript.goToSourceDefinition",
"when": "tsSupportsSourceDefinition && typescript.isManagedFile"
}
],
"editor/context": [
{
"command": "typescript.goToSourceDefinition",
"when": "tsSupportsSourceDefinition && resourceLangId == typescript",
"group": "navigation@9"
},
{
"command": "typescript.goToSourceDefinition",
"when": "tsSupportsSourceDefinition && resourceLangId == typescriptreact",
"group": "navigation@9"
},
{
"command": "typescript.goToSourceDefinition",
"when": "tsSupportsSourceDefinition && resourceLangId == javascript",
"group": "navigation@9"
},
{
"command": "typescript.goToSourceDefinition",
"when": "tsSupportsSourceDefinition && resourceLangId == javascriptreact",
"group": "navigation@9"
}
],
"explorer/context": [