Skip to content
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

Add setting to only analyze open documents for references #4170

Merged
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 @@ -626,6 +626,11 @@
"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.analyzeOpenDocumentsOnly": {
"type": "boolean",
"default": false,
"description": "Only search for references within open documents. Enable this in large workspaces if memory is limited."
},
"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 @@ -102,6 +102,7 @@ export interface ISettings {
cwd?: string;
notebooks?: INotebooksSettings;
enableReferencesCodeLens?: boolean;
analyzeOpenDocumentsOnly?: boolean;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw I picked this name specifically to match C#'s

It doesn't perfectly fit, but I think it's pretty accurate. Open to changing though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

}

export interface IStartAsLoginShellSettings {
Expand Down Expand Up @@ -273,6 +274,8 @@ export function load(): ISettings {
configuration.get<string>("cwd", undefined),
enableReferencesCodeLens:
configuration.get<boolean>("enableReferencesCodeLens", true),
analyzeOpenDocumentsOnly:
configuration.get<boolean>("analyzeOpenDocumentsOnly", true),
Comment on lines +277 to +278
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need a bit in package.json too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol sure do. My b, I'll commit that in a sec. Good catch!

};
}

Expand Down