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

Indentation is removed for guests when they try to type if auto-save and trim trailing whitespace are enabled #4920

Open
MaddyGuthridge opened this issue May 7, 2023 · 1 comment

Comments

@MaddyGuthridge
Copy link

Describe what happened:
I (the host) have the settings "files.autoSave": "afterDelay" and "files.trimTrailingWhitespace": true enabled.

Whenever a guest tries to type, any indentation on the line they are typing is removed as soon as they begin typing, meaning they need to manually fix indentation for every line of code that they type.

What was your system configuration?
Product and Version [VS/VSCode]: 1.77.3
OS Version[macOS/Windows]: Fedora 37
Live Share Extension Version: v1.0.5864
Target Platform or Language [e.g. Node.js]: C

Steps to Reproduce / Scenario:

  1. Have host enable "files.autoSave": "afterDelay" and "files.trimTrailingWhitespace": true in their settings
  2. Have a guest attempt to type a line that is indented
  3. Observe that their indentation is lost as soon as they begin typing

This seems like a rehashing of #1186, but I am creating a new issue due to the age of the old one (close to 5 years). I am unwilling to disable auto-save, since that is a workflow-breaker for me, and it seems like a workaround rather than a solution.

@pbiggar
Copy link

pbiggar commented Aug 11, 2023

I had the same experience. My colleague and I both had autosave enabled. The host has autosave set to "after-delay", I (gust) had autosave "onFocusChange".

If I type a space, then pause (eg to think, or let copilot generate code), the host's machine autosaves, removing the space(s), and resetting my cursor to a different position.

This causes lots of errors depending on when it happens and what I'm doing, but some examples:

  • accidentally type two words without a space (syntax error)
  • moves my cursor to the start of a line (have to reindent - but then it does it again)
  • copilot stops inferring
  • pops me out of Vim mode's insert mode

It makes VSCode basically unusable.

It would seem that VSCode should only autosave for the author of an edit perhaps?

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

No branches or pull requests

2 participants