Added Jsx Snippet Completion feature by armanio123 · Pull Request #45903 · microsoft/TypeScript (original) (raw)
We can only provide with one completion for each attribute
This isn’t true, but it is typical of current completions. I did think about an approach like @Jack-Works mentioned, but I personally didn’t find it compelling. It takes very few keystrokes to get from checked
to checked={|cursor here|}
, and moving my fingers away from the home row to the arrow keys is more disruptive to my flow than typing those characters. More importantly, if VS Code ends up auto-selecting one of the longer options when you really want the short option, it’s super annoying. This is partly beyond our control since VS Code has their own settings and logic that can influence the pre-selected completion item. I do think it’s worth exploring these kinds of completions as we expand our snippet support, and I’m happy to hear other opinions, but I am initially biased against this one. Like Armando said, we’re starting out filling in the minimal high-confidence completion because typing code you do want is generally preferable to backspacing code you don’t want but got anyway, at least up to a point.