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

Fixed disabling of code lens references #1782

Merged
merged 4 commits into from
Oct 9, 2017

Conversation

filipw
Copy link
Contributor

@filipw filipw commented Oct 6, 2017

This is a follow up to #1781.
The setting to disable references code lens inadvertently also disabled the run/debug test code lens.

This PR fixes that - so setting csharp.showReferencesCodeLens doesn't affect the test code lens.
It also introduces a sibling setting - csharp.showTestsCodeLens, which controls toggling the test code lens, without affecting the references code lens.

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.

Heh-heh. Oops! 😄

package.json Outdated
"csharp.showTestsCodeLens": {
"type": "boolean",
"default": true,
"description": "Specifies whether the run and debug test CodeLens show be shown."
Copy link
Member

Choose a reason for hiding this comment

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

Typo: "should be should". It looks like the same typo appears above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed!

@DustinCampbell
Copy link
Member

@rchande: Does this look good to you?

Copy link

@rchande rchande left a comment

Choose a reason for hiding this comment

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

Oops--thanks!


constructor(server: OmniSharpServer, reporter: TelemetryReporter, testManager: TestManager)
{
super(server, reporter);

this._testManager = testManager;
this._options = Options.Read();
Copy link

Choose a reason for hiding this comment

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

With this change, do we still turn codelens on/off as you switch between the prefernces tab and file?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so. I would expect that this will require a restart of the extension to take effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah indeed. Though I think this is consistent with the rest of the extension at the moment - we don't read any options in "real time" I think

Copy link
Member

Choose a reason for hiding this comment

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

I think we're just inconsistent. For example, setting csharp.suppressDotnetRestoreNotification will take effect immediately. So will csharp.disableCodeActions. Maybe it's worth adding the extra logic to listen for vscode.workspace.onDidChangeConfiguration? Check out what we do in CodeActionProvider here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the tip - I did not see that before. I pushed the appropriate change. Indeed, the experience is much nicer now 👍

this.addDisposables(configChangedDisposable);
}

private _checkOptions(): void {
Copy link

Choose a reason for hiding this comment

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

Nit--this method doesn't actually check anything. Maybe call it "_updatedCachedOptions" or something?

Copy link
Member

Choose a reason for hiding this comment

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

Let's go back and fix that up with codeActionProvider at the same time, so that we're consistent. I'll send a follow up PR with that change.

@DustinCampbell DustinCampbell merged commit d76752f into dotnet:master Oct 9, 2017
@filipw
Copy link
Contributor Author

filipw commented Oct 10, 2017

thanks guys! 👍

@filipw filipw deleted the bugfix/disable-references branch October 10, 2017 09:06
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