Conversation
46c0d3c to
2af180a
Compare
test/autoCompletion.test.ts
Outdated
| result.items.map((i) => ({ label: i.label, insertText: i.insertText })), | ||
| [ | ||
| { | ||
| insertText: 'Test', |
There was a problem hiding this comment.
there should be '- Test' insert text, but it's another problem
There was a problem hiding this comment.
Can you file that as an issue?
There was a problem hiding this comment.
I fixed it in this PR the end...
2af180a to
519f984
Compare
| this.addSchemaValueCompletions(s.schema.items, separatorAfter, collector, types, 'value', true); | ||
| } else { | ||
| this.addSchemaValueCompletions(s.schema.items, separatorAfter, collector, types, 'value'); | ||
| this.addSchemaValueCompletions(s.schema.items, separatorAfter, collector, types, 'value', true); |
There was a problem hiding this comment.
unify the code for both scenarios. If a schema contains items it's an array. No need to check if type === 'object'
|
Hello @msivasubramaniaan, can I ask you for a review? |
gorkem
left a comment
There was a problem hiding this comment.
LGTM.
Needs to be rebased before I can merge and the failing CI (which looks like a GH problem) should clear with the rebase.
Another level of improvement to this PR would be to filter the items that are already on the array to avoid duplicate entries on the array. Approving this PR but please let me know if you are planning to add the improvement.
d0872b1 to
86a72ed
Compare
…-yaml-language-server into fix/suggest-hyphen-in-arrays
|
@gorkem , I don't think that there should be such a filter/condition 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
- Test2or don't you agree? did I understand you incorrectly? |
|
I found another related problem |
|
Correct, item uniqueness is determined by the schema. The current implementation does not take into account the |
What does this PR do?
- (array item)suggestion was missing for some specific situations, for example: enums.it worked ok for 1st item after a colon, but not for 2nd
after 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
bodyWhat 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 the
bodyproperty