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

fix: completion in the middle of the empty text #696

Conversation

p-spacek
Copy link
Contributor

@p-spacek p-spacek commented Apr 5, 2022

What does this PR do?

fix completion when the cursor is in the middle of the empty text

compleion-in-the-middle-of-the-empty-text.mov

What issues does this PR fix or reference?

no ref

Is it tested? How?

added UT

@coveralls
Copy link

coveralls commented Apr 5, 2022

Coverage Status

Coverage decreased (-0.05%) to 82.188% when pulling 7e3e98d on p-spacek:fix/completion-in-the-middle-of-the-empty-text into 9cfb0c7 on redhat-developer:main.

Copy link
Collaborator

@gorkem gorkem left a comment

Choose a reason for hiding this comment

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

LGTM

@gorkem
Copy link
Collaborator

gorkem commented Apr 7, 2022

Should this also work for boolean properties ?

@p-spacek
Copy link
Contributor Author

p-spacek commented Apr 8, 2022

Should this also work for boolean properties ?

Screen.Recording.2022-04-08.at.10.55.17.mov

it seems ok.

but there are probably more other similar problems with not vert valid YAML structure when users expect correct behaviour.
It's possible to fix one by one and add more and more conditions/fallbacks. But I thought that there could be also an approach to modify yaml before yamlCompletion.doComplete evaluates the result.
For example modify (temporary without modification of the original file)

  • 'prop:' -> 'prop: ' then evaluation of the completion items
  • '-' -> '- '
  • 'prop: # ' -> 'prop: #' (#means cursor position)
  • 'prop:      ' -> 'prop: '

and others.

so maybe next time, we can try the cleanup befo parsing of the yaml?

@gorkem
Copy link
Collaborator

gorkem commented Apr 8, 2022

Thanks for testing it.

@msivasubramaniaan
Copy link
Contributor

@p-spacek it needs a rebase.

@msivasubramaniaan msivasubramaniaan merged commit 840a2d9 into redhat-developer:main Apr 11, 2022
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.

4 participants