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

Added logging for .editorconfig paths #2018

Closed
wants to merge 3 commits into from

Conversation

filipw
Copy link
Member

@filipw filipw commented Nov 18, 2020

related to #2017

@@ -533,6 +533,7 @@ private void UpdateAnalyzerConfigFiles(Project project, IList<string> analyzerCo
{
if (!_workspace.EditorConfigEnabled)
{
_logger.LogDebug($".editorconfig files were configured by the project {project.Name} but will not be respected because the feature is switched off in OmniSharp. Enable .editorconfig support in OmniSharp to take advantage of them.");
Copy link
Member

Choose a reason for hiding this comment

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

IMO this should be Warning or at least Information.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure. Editorconfig is off by default in OmniSharp, and I don't think we should flood with warnings when our own feature is opt-in.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd agree if it was the other way round though

Copy link
Member

Choose a reason for hiding this comment

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

According to log message above, it seems like we know that .editoconfig is configured by the project (do we also know if there are .editorconfig files found?). If that's the case, then I think we should inform the user that in order to take advantage of a feature configured by the project, then the user should also enable it in OmniSharp. In that case my opinion is that it's at least Information level.

But if this is a log message seen for every project, regardless if .editorconfig is intended to be used or not. Then go with debug. But maybe rephrase the log message?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes we know that it's configured on the project but that is still too invasive for me. update project runs many times during your work on a project so you shouldn't see the warning all the time.

If you want to have a user information mechanism then this logging is not the mechanism to do it, it's strictly for debugging purposes. The phrasing is such to aid self-debugging too.

for what you are suggesting we should just have a regular one-time message in the logs that says - editorconfig is currently disabled that is always visible.

Copy link
Member

Choose a reason for hiding this comment

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

You are correct, because this message is shown on every Project update, it's too invasive. Didn't notice that during first review.

for what you are suggesting we should just have a regular one-time message in the logs that says - editorconfig is currently disabled that is always visible.

Yes, this is what I was looking for initially. A single warning (or information) if a loaded project has .editorconfig configured, but support is disabled in OmniSharp.

@ffMathy
Copy link

ffMathy commented Nov 20, 2020

This is a great response to my issue - thank you! <3

@ffMathy
Copy link

ffMathy commented Nov 23, 2020

Anything I can do to help with the failing build? Looking forward to this being merged in and released!

@filipw
Copy link
Member Author

filipw commented Nov 23, 2020

it's a flaky build - unrelated to the change.
we just released new OmniSharp 1.37.4 on Friday so this will make it for the next release cycle only

@ffMathy
Copy link

ffMathy commented Nov 23, 2020

Ah I see. So in about a week or so?

@filipw
Copy link
Member Author

filipw commented Nov 26, 2020

this is superseded by #2028

@filipw filipw closed this Nov 26, 2020
@ffMathy
Copy link

ffMathy commented Dec 1, 2020

@filipw now that that PR has been shipped, when can we expect this to arrive in the Visual Studio Code Omnisharp extension?

@filipw
Copy link
Member Author

filipw commented Dec 1, 2020

we ship OmniSharp server about once a month https://github.com/OmniSharp/omnisharp-roslyn/blob/master/CHANGELOG.md#1375---not-yet-released so before Christmas, I think. However, a prerelease is out on each merge.

on the VS Code C# extension side, @JoeRobich has the reigns on the release cadence
However, you can always set "omnisharp.path":"latest" in the VS Code settings to opt into the latest server pre-release

@filipw filipw deleted the feature/editorconfig-logging branch January 19, 2021 19:18
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.

3 participants