Skip to content

Add setting to control the references code lens #4139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export interface ISettings {
buttons?: IButtonSettings;
cwd?: string;
notebooks?: INotebooksSettings;
enableReferencesCodeLens?: boolean;
}

export interface IStartAsLoginShellSettings {
Expand Down Expand Up @@ -268,6 +269,8 @@ export function load(): ISettings {
configuration.get<IStartAsLoginShellSettings>("startAsLoginShell", defaultStartAsLoginShellSettings),
cwd: // NOTE: This must be validated at startup via `validateCwdSetting()`. There's probably a better way to do this.
configuration.get<string>("cwd", undefined),
enableReferencesCodeLens:
configuration.get<boolean>("enableReferencesCodeLens", true),
};
}

Expand Down