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 Custom .NET CLI support to OmniSharp #2227

Merged
merged 2 commits into from
Sep 28, 2021

Conversation

jkoritzinsky
Copy link
Contributor

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

…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.
@jkoritzinsky
Copy link
Contributor Author

cc: @filipw can you take a look at this PR when you have a chance?

Copy link
Member

@filipw filipw left a comment

Choose a reason for hiding this comment

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

LGTM - thanks!

@filipw filipw merged commit 02d3168 into OmniSharp:master Sep 28, 2021
if (File.Exists(Path.Combine(path, $"dotnet{executableExtension}")))
{
// We'll take the first path that has a dotnet executable.
DotNetPath = Path.Combine(path, "dotnet");

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.

Copy link
Contributor Author

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.

@jkoritzinsky jkoritzinsky deleted the omnisharp-local-dotnet branch October 14, 2021 01:34
@SamB
Copy link
Contributor

SamB commented Nov 1, 2021

FWIW, it kind of looks like this runs before the omnisharp.json files are loaded. ☹

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.

5 participants