microsoft / vscode

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

editor.suggest.preview looks indistinguishable from comment in bash file #132852

Closed LinqLover closed 3 years ago

LinqLover commented 3 years ago

Does this issue occur when all extensions are disabled?: No

Steps to Reproduce:

  1. Turn on the setting editor.suggest.preview
  2. Install GitHub Pull Requests extension
  3. Open a GH repository that has at least one open issue/PR
  4. Open a bash file in it
  5. At the beginning of a non-empty line, type a #:

    image

Unfortunately, there is no difference in the representation of the actual line (#exit 2) and the suggestion preview (#75). Different colors or text styles should be used.

While I reproduced this issue together with two extensions only, I have the impression that this might be a general issue with this setting since VS Code does not make sure the display format for suggestion previews is unique.

hediet commented 3 years ago

I understand the problem, but it is really hard to find a good compromise.

132017 is also related.

Any suggestions how to fix this (@misolori)?

LinqLover commented 3 years ago

Always style these previews in italic font?

miguelsolorio commented 3 years ago

An alternative would be to use a different color as this really depends on each theme, do we have a color token for the suggest preview text?

hediet commented 3 years ago

An alternative would be to use a different color as this really depends on each theme, do we have a color token for the suggest preview text?

Yes! There is editorGhostText.foreground and editorGhostText.border

LinqLover commented 3 years ago

Here is another UX drawback I experienced in connection with inline previews: Spaces that are part of a suggestion are not distinguishable from real spaces in the file.

For example, in this file using the Latex Workshop extension:

image

The space is part of the suggestion. If I press arrow + right in this situation, the space will suddenly disappear which caused confusion for me. Maybe this could also be improved, e.g., by using some kind of underscore or background styling for spaces in the ghost style?

hediet commented 3 years ago

@LinqLover thanks for the screenshot! So the line content of the file on disk is actually just \itemIn?

LinqLover commented 3 years ago

@hediet Very exactly.

miguelsolorio commented 3 years ago

I think there are two options:

Italicize the suggest preview, this would align with the inline suggestions in autocomplete changes:

image

Adjust the color of the ghost text. This one would be on a per-theme basis and depend on the comment color token, but it leaves a less-desirable look:

image

LinqLover commented 3 years ago

Italic looks better to me. Is there a risk that certain themes or language extensions might italicize text as well?

miguelsolorio commented 3 years ago

Just in the same way that there will be themes that conflict with the colors of ghost text, the same can happen for text so it is a possibility. I think it comes down to how likely users are to run into these issues and if it warrants a fix.

hediet commented 3 years ago

Italicize the suggest preview, this would align with the inline suggestions in autocomplete changes

And then you would make the preview of the inline suggestion when the suggest widget is shown non-italic?

miguelsolorio commented 3 years ago

@hediet I was wondering whether it would make sense for the ghost text to always be italicized except when there are inline suggestions, so that there is less differences between these two states:

CleanShot 2021-09-13 at 12 11 46@2x

what do you think?

hediet commented 3 years ago

I think that makes sense. It would basically swap italic ghost text with non-italic ghost text.

LinqLover commented 3 years ago

Thank you for fixing this! :-)

What is about the indistinguishable whitespace from suggestions (see https://github.com/microsoft/vscode/issues/132852#issuecomment-918106411)? Shall I open a new issue for this?

hediet commented 3 years ago

Yes please! Please ping me in the issue.