-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix array completion in the middle of the empty text #697
fix array completion in the middle of the empty text #697
Conversation
@@ -2364,10 +2364,44 @@ describe('Auto Completion Tests', () => { | |||
}); | |||
|
|||
const content = 'test:\n - and\n - - '; | |||
const completion = await parseSetup(content, 19); | |||
|
|||
const completion = await parseSetup(content, 20); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous index 19 is probably not correct. index 20 is the end of the content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has cases where it does not insert valid YAML
) { | ||
node = nullNode; | ||
originalNode = node; | ||
overwriteRange.end.character += nullNode.range[2] - offset; // extend range to the end of the null element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is going to be enough to insert a valid yaml. The overwriteRange.start.character
should be adjusted so that there is no extra space between -
and the inserted value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I'll have a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean this one?
Screen.Recording.2022-04-08.at.11.22.09.mov
hard to say, it looks ugly (extra indent), but the yaml is valid I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in my tests when I inject a single item editor marks it as invalid.
What does this PR do?
fix array completion when the cursor is in the middle of the empty text
before:
array.indent.notok.mov
after:
array.indent.ok.mov
schema for this test
What issues does this PR fix or reference?
no ref
Is it tested? How?
added UT,
modified existing one