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

While on Live Share, docstring quotes always auto-inserted at host's cursor #1583

Closed
aely-aronoff opened this issue Jul 20, 2021 · 7 comments
Assignees
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@aely-aronoff
Copy link

TL;DR: On Live Share, if a remote machine types three quotes, a matching set of three quotes appears at the host machine's terminal instead of the remote machine.

First reported in: microsoft/vscode#127910 (comment)
Check there for additional details.

Environment data

Host machine:

  • VS Code version: Code 1.57.1 (507ce72a4466fbb27b715c3722558bb15afa9f48, 2021-06-17T13:28:07.755Z)
  • Extension version (available under the Extensions sidebar): 2021.6.944021595
  • OS and version: Windows_NT x64 10.0.19042
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.9.1 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python-related VS Code extensions and their versions: vsliveshare v1.0.4583
  • Value of the python.languageServer setting: default, which is I think pylance

Remote machine:

  • VS Code version: Code 1.58.2
  • Extension version (available under the Extensions sidebar): 2021.6.944021595
  • OS and version: 11.1 macOS Big Sur
  • Relevant/affected Python-related VS Code extensions and their versions: vsliveshare v1.0.4583

Expected behaviour

While using Live Share, if one of the participants types quote (") three times to create a docstring, the other three quotes should appear at their cursor.

Actual behaviour

The second set of three quotes appears at the host's cursor. See full description in: microsoft/vscode#127910 (comment).

The issue was moved to the live-share repo: microsoft/live-share#4353.

Steps to reproduce:

  1. With VS Code on a host machine and remote machine, start a Live Share session and connect with remote.
  2. Have both machines open the same Python file.
  3. On host machine, type three quotes. Docstring should insert correctly.
  4. On remote machine, type three quotes.
  5. Expected behavior is that three more quotes appear at remote machine's cursor, but instead they appear at host's cursor.
@karthiknadig karthiknadig self-assigned this Jul 21, 2021
@karthiknadig
Copy link
Member

These quotes are filled in by pylance. So I will move this issue over to Pylance for investigation.

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Jul 22, 2021
@jakebailey
Copy link
Member

I suspect this is an issue with the Python extension - they're probably listening for the triple quotes being typed, and then inserting the closing triple quotes. They should only be doing that if the opening triple quotes were typed by the local user.

This one is interesting; I don't know if the event stream indicates who is the one typing...

@jakebailey
Copy link
Member

I should be able to fix this by not using the cursor at all, but instead use the location of the typing.

@judej judej added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Jul 22, 2021
@github-actions github-actions bot removed the triage label Jul 22, 2021
@jakebailey jakebailey added the bug Something isn't working label Jul 22, 2021
@jakebailey
Copy link
Member

This issue has been fixed in version 2021.7.5, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202175-22-july-2021

@aely-aronoff
Copy link
Author

@jakebailey, good news and bad news.

Good news: The original bug was fixed. Docstring quotes are now inserted at the remote cursor instead of at the host.
Bad news: There's now a new bug where the host's cursor gets moved to the remote's cursor when the docstring quotes are inserted.

Would you like me to submit a new issue for that?

@jakebailey
Copy link
Member

jakebailey commented Jul 22, 2021

Ugh, so close. Do file a new issue and we can continue there.

I'm a bit at a loss of how to prevent that. VS Code text edits are really finnicky when they are at the cursor. Best would be for VS Code to support multi-character auto-close itself, rather than me implementing it.

@aely-aronoff
Copy link
Author

Opened ticket #1592

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

4 participants