提交 16bfb5d2 编写于 作者: H Heejae Chang

some changes following PR feedback.

now, we will automatically re-enable full solution analysis (if user didn't explicitly disabled it) when new solution is opened.
上级 de4c8533
......@@ -9,6 +9,7 @@
using Microsoft.CodeAnalysis.Internal.Log;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Shared.Options;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.CodeAnalysis.Versions;
using Roslyn.Utilities;
......@@ -329,6 +330,9 @@ private void ProcessSolutionEvent(WorkspaceChangeEventArgs e, IAsyncToken asyncT
private void OnSolutionAdded(Solution solution)
{
// first make sure full solution analysis is on.
_optionService.SetOptions(solution.Workspace.Options.WithChangedOption(RuntimeOptions.FullSolutionAnalysis, true));
var asyncToken = _listener.BeginAsyncOperation("OnSolutionAdded");
_eventProcessingQueue.ScheduleTask(() =>
{
......
......@@ -439,7 +439,7 @@ internal class ServicesVSResources {
}
/// <summary>
/// Looks up a localized string similar to Full solution analysis disabled due to low memory. go to tools-&gt;options and search &quot;Enable full solution analysis&quot; to turn it back on or restart VS to restore full solution analysis..
/// Looks up a localized string similar to Low memory detected. Full solution analysis disabled for this solution..
/// </summary>
internal static string FullSolutionAnalysisOff {
get {
......
......@@ -514,6 +514,6 @@ Use the dropdown to view and switch to other projects this file may belong to.</
<value>Synchronizing with {0}...</value>
</data>
<data name="FullSolutionAnalysisOff" xml:space="preserve">
<value>Full solution analysis disabled due to low memory. go to tools-&gt;options and search "Enable full solution analysis" to turn it back on or restart VS to restore full solution analysis.</value>
<value>Low memory detected. Full solution analysis disabled for this solution.</value>
</data>
</root>
\ No newline at end of file
......@@ -38,11 +38,12 @@ public AbstractOptionPageControl(IServiceProvider serviceProvider)
protected void BindToOption(CheckBox checkbox, Option<bool> optionKey)
{
Binding binding = new Binding();
binding.Source = new OptionBinding<bool>(OptionService, optionKey);
binding.Path = new PropertyPath("Value");
binding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
var binding = new Binding()
{
Source = new OptionBinding<bool>(OptionService, optionKey),
Path = new PropertyPath("Value"),
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};
var bindingExpression = checkbox.SetBinding(CheckBox.IsCheckedProperty, binding);
_bindingExpressions.Add(bindingExpression);
......@@ -50,11 +51,12 @@ protected void BindToOption(CheckBox checkbox, Option<bool> optionKey)
protected void BindToOption(CheckBox checkbox, PerLanguageOption<bool> optionKey, string languageName)
{
Binding binding = new Binding();
binding.Source = new PerLanguageOptionBinding<bool>(OptionService, optionKey, languageName);
binding.Path = new PropertyPath("Value");
binding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
var binding = new Binding()
{
Source = new PerLanguageOptionBinding<bool>(OptionService, optionKey, languageName),
Path = new PropertyPath("Value"),
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};
var bindingExpression = checkbox.SetBinding(CheckBox.IsCheckedProperty, binding);
_bindingExpressions.Add(bindingExpression);
......@@ -62,11 +64,12 @@ protected void BindToOption(CheckBox checkbox, PerLanguageOption<bool> optionKey
protected void BindToOption(TextBox textBox, Option<int> optionKey)
{
Binding binding = new Binding();
binding.Source = new OptionBinding<int>(OptionService, optionKey);
binding.Path = new PropertyPath("Value");
binding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
var binding = new Binding()
{
Source = new OptionBinding<int>(OptionService, optionKey),
Path = new PropertyPath("Value"),
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};
var bindingExpression = textBox.SetBinding(TextBox.TextProperty, binding);
_bindingExpressions.Add(bindingExpression);
......@@ -74,11 +77,12 @@ protected void BindToOption(TextBox textBox, Option<int> optionKey)
protected void BindToOption(TextBox textBox, PerLanguageOption<int> optionKey, string languageName)
{
Binding binding = new Binding();
binding.Source = new PerLanguageOptionBinding<int>(OptionService, optionKey, languageName);
binding.Path = new PropertyPath("Value");
binding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
var binding = new Binding()
{
Source = new PerLanguageOptionBinding<int>(OptionService, optionKey, languageName),
Path = new PropertyPath("Value"),
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};
var bindingExpression = textBox.SetBinding(TextBox.TextProperty, binding);
_bindingExpressions.Add(bindingExpression);
......@@ -86,11 +90,12 @@ protected void BindToOption(TextBox textBox, PerLanguageOption<int> optionKey, s
protected void BindToFullSolutionAnalysisOption(CheckBox checkbox, string languageName)
{
Binding binding = new Binding();
binding.Source = new FullSolutionAnalysisOptionBinding(OptionService, languageName);
binding.Path = new PropertyPath("Value");
binding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
Binding binding = new Binding()
{
Source = new FullSolutionAnalysisOptionBinding(OptionService, languageName),
Path = new PropertyPath("Value"),
UpdateSourceTrigger = UpdateSourceTrigger.Explicit
};
var bindingExpression = checkbox.SetBinding(CheckBox.IsCheckedProperty, binding);
_bindingExpressions.Add(bindingExpression);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册