Skip to content

fix: preserve completions for nullable string defaults - #1373

Merged
datho7561 merged 1 commit into
redhat-developer:mainfrom
Eshan05:fix/1369-null-schema-default-completion
Oct 22, 2026
Merged

datho7561 merged 1 commit into
redhat-developer:mainfrom
Eshan05:fix/1369-null-schema-default-completion

Conversation

@Eshan05

@Eshan05 Eshan05 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes missing completion suggestions when a nullable string property has default: null. The object snippet builder passes null to toYamlStringScalar, which throws and stops adding suggestions.

Only call the formatter for strings, for both required and optional properties. Null defaults remain unquoted, and the string "null" remains quoted.

What issues does this PR fix or reference?

Fixes #1369

Is it tested? How?

Added four regression tests covering required and optional properties with null and "null" defaults.

The following commands passed locally on Windows with Node.js 22.13.0, npm 10.9.2, and the lockfile's TypeScript 6.0.3:

npm ci
npm run build
npm run coveralls

The full suite passed with 1,389 tests passing, 1 skipped, and 0 failures.

Avoid passing null defaults to the string scalar formatter.
Add regression tests for required and optional properties.

Fixes #1369

Signed-off-by: Eshan05 <nahareshan05@gmail.com>
@Eshan05
Eshan05 requested a review from datho7561 as a code owner October 22, 2026 18:40

@datho7561 datho7561 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixes the problem from my testing. Thanks, @Eshan05 !

@datho7561
datho7561 merged commit 7e8061c into redhat-developer:main Oct 22, 2026
4 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.

Completion stops listing properties after one with "default": null

2 participants