Skip to content
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

Add 'doDocumentOnTypeFormatting' implementation #389

Merged
merged 7 commits into from
Jan 18, 2021

Conversation

evidolob
Copy link
Collaborator

@evidolob evidolob commented Jan 12, 2021

What does this PR do?

Add implementation for doDocumentOnTypeFormatting feature.
It allows to format text as user typing. This implementation reacts on new line character and add proper indentation. Also it automatically add - for array items if previous line contains list simple array item(not map or array).

Demo:

Screen.Recording.2021-01-12.at.10.51.07.mov

What issues does this PR fix or reference?

redhat-developer/vscode-yaml#179

Is it tested? How?

If you want to test it manually you need to make sure that you enable "editor.formatOnType" for yaml files, see first few second on demo.

@evidolob evidolob requested review from gorkem and JPinkney January 12, 2021 09:02
@evidolob evidolob self-assigned this Jan 12, 2021
@coveralls
Copy link

coveralls commented Jan 12, 2021

Coverage Status

Coverage decreased (-0.2%) to 76.175% when pulling d0997d7 on evidolob:add-on-type-formatting into c16eaa0 on redhat-developer:master.

@evidolob evidolob requested a review from joshuawilson January 12, 2021 12:19
@JPinkney
Copy link
Contributor

This looks like a really cool feature. I usually never use formatOnType but in this case it seems really useful

@evidolob evidolob marked this pull request as ready for review January 13, 2021 12:21
Signed-off-by: Yevhen Vydolob <[email protected]>
Copy link
Contributor

@JPinkney JPinkney left a comment

Choose a reason for hiding this comment

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

LGTM, I think you just need to rebase it

test/yamlOnTypeFormatting.test.ts Outdated Show resolved Hide resolved
…rver into add-on-type-formatting

Signed-off-by: Yevhen Vydolob <[email protected]>
Signed-off-by: Yevhen Vydolob <[email protected]>
Signed-off-by: Yevhen Vydolob <[email protected]>
Signed-off-by: Yevhen Vydolob <[email protected]>
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.

3 participants