From f13c7cd1d99b77131ca73b44dc934eb726a9b480 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 29 Jul 2016 11:26:42 +0200 Subject: [PATCH] add menu item to editor context menu --- contentprovider-sample/README.md | 4 ++-- contentprovider-sample/package.json | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/contentprovider-sample/README.md b/contentprovider-sample/README.md index 0794660d..a6c127d8 100644 --- a/contentprovider-sample/README.md +++ b/contentprovider-sample/README.md @@ -11,13 +11,13 @@ It is not intended as a product quality extension. ![Print References](https://raw.githubusercontent.com/Microsoft/vscode-extension-samples/master/contentprovider-sample/preview.gif) -# 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 diff --git a/contentprovider-sample/package.json b/contentprovider-sample/package.json index bbe5a03f..8f071b24 100644 --- a/contentprovider-sample/package.json +++ b/contentprovider-sample/package.json @@ -28,6 +28,15 @@ "title": "Show All References" } ], + "menus": { + "editor/context": [ + { + "command": "editor.printReferences", + "when": "editorHasReferenceProvider", + "group": "navigation@1.31" + } + ] + }, "languages": [ { "id": "locations",