diff --git a/package.json b/package.json index 5a6576297e..03d5ab639e 100644 --- a/package.json +++ b/package.json @@ -609,6 +609,11 @@ "default": true, "description": "Loads user and system-wide PowerShell profiles (profile.ps1 and Microsoft.VSCode_profile.ps1) into the PowerShell session. This affects IntelliSense and interactive script execution, but it does not affect the debugger." }, + "powershell.enableReferencesCodeLens": { + "type": "boolean", + "default": true, + "description": "Displays a code lens above function definitions showing the number of times the function is referenced in the workspace. Large workspaces should disable this setting due to high performance impact." + }, "powershell.bugReporting.project": { "type": "string", "default": "https://github.com/PowerShell/vscode-powershell", diff --git a/src/settings.ts b/src/settings.ts index 4c51672170..f73d8544c1 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -101,6 +101,7 @@ export interface ISettings { buttons?: IButtonSettings; cwd?: string; notebooks?: INotebooksSettings; + enableReferencesCodeLens?: boolean; } export interface IStartAsLoginShellSettings { @@ -268,6 +269,8 @@ export function load(): ISettings { configuration.get("startAsLoginShell", defaultStartAsLoginShellSettings), cwd: // NOTE: This must be validated at startup via `validateCwdSetting()`. There's probably a better way to do this. configuration.get("cwd", undefined), + enableReferencesCodeLens: + configuration.get("enableReferencesCodeLens", true), }; }