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

Typing "string;" sometimes inserts "strings;" #77926

Closed
alexandrudima opened this issue Jul 25, 2019 · 7 comments

Comments

@alexandrudima
Copy link
Member

commented Jul 25, 2019

Issue Type: Bug

VS Code version: Code - Insiders 1.37.0-insider (36e08fe, 2019-07-24T19:58:35.647Z)
OS version: Windows_NT ia32 10.0.17763

  • type string; very quickly. (ask @octref to type if you cannot repro :) )
  • embrace the rage of seeing strings; typed

intellisense

If you type string; slowly, then this does not reproduce... :/

fyi @jrieken

@alexandrudima alexandrudima changed the title Typing "string;" always inserts "strings;" Typing "string;" sometimes inserts "strings;" Jul 25, 2019

@jrieken

This comment has been minimized.

Copy link
Member

commented Jul 25, 2019

It's the design behaviour because strings is the top match and since editor.acceptSuggestionOnCommitCharacter is set to true by default. I think the discussion should be if this is a good default

Screenshot 2019-07-25 at 13 00 19

@alexandrudima

This comment has been minimized.

Copy link
Member Author

commented Jul 25, 2019

Kind of fishy is that string does not appear in that list...

@YoniChechik

This comment has been minimized.

Copy link

commented Jul 25, 2019

It's the design behaviour because strings is the top match and since editor.acceptSuggestionOnCommitCharacter is set to true by default. I think the discussion should be if this is a good default

Screenshot 2019-07-25 at 13 00 19

In my opinion it's a bad default! happens as well in python when typing:
import numpy as np
and the result is annoyingly:
import numpy as numpy

@mjbvz

This comment has been minimized.

Copy link
Contributor

commented Jul 25, 2019

@octref @alexandrudima Can you please share which project/file you are working in (and what TS version you have enabled). I can't repo

@alexandrudima

This comment has been minimized.

Copy link
Member Author

commented Jul 25, 2019

@mjbvz As I mentioned, reproducing has to do with typing speed, you need to be very fast. The gif is from self-host in VS Code and the status bar shows TypeScript 3.5.2 --

private _closeCharacter: string;

At the time I recorded the gif it reproduced 50% of the time. I have been working in VS Code at that time for > 5 hrs without killing the TS server. I have found it easier to reproduce if TS is "stressed" with errors... This somehow makes it easier for me to reproduce even with a fresh self-hosting environemnt e.g.
image


@jrieken After a lot of attempts, now it reproduces 20% of the time even if I type the accepting character ; slowly and only after a flash is observable in the suggest list. I am not pressing arrow down nor moving the mouse or anything like that, string is typed in the editor, string is selected in the suggest list, yet strings is inserted (the second choice) when I press ;... Notice the weird flicker in rendering over strings. Only when the flicker appears does the insertion go bad:

wth

@jrieken jrieken added this to the July 2019 milestone Jul 26, 2019

@jrieken

This comment has been minimized.

Copy link
Member

commented Jul 26, 2019

Debugged this with @alexandrudima and it turns out that the suggest widget isn't always cancelling details requests and subsequently splicing the wrong elements, e.g. strings occurs as suggestion 1 and 2. That causes flicker but doesn't explain the commit character behaviour...

@jrieken

This comment has been minimized.

Copy link
Member

commented Jul 29, 2019

@alexandrudima please report back if this still happen for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.