From 81ae0c7dac85647b1911f73f6e31fc3cd61dee57 Mon Sep 17 00:00:00 2001 From: Hansjoerg Petriffer Date: Wed, 23 Sep 2026 07:43:29 +0200 Subject: [PATCH] [VsIntegration] Fix Max Entries completion option resetting to 25 XSUserControl.ReadControl only accepted values strictly below the NumericUpDown Maximum and otherwise fell back to Minimum. Saving the maximum (1000) therefore showed 25 on the next load, and pressing OK persisted 25. The value is now clamped to [Minimum, Maximum]. Also raise the Max Entries maximum from 1000 to 10000. Co-Authored-By: Claude Opus 5.5 --- .../OptionsPages/CompletionOptionsControl.Designer.cs | 2 +- src/VisualStudio/LanguageService/OptionsPages/XSUserControl.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VisualStudio/LanguageService/OptionsPages/CompletionOptionsControl.Designer.cs b/src/VisualStudio/LanguageService/OptionsPages/CompletionOptionsControl.Designer.cs index 397799437c..a9e02c5b6f 100644 --- a/src/VisualStudio/LanguageService/OptionsPages/CompletionOptionsControl.Designer.cs +++ b/src/VisualStudio/LanguageService/OptionsPages/CompletionOptionsControl.Designer.cs @@ -278,7 +278,7 @@ private void InitializeComponent() // this.tbMaxEntries.Location = new System.Drawing.Point(104, 141); this.tbMaxEntries.Maximum = new decimal(new int[] { - 1000, + 10000, 0, 0, 0}); diff --git a/src/VisualStudio/LanguageService/OptionsPages/XSUserControl.cs b/src/VisualStudio/LanguageService/OptionsPages/XSUserControl.cs index 2d169f7cca..e3fe4d77f7 100644 --- a/src/VisualStudio/LanguageService/OptionsPages/XSUserControl.cs +++ b/src/VisualStudio/LanguageService/OptionsPages/XSUserControl.cs @@ -24,7 +24,7 @@ private void ReadControl(Control c, object options) } if (c is NumericUpDown number && val is int iValue) { - number.Value = iValue >= number.Minimum && iValue < number.Maximum ? iValue : number.Minimum ; + number.Value = Math.Max(number.Minimum, Math.Min(number.Maximum, iValue)); } if (c is TextBox tb) {