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

Watch for changes in omnisharp.json #804

Merged
merged 7 commits into from
Mar 26, 2017

Conversation

filipw
Copy link
Member

@filipw filipw commented Mar 24, 2017

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 our IWorkspaceOptionsProvider run as soon as the configuration change is reported.

Here is the change in action:

@filipw filipw force-pushed the feature/omnisharp-watch branch from 296a681 to 660cdfc Compare March 24, 2017 15:41
@filipw
Copy link
Member Author

filipw commented Mar 24, 2017

related issue: (see comment 1) #366 (comment)

Copy link
Contributor

@DustinCampbell DustinCampbell left a 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.

@@ -20,6 +20,7 @@
using OmniSharp.Services.FileWatching;
using OmniSharp.Stdio.Logging;
using OmniSharp.Stdio.Services;
using System.IO;
Copy link
Contributor

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?

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, I deleted it now as it wasn't even used; it crept in here because of some code that I ended up ultimately removing

@filipw
Copy link
Member Author

filipw commented Mar 24, 2017

What options does this work for?

it deals with the strongly typed OmnisharpOptions so at the moment that's formatting only

@filipw
Copy link
Member Author

filipw commented Mar 24, 2017

related issue: dotnet/vscode-csharp#1290 (comment)

@filipw
Copy link
Member Author

filipw commented Mar 24, 2017

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);
Copy link
Member

Choose a reason for hiding this comment

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

👏

@DustinCampbell DustinCampbell merged commit 34dae92 into OmniSharp:dev Mar 26, 2017
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