-
Notifications
You must be signed in to change notification settings - Fork 416
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
Watch for changes in omnisharp.json #804
Conversation
296a681
to
660cdfc
Compare
related issue: (see comment 1) #366 (comment) |
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.
What options does this work for? I would guess that all of the project system options wouldn't work since those are only consumed when each project system is initialized.
src/OmniSharp.Host/Startup.cs
Outdated
@@ -20,6 +20,7 @@ | |||
using OmniSharp.Services.FileWatching; | |||
using OmniSharp.Stdio.Logging; | |||
using OmniSharp.Stdio.Services; | |||
using System.IO; |
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.
sort order? Shouldn't System namespaces be on top?
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.
yes, I deleted it now as it wasn't even used; it crept in here because of some code that I ended up ultimately removing
it deals with the strongly typed OmnisharpOptions so at the moment that's formatting only |
related issue: dotnet/vscode-csharp#1290 (comment) |
one more related issue: dotnet/vscode-csharp#1080 |
@@ -49,7 +49,7 @@ public Startup(IOmniSharpEnvironment env) | |||
new PhysicalFileProvider(env.Path), | |||
"omnisharp.json", | |||
optional: true, | |||
reloadOnChange: false); | |||
reloadOnChange: true); |
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.
👏
This PR introduces live change tracking in
omnisharp.json
. There are a couple of issues open for that, will attach them to this PR when I locate them 😄At the moment changes in formatting settings in
omnisharp.json
are only read by OmniSharp at startup - so if you change anything you need to restart the server to have them take effect which is not an ideal experience.Note that we do not roll out a file watcher by hand, but rather rely on change tracking capabilities of
Microsoft.Extensions.Configuration
. On OmniSharp side, technically, the way it's implemented, is that we let each of ourIWorkspaceOptionsProvider
run as soon as the configuration change is reported.Here is the change in action: