Skip to content

Conversation

brian-mulier-p
Copy link

@brian-mulier-p brian-mulier-p commented Apr 4, 2025

What does this PR do?

Allows passing a gracefulMatches parameter to the completion handler so that if any sub schema has at least one property value that is matching, it will be in the completions list.

It allows extending matching when there is an exact match already. That is, currently if there is a sub schema that matches exactly what's in the node, and one that could match but has some additional required properties next to it, the one with required properties will not be returned because it has a "problem" which is not having one of the required property.

Also since the best match is initialized with the first of an anyOf regardless of if it has "problems" (due to callFromAutocomplete bypass), the outcomes is highly dependant of the order of the anyOf content. If the first element is a non-restrictive one, it will not have any "problems" and so only the ones without any will match.

When autocompleting I'd expect to have anything matched even if I haven't filled in the required properties yet.

Moreover, it also covers the case where you have, on the opposite, already filled some properties that are required in some anyOf elements but not on some others. In such case, if you have a less restrictive element, it should match, however with the previous behaviour it didn't because it had less "matchingPropertiesValues" so the compareTo was not in favor of it.

What issues does this PR fix or reference?

fixes #684
some duplicate changes of what's in #1037

Is it tested? How?

Unit tests + some visual testing on a monaco-yaml editor

brian-mulier-p added a commit to kestra-io/kestra that referenced this pull request Apr 4, 2025
brian-mulier-p added a commit to kestra-io/kestra that referenced this pull request Apr 4, 2025
brian-mulier-p added a commit to kestra-io/kestra that referenced this pull request Apr 4, 2025
@coveralls
Copy link

coveralls commented Apr 22, 2025

Coverage Status

coverage: 84.024% (+0.02%) from 84.005%
when pulling 9629755 on brian-mulier-p:main
into 87e80ef on redhat-developer:main.

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.

autocompletion problem when value is null inside anyOf object
2 participants