vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Fixes pasting into quick outline does not reveal result

Open jeanp413 opened this issue 3 years ago • 8 comments

Fixes #166687

jeanp413 avatar Nov 21 '22 06:11 jeanp413

@jeanp413 Does this not feel too jumpy now with this change? Also, can you resolve the merge conflict?

TylerLeonhardt avatar Dec 06 '22 23:12 TylerLeonhardt

@TylerLeonhardt from my tests it's the same behavior as before, did you found a case where that's not the case?

jeanp413 avatar Dec 07 '22 03:12 jeanp413

The behavior is different when you type now. So using the similar steps as the issue:

Steps:

  • open native host main service
  • type "s" and then "e" and then "n"

Previous behavior: only when n is hit will it jump in the editor

Your PR behavior: first keypress it will jump in the editor

I found this PR by @jrieken which actually bumped that from 1 to 2: https://github.com/microsoft/vscode/pull/154247/files

Maybe he could chime in on this.

I wonder if a solution of "don't jump unless we have at least 3 characters in the query" would be a better mechanism. I believe that was the true intent of the code initially.

TylerLeonhardt avatar Dec 07 '22 21:12 TylerLeonhardt

Ah I see what you mean, but is it intended to ignore single letters symbols (I could name a method or variable with a single character and should be able to jump to them automatically)? I also found the PR you mention while investigating this but that was meant to be implement automatically show the select item under cursor, so maybe the behavior you describe was an unintended side effect :thinking:

jeanp413 avatar Dec 07 '22 21:12 jeanp413

Let's see if @jrieken can give us context. I guess I technically own this but I wanna get some historical context.

TylerLeonhardt avatar Dec 07 '22 22:12 TylerLeonhardt

Let's see if @jrieken can give us context. I guess I technically own this but I wanna get some historical context.

I didn't introduce this concept, just bumped the number of 1 to 2 because with automatic revealing there are now two events. I guess the logic (which I believe originates with @bpasero) is that quick outline shouldn't immediately highlight an item (yellow'ish background) but wait for the first real input

jrieken avatar Dec 08 '22 11:12 jrieken

Also, not that this doesn't reproduce when there is something to reveal (at the time of opening QP) so I guess the right fix is to ignore 1 or 2 events depending on the presence of positionToEnclose

jrieken avatar Dec 08 '22 11:12 jrieken

the right fix is to ignore 1 or 2 events

That's what { itemActivation: ItemActivation.NONE } does internally

jeanp413 avatar Dec 08 '22 15:12 jeanp413