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 an option to disable the references CodeLens #1781

Merged
merged 2 commits into from
Oct 6, 2017

Conversation

rchande
Copy link

@rchande rchande commented Oct 6, 2017

Fixes #1570

@rchande
Copy link
Author

rchande commented Oct 6, 2017

@DustinCampbell I didn't find any tests for the references indicator. Can you confirm whether or not there are any?

@DustinCampbell
Copy link
Member

There are no tests for the references indicator. You're are 100% welcome to explore writing one.

Copy link
Member

@DustinCampbell DustinCampbell left a 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": {
Copy link
Member

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).

if (!options.showReferencesCodeLens)
{
let arr: vscode.CodeLens[] = [];
return arr;
Copy link
Member

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"
Copy link
Member

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".

@rchande
Copy link
Author

rchande commented Oct 6, 2017

Thanks @DustinCampbell -- incorporated your feedback.
Regarding tests, I think maybe there's a larger workitem to go and add tests for all the features that depend on the OmniSharp server (would require some kind of mock of the service and so forth).

@DustinCampbell
Copy link
Member

DustinCampbell commented Oct 6, 2017

@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.

@DustinCampbell
Copy link
Member

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.

@DustinCampbell DustinCampbell merged commit 38ffa15 into dotnet:master Oct 6, 2017
@pnloyd
Copy link

pnloyd commented Oct 6, 2017

@rchanda Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants