-
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
Fixed disabling of code lens references #1782
Fixed disabling of code lens references #1782
Conversation
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.
Heh-heh. Oops! 😄
package.json
Outdated
"csharp.showTestsCodeLens": { | ||
"type": "boolean", | ||
"default": true, | ||
"description": "Specifies whether the run and debug test CodeLens show be shown." |
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.
Typo: "should be should". It looks like the same typo appears above.
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.
fixed!
@rchande: Does this look good to you? |
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.
Oops--thanks!
src/features/codeLensProvider.ts
Outdated
|
||
constructor(server: OmniSharpServer, reporter: TelemetryReporter, testManager: TestManager) | ||
{ | ||
super(server, reporter); | ||
|
||
this._testManager = testManager; | ||
this._options = Options.Read(); |
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.
With this change, do we still turn codelens on/off as you switch between the prefernces tab and file?
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.
I don't think so. I would expect that this will require a restart of the extension to take effect.
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.
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
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.
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
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.
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 { |
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.
Nit--this method doesn't actually check anything. Maybe call it "_updatedCachedOptions" or something?
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.
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.
thanks guys! 👍 |
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.