Open p-spacek opened 1 year ago
Hello @msivasubramaniaan, can I ask you for a review?
@gorkem , I don't think that there should be such a filter/condition because schema
{
type: 'object',
properties: {
references: {
type: 'array',
items: {
enum: ['Test', 'Test2'],
},
},
}
doesn't define that items of the array have to be unique. To be honest I am not sure how to define this (unique array items)...
This should be allowed based on the schema
items:
- Test1
- Test1
- Test2
or don't you agree? did I understand you incorrectly?
I found another related problem So I converted this PR to a draft I'll try to fix it at once
Correct, item uniqueness is determined by the schema. The current implementation does not take into account the uniqueItems
flag. An improvement to the current implementation would be checking this flag and filtering accordingly. In general, code assist should not suggest values leading to syntax errors, even though it is a trivial fix.
What does this PR do?
1)
- (array item)
suggestion was missing for some specific situations, for example: enums. it worked ok for 1st item after a colon, but not for 2ndafter fix:
UPDATE I extended this PR because there were related issues, with a tiny update of this original problem, I can fix another 2 problems: 2) auto add
-
when hyphen is missingchoose item will produce incorrect yaml
3) The default snippet with a simple string will produce this weird result when the string value is defined in snippet
body
What issues does this PR fix or reference?
no ref
Is it tested? How?
modified existing added one test for the enum
- array items
-
added test for default snippets with string value in thebody
property