mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
add menu item to editor context menu
This commit is contained in:
@ -11,13 +11,13 @@ It is not intended as a product quality extension.
|
||||
|
||||

|
||||
|
||||
# How it works
|
||||
# How it works, what it shows?
|
||||
|
||||
- The extension implements and registers a [`TextDocumentContentProvider`](http://code.visualstudio.com/docs/extensionAPI/vscode-api#TextDocumentContentProvider) for a particular URI scheme.
|
||||
- The content provider uses the [`vscode.executeReferenceProvider`](http://code.visualstudio.com/docs/extensionAPI/vscode-api-commands)-API command to delegate searching for references to the language extensions, like TypeScript, vscode-go, or C#
|
||||
- The generated document initially contains a caption only and incrementally updates as each reference location is resolved.
|
||||
- The content provider uses the decoration API to highlight matches inside the generated document
|
||||
|
||||
- Add an entry to editor context menu via `package.json`
|
||||
|
||||
# How to run locally
|
||||
|
||||
|
||||
@ -28,6 +28,15 @@
|
||||
"title": "Show All References"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"editor/context": [
|
||||
{
|
||||
"command": "editor.printReferences",
|
||||
"when": "editorHasReferenceProvider",
|
||||
"group": "navigation@1.31"
|
||||
}
|
||||
]
|
||||
},
|
||||
"languages": [
|
||||
{
|
||||
"id": "locations",
|
||||
|
||||
Reference in New Issue
Block a user