Skip to content

[VsIntegration] Fix Max Entries completion option resetting to 25 - #2088

Merged
RobertvanderHulst merged 1 commit into
X-Sharp:devfrom
hpetriffer:fix/completion-max-entries
Sep 23, 2026
Merged

RobertvanderHulst merged 1 commit into
X-Sharp:devfrom
hpetriffer:fix/completion-max-entries

Conversation

@hpetriffer

@hpetriffer hpetriffer commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • XSUserControl.ReadControl: when loading a saved int into a NumericUpDown, the value was only accepted if Minimum <= value < Maximum; anything else fell back to Minimum. The value is now clamped to [Minimum, Maximum].
  • Completion options page: the Max Entries maximum is raised from 1000 to 10000.

Why

On Tools → Options → X# → Completion, setting Max Entries to 1000 (or higher, which the control caps at 1000) showed 25 the next time the page was opened. The < Maximum check treated the maximum itself as out of range. Pressing OK then saved 25, so the setting really changed, not only the display.

The fix is in the shared base class, so it applies to every NumericUpDown on the X# options pages.

Notes for reviewers

  • A higher Max Entries means more rows read from the code model DB per completion request, while the DB lock is held. The queries in XDatabase.prg stop reading once the limit is reached, so the cost only grows when there really are that many matches, for example a very short prefix in a large VO solution.
  • I deliberately did not add a SQL LIMIT. Several loops drop rows after the query (StartsWith after LIKE, where _ is a wildcard; empty namespaces), so LIMIT N would silently return fewer than N matches.

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 <noreply@anthropic.com>
@RobertvanderHulst
RobertvanderHulst merged commit a9f27ef into X-Sharp:dev Sep 23, 2026
2 checks passed
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.

2 participants