Skip to content
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
vscode-extension-samples/contentprovider-sample/
vscode-extension-samples/contentprovider-sample/

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

References Editor Sample

This is a sample extension that shows how an editor-based representation for the Find References feature can be build.

It is not intended as a product quality extension.

  • Select a symbol
  • Select F1 > Show All References
  • An editor opens to the side and show the references in a textual form

Print References

How it works, what it shows?

  • The extension implements and registers a TextDocumentContentProvider for a particular URI scheme.
  • The content provider uses the vscode.executeReferenceProvider-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.
  • Add links for each result in the virtual document pointing to the reference.
  • Add an entry to editor context menu via package.json

How to run locally

  • npm run compile to start the compiler in watch mode
  • open this folder in VS Code and press F5