-
Notifications
You must be signed in to change notification settings - Fork 420
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 Custom .NET CLI support to OmniSharp #2227
Conversation
…custom .NET CLI, with a fallback to the DOTNET_ROOT environment variable before falling back to the PATH. I've updated the tests to use this functionality for locating the .NET CLI instead of using the old test-only code-path. As this is my first contribution to Omnisharp, I'm not quite sure how this exposes the new setting through to omnisharp.json, so if anyone has any pointers on that, they would be well appreciated.
cc: @filipw can you take a look at this PR when you have a chance? |
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.
LGTM - thanks!
if (File.Exists(Path.Combine(path, $"dotnet{executableExtension}"))) | ||
{ | ||
// We'll take the first path that has a dotnet executable. | ||
DotNetPath = Path.Combine(path, "dotnet"); |
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 believe we need a break;
here. Currently, it will continue looping the location paths and take the last path that has a dotnet executable. If you agree, I can push a PR for that.
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 you're right, so a PR is probably worthwhile.
FWIW, it kind of looks like this runs before the omnisharp.json files are loaded. ☹ |
Add a configuration mechanism to allow users to point OmniSharp to a custom .NET CLI, with a fallback to the DOTNET_ROOT environment variable before falling back to the PATH.
I've updated the tests to use this functionality for locating the .NET CLI instead of using the old test-only code-path.
As this is my first contribution to Omnisharp, I'm not quite sure how this exposes the new setting through to omnisharp.json, so if anyone has any pointers on that, they would be well appreciated.
cc: @333fred