Skip to content

Backport REPL changes for Swift REPL completion fix #678

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

Merged

Conversation

Teemperor
Copy link

@Teemperor Teemperor commented Jan 28, 2020

Those are the non-swift changes for #679

Pavel's commit is a back port. The change to the REPL interface is a commit I'll push tomorrow and the fix for the CompletionRequest is a new commit for this branch (as I already deleted the wrong code upstream).

labath and others added 2 commits January 28, 2020 23:10
In some environments (typically, buildbots), this variable may not be
available. This can cause tests to behave differently.

Explicitly set the variable to "vt100" to ensure consistent test
behavior. It should not matter that we do not inherit the process TERM
variable, as the child process runs in a new virtual terminal anyway.
…ong result

By using m_cursor_index and not m_raw_cursor_pos in this function
we return the characters until the argument index (not the character index).

This means that for "foo" (cursor at the end of the string)
this returns "" instead of "foo" (as the argument index is 0 for the
first argument and not 4 which is the character index at the end).

This lead to a crash in the REPL completion where it would cause that
we would complete the string "ABC" to "     " as we think the line
is actually empty and we want to provide the indentation string.

Note that the function has already been deleted upstream so this bug
doesn't exist there.
@dcci dcci requested review from fredriss and removed request for JDevlieghere January 28, 2020 22:15
@dcci
Copy link
Member

dcci commented Jan 28, 2020

@fredriss has to approve this.

Copy link

@JDevlieghere JDevlieghere left a comment

Choose a reason for hiding this comment

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

Thanks!

@Teemperor
Copy link
Author

@swift-ci test

@dcci
Copy link
Member

dcci commented Jan 28, 2020

@Teemperor are these commits upstream, and then cherry-picked? Doesn't look like it.

@dcci
Copy link
Member

dcci commented Jan 28, 2020

[except for Pavel's]

…tion code to old API

Any REPL client should just move to CompletionRequest instead of relying on
the translation code from the old API, so let's remove that translation code.
@Teemperor
Copy link
Author

Now the PR has:

  • Backport from Pavel's commit.
  • My own change to CompletionRequest that isn't a backport as the code upstream is already deleted.
  • Backport of the REPL API change that I just pushed and now back ported.

@fredriss
Copy link

@swift-ci test macOS

@Teemperor
Copy link
Author

Alright, I'll merge this now and then check on the automerger and let's see how that goes.

@Teemperor Teemperor merged commit 8f5afa7 into swiftlang:apple/stable/20190619 Jan 29, 2020
@fredriss
Copy link

Please make sure to take those on the new stable branch

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.

5 participants