This VSCode extension helps you search for external functions and classes on Microsoft documentation when they don't belong to your current project.
Features
Smart Detection: Automatically detects whether a selected function/class is from your current project or from external libraries (NuGet packages, npm modules, etc.)
Search on ADO: Provides a context menu option to search external functions on Microsoft documentation
Easy Access: Right-click context menu integration for quick access
Token Caching: Efficiently caches Azure authentication tokens to improve performance and reduce API calls
Automatic Token Refresh: Seamlessly refreshes expired tokens with retry logic for uninterrupted searches
How to Use
Select a function or class name in your code editor
Right-click to open the context menu
Click "Search on ADO" from the menu
The extension will:
Check if the selected text is defined in your current project
If it's external (not found locally), it will open Microsoft Docs search in your browser
If it's local, it will inform you that ADO search is for external libraries only
Examples
External Functions (will open Microsoft Docs):
console.log (JavaScript built-in)
axios.get (npm package function)
HttpClient.GetAsync (C# .NET method)
JsonSerializer.Serialize (C# .NET method)
lodash.map (npm package function)
Local Functions (will show info message):
Functions defined in your current project files
Classes created in your workspace
Local variables and methods
Installation
Open VSCode
Go to Extensions (Ctrl+Shift+X)
Search for "ADO Referencer"
Click Install
Development
To run this extension in development mode:
Clone the repository
Run npm install to install dependencies
Run npm run compile to build the extension
Press F5 to open a new Extension Development Host window
Test the extension with the provided test-example.js file
Commands
ado-referencer.searchOnADO: Search selected text on Microsoft Docs (available in right-click context menu)
Configuration
The extension supports the following configuration options:
adoReferencer.azureDevOps.tokenCacheTTLMinutes: Time-to-live for cached authentication tokens in minutes (default: 50). Azure tokens typically expire in 60 minutes, so this should be less than that.
adoReferencer.azureDevOps.authToken: Optional Personal Access Token (PAT) for authentication. If not set, the extension uses DefaultAzureCredential (Azure CLI login).
adoReferencer.azureDevOps.priorityProjects: List of project names to search first for faster results (supports wildcards like WD.*).
adoReferencer.azureDevOps.maxConcurrentSearches: Maximum number of concurrent project searches (default: 5).
Authentication
The extension uses Azure authentication with intelligent token caching:
DefaultAzureCredential (Primary): Uses your Azure CLI login (az login) or other Azure credential sources
Personal Access Token (Fallback): Can be configured in settings if preferred
Token caching features:
Tokens are cached for the configured TTL (default 50 minutes)
Automatic refresh when tokens are 80% expired
Retry logic for failed requests with fresh tokens
Progress notifications when acquiring new tokens
Requirements
VSCode 1.103.0 or higher
Known Issues
The extension searches for function definitions using regex patterns, which may not catch all edge cases
Performance is optimized by limiting file searches to 100 files maximum
Only searches common file extensions (.ts, .js, .cs, .py, .java, .cpp, .c, .h)