-
Notifications
You must be signed in to change notification settings - Fork 677
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 an option to disable the references CodeLens #1781
Conversation
@DustinCampbell I didn't find any tests for the references indicator. Can you confirm whether or not there are any? |
There are no tests for the references indicator. You're are 100% welcome to explore writing one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a couple of tweaks to the option.
package.json
Outdated
@@ -373,6 +373,11 @@ | |||
"type": "boolean", | |||
"default": true, | |||
"description": "Specifes whether OmniSharp should use VS Code editor settings for C# code formatting (use of tabs, indentation size)." | |||
}, | |||
"omnisharp.showReferencesCodeLens": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "csharp.showReferencesCodeLens". The "omnisharp.*" prefixed settings are intended to be for OmniSharp itself (though we diverged in one or two cases).
src/features/codeLensProvider.ts
Outdated
if (!options.showReferencesCodeLens) | ||
{ | ||
let arr: vscode.CodeLens[] = []; | ||
return arr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't use just return []
here? Or, does TypeScript complain.
package.json
Outdated
"omnisharp.showReferencesCodeLens": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Specifies whether Omnisharp should show the references CodeLens" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about: "Specifies whether the references CodeLens should be shown".
Remember that the extension isn't "OmniSharp".
Thanks @DustinCampbell -- incorporated your feedback. |
@rchande: I'm not sure a mock service is actually needed. VS Code extension tests run by launching an instance of VS Code and running the extension. If we could add the infrastructure to allow our platform specific components to download during test runs, I think it'd work fine. |
Of course, that'd be more of an integration test. Adding a mock for the omnisharp service endpoints wouldn't be a big deal. Agree that it's a bigger work item. |
@rchanda Thanks for this! |
Fixes #1570