Skip to content

Commit 1c14527

Browse files
Add setting to control the references code lens (#4139)
* Add setting to control the references code lens * Default to `true` Co-authored-by: Andy Jordan <[email protected]>
1 parent c19ca3e commit 1c14527

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,11 @@
621621
"default": true,
622622
"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."
623623
},
624+
"powershell.enableReferencesCodeLens": {
625+
"type": "boolean",
626+
"default": true,
627+
"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."
628+
},
624629
"powershell.bugReporting.project": {
625630
"type": "string",
626631
"default": "https://github.com/PowerShell/vscode-powershell",

src/settings.ts

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export interface ISettings {
101101
buttons?: IButtonSettings;
102102
cwd?: string;
103103
notebooks?: INotebooksSettings;
104+
enableReferencesCodeLens?: boolean;
104105
}
105106

106107
export interface IStartAsLoginShellSettings {
@@ -270,6 +271,8 @@ export function load(): ISettings {
270271
configuration.get<IStartAsLoginShellSettings>("startAsLoginShell", defaultStartAsLoginShellSettings),
271272
cwd: // NOTE: This must be validated at startup via `validateCwdSetting()`. There's probably a better way to do this.
272273
configuration.get<string>("cwd", undefined),
274+
enableReferencesCodeLens:
275+
configuration.get<boolean>("enableReferencesCodeLens", true),
273276
};
274277
}
275278

0 commit comments

Comments
 (0)