microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.06k stars 28.8k forks source link

Do not present ghost text when code is deleted or undone #229312

Open Tyriar opened 1 week ago

Tyriar commented 1 week ago

This is my main annoyance with ghost text, when I delete text I frequently end up accidentally triggering ghost text again, then undo and it fills again. Here are some cases when trying to put them together just now, but there is a case where I've accidentally triggered the ghost text ~3x times before I intentionally overrode my muscle memory and pressed escape to dismiss the ghost text.

I want to delete the line and indent

  1. Select line (end, shift+home)
  2. Backspace
  3. Tab, 🐛 ghost text is filled, not indenting

Image

  1. At this line https://github.com/microsoft/vscode/blob/90a07a11c27b2dcbf14cb0b01902b4f8aa32887d/src/vs/editor/browser/services/hoverService/hoverWidget.ts#L52
  2. Press enter
  3. Press r, eturn ghost text appears
  4. Press backspace, 🐛 return ghost text appears before being invalidated by a new request

This particular case where we keep old suggestions around means that the editor is less deterministic and slower to use. If I press backspace and tab, it will either complete the ghost text or indent, depending on how quickly I type 😱

Image

Ghost text remains when de-indenting

  1. In a markdown file
  2. Tab to indent after a list item, ghost text shows
  3. Shift+tab or backspace, 🐛 ghost text remains

Image

hediet commented 1 week ago

Thanks, that is very valuable feedback!

Tyriar commented 4 days ago

This is the loop I get myself into: shift+home, backspace, tab, ...

Image