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

Create a new line for edits after the document #717

Merged
merged 4 commits into from Sep 14, 2019

Conversation

tomv564
Copy link
Contributor

@tomv564 tomv564 commented Sep 13, 2019

Fixes #690 where gopls is returning edits for a line that doesn't exist - this happens to work with VS Code because implementation details.

To do:

  • remove list constructor so we can just pass an iterator from sorted in sort_by_application_order (Did not work with reversed)
  • update comments in the test case

@coveralls
Copy link

coveralls commented Sep 13, 2019

Coverage Status

Coverage decreased (-0.09%) to 37.072% when pulling 4626a77 on handle-edits-beyond-last-line into a630fcd on master.

rwols
rwols previously approved these changes Sep 14, 2019
plugin/edit.py Outdated
# Handle when a language server (eg gopls) inserts at a row beyond the document
# some editors create the line automatically, sublime needs to have the newline prepended.
if start[0] > last_row and newText[0] != '\n':
newText = '\n' + newText
Copy link
Member

Choose a reason for hiding this comment

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

Looks like an OK workaround.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the test you wrote and the research!

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.

Formatting adding trailing newline clears last line
3 participants