we have been adding more and more features to IDE. it is long-tail features so it always helps some portion of our users. but there is also another portion of users who don't care that features or want to reduce noise or reduce system resource consumed from those features that they don't use much.
these people have been asking a way to disable those features altogether. and let those features only run when it is explicitly asked.
basically no solution crawler running, no background compilation running and etc.
it requires design meeting, but similar to power save mode other IDE team provides for exactly same reason.
Ideally the trigger for this mode would be provided by the core editor or platform, and Roslyn would simply respond to it.
tagging @kendrahavens @jinujoseph
looks like we are getting vote already.
Design review outcome
I suggest making this not just an event, to which components (like Roslyn) might react to, but include a mechanism for components supporting the mode to register themselves with, so there could be implemented some form of dialog, that lets you choose, which component to disable/power down when entering power safe mode.
asked in DC
I'm very wary about thsi. People are reporting slowness, and they're claiming it's due to a specified feature, but it's not clear to me how we're verifying what the actual root cause is. Code-analysis, for example, should not impact typing unless somethng has broken internally. It's run out of process and at low-priority. If it actually is slowing things down, then something is very messed up and needs to be fixed.
I haven't looked at those reports but I expect some people want to disable roslyn just to use another analysis tool.
I feel this feature is being looked at the wrong way in multiple ways. The core feature is:
IMO at the core, any tool with rich functionality has a much bigger value add if it configurable by the users to run as they want when they want. We should continue delivering productivity value add and never ever use these knobs as a way to de-prioritize bugs and regressions in configurable features - they are part of default experience for the tool and ought to be prioritized and fixed. Yes, there is possibility that some users would be less keen on providing reports or additional data to help us fix these if they can easily workaround it, and that makes fixing these harder for us, but that should never undermine the huge productivity boost that majority of customers get from the ability to take better control over its execution to meet their current requirements.
I also feel this should be implemented as multiple operational modes:
We should explicitly document what each mode enables or disables to allow users to make informed choices.
@mavasani I'm firmly behind the idea of different modes (or feature knobs) to provide a fundamentally different experience for users. I have no issue with that.
What i'm concerned about are links to unverified claims by people that "feature X is awful and making my experience slow, give me a way to shut it off". These are not valid claims in support of this work without actual verification and validation that the claims are true.
Note: i agree mostly with your breakdown of the features to offer. I would expand on one of them a bit:
Lightweight mode: Constrained by any of the factors above, and just wish minimum functionality and/or resource usage for an acceptable IDE experience.
I honestly think this should just be a set of options (and possibly one easy way to toggle all of them). What is 'lightweight' will be person dependent, and i think it would be 100% fine to allow individual knobs (and a top-level option) to let users opt out of particular features they would prefer to not have running right now.
As an example, i view "squiggles" versus "the error list" as very different features, even though they're entirely about diagnostics. I might want to disable squiggles, but leave on hte error list (or vice versa). I worry about us defining what "minimum functionality and/or resource usage for an acceptable IDE experience" is, rather than letting the user decide.
Thanks! :)
I agree with you @CyrusNajmabadi - we should not close or resolve any community feedback about potential bugs against this feature. Pointing this as a feature that could help them get unblocked easily in future is fine, but we should investigate all filed feedback reports.
Regarding multiple options- that was my initial implementation, but we felt it might overload the users with information. We will start with top level knobs and keep adding sub-options and tuning the defaults based on user feedback.
Regarding multiple options- that was my initial implementation, but we felt it might overload the users with information.
Personally, i'm skeptical about that. I think the knobs we would provide would be fairly clear and easy to enumerate for customers. But it's also not critical and can be something changed in the future. :)
we should not close or resolve any community feedback about potential bugs against this feature.
Agreed :)
Thanks!
@CyrusNajmabadi I have re-opened couple of DC feedback items that were about customers seeing real performance issues and requested them to provide performance traces. Couple other DC feedback items were actually customers requesting more control over the functionality in the IDE, not any performance issue.
Awesome!
Please we need and option to turn off live code analysis, so
Most professional shops now days are using laptops with cpu power management, you need to make sure the teams making these great tools are using hardware kit akin to the target audience please! I don鈥檛 want to move of VS, but I鈥檓 scratching my head, whilst making a cupa tea waiting for my ide to become responsive :(.
@deanvr
but I鈥檓 scratching my head, whilst making a cupa tea waiting for my ide to become responsive :(.
Note: Live Code Analysis shouldn't be affecting IDE responsiveness. If it is, that's just a straight up bug. Often times i've seen people report VS slowness against Roslyn when it's not roslyn at all (or at least, not live-code-analysis that is the problem).
If you are dealing with VS responsiveness issues, please file bugs using the instructions found here: https://github.com/dotnet/roslyn/wiki/Reporting-Visual-Studio-crashes-and-performance-issues#performance-issues
This will help get a perf trace to the Roslyn team so they can investigate and assign to the right team as appropriate (or keep in Roslyn if it really is a roslyn issue).
Thanks!
Most professional shops now days are using laptops with cpu power management, you need to make sure the teams making these great tools are using hardware kit akin to the target audience please!
FWIW, i use a dual core laptop, and i edit the Roslyn project itself without issues. Occasionally there are regressions that cause problems, and i try to file these issues myself to get them addressed. However, by and large, VS/Roslyn should work fine in these scenarios. If it isn't, then those are just perf problems that need to be root-cause fixed. Adding new features won't generally help here.
This feature requested has been implemented for VS2019 16.5 release. Let me summarize a few things here for clarity.
Visual Studio executes a bunch of background analyses while you are editing source files in the editor. Some of this is required minimal analysis for acceptable IDE editing experience, some of this is to improve responsiveness for IDE features by proactively analyzing closed files in the solution and some of this is to enable additional rich functionality (such as IDE code style suggestions). Based on the functionality, the analyses can be bucketed as follows:
Run on live analysis
checkbox on that property page is a per-user option that gets written to a .csproj.user file and is also respected for built-in IDE analyzer execution. However, if the configuration is a repo preference instead of a personal user preference, you can configure this at a solution level Directory.Build.props with the MSBuild property RunAnalyzersDuringLiveAnalysis
.Run Code Analysis
command to perform on-demand analyzer execution from top level Build
menu or top level Analyze
menu or from the Analyze and Code Cleanup
menu by right clicking the project/solution node in solution explorer. Prior to VS2019 16.5, this was used to run legacy FxCop analysis, but this command now runs Roslyn analyzers.Combining the above features, users can choose any of their preferred code analysis workflows for analyzer execution OR configure scope for all the Roslyn based background analysis.
We will ensure that the above support is documented when VS2019 16.5 is released. We will look forward to any further feedback on code analysis configuration support once these features are available.
For #38429: Users can now explicitly change the scope of all Roslyn based background analysis to current document from Tools Options. This includes all diagnostics computation. Note that the default scope is "Open Documents and Projects"
Have you considered allowing the radio button selection to depend on the active Windows power profile (high performance, on battery, etc.)? Was this discarded because of UI complexity?
Have you considered allowing the radio button selection to depend on the active Windows power profile (high performance, on battery, etc.)? Was this discarded because of UI complexity?
This was indeed suggested and considered, but I did not get to implementing it in the initial feature set. Feel free to file a separate issue.
@mavasani , should the "Background analysis scope" option be available in version 16.5.0 Preview 1.0? I just installed this version, but the option doesn't seem to be there
@dennis-yemelyanov It will be available in Preview 2
Most helpful comment
Update
This feature requested has been implemented for VS2019 16.5 release. Let me summarize a few things here for clarity.
What is "Live Code Analysis" for Managed projects?
Visual Studio executes a bunch of background analyses while you are editing source files in the editor. Some of this is required minimal analysis for acceptable IDE editing experience, some of this is to improve responsiveness for IDE features by proactively analyzing closed files in the solution and some of this is to enable additional rich functionality (such as IDE code style suggestions). Based on the functionality, the analyses can be bucketed as follows:
Feature requests
Support added in VS2019 16.5
Run on live analysis
checkbox on that property page is a per-user option that gets written to a .csproj.user file and is also respected for built-in IDE analyzer execution. However, if the configuration is a repo preference instead of a personal user preference, you can configure this at a solution level Directory.Build.props with the MSBuild propertyRunAnalyzersDuringLiveAnalysis
.Run Code Analysis
command to perform on-demand analyzer execution from top levelBuild
menu or top levelAnalyze
menu or from theAnalyze and Code Cleanup
menu by right clicking the project/solution node in solution explorer. Prior to VS2019 16.5, this was used to run legacy FxCop analysis, but this command now runs Roslyn analyzers.Combining the above features, users can choose any of their preferred code analysis workflows for analyzer execution OR configure scope for all the Roslyn based background analysis.
We will ensure that the above support is documented when VS2019 16.5 is released. We will look forward to any further feedback on code analysis configuration support once these features are available.