Ctrl-T to use word under cursor or current selection#30021
Conversation
|
@mihailik, |
|
@bpasero Can you please comment? Apart from general common sense UX, in practice this helps a lot navigating large (unfamiliar) codebases (such as VSCode). I tried to fit it with the existing design (which you @bpasero worked on), with the flag Additionally, the auto-picked word is pre-selected in the search box. That way user starting typing will instantly override the auto-picked word. Hope to get this in the VSCode, for our team's benefit -- and to help the community too. |
|
Also can you please suggest any examples for testing these classes? I'd love to follow the approach and spirit of the project in terms of testing and SDLC. Many thanks! |
|
I've figured out the place to stick the tests -- added there. |
|
@mihailik I do not understand why this has to be put down into the quick open action in such a generic way, can you not just add it to the action that opens the symbols picker since it is only used there? |
|
@bpasero it's because this.prefix is private, and set once in the constructor. In case of Ctrl-T it would change from one call to another. But that's a good point -- let me refactor it a different way, so the complexity resides in the descendant. And I need to update the tests too. |
|
@mihailik I think for As for |
…d preselecting the word in search too.
|
@bpasero done. Removed all the customisation from And I kept the piece where I've extracted |
|
BTW there are 2 failing tests in one (out of two) instances of Travis - due to 10s timeout. NOT related to my changes, might be flaky tests? https://travis-ci.org/Microsoft/vscode/jobs/252995386#L4241
|
|
@rebornix assigning you to review the change in |
|
@mihailik I like your approaching of avoiding code duplication but I don't think cc @roblourens |
|
I think it would be good if editor find and search could share a helper function with that code, but I don't know where to put it, since they don't share any code yet. |
|
Yes please. I will do the work, just guide me high level :-) BTW, being used from multiple places shall I write some tests too? Just give me some directions, please. |
|
Since I leave for vacation soon I am unassigning myself in favour of @roblourens and @rebornix (also within #29974). Change LGTM 👍 |
|
@mihailik I would suggest creating a new file called Besides, you can add a corresponding test file named as |
|
@mihailik LGTM, thanks for your help! Let me know when you think it's good to merge. |
…ction and with multiline selection.
|
How about that, with some unit tests too! :-D |
|
Actually wait, if no editor is open Ctrl-T now fails. Let me add some defensive checks. |
|
Fixed that, works without focused editor too now. |
|
@mihailik well done sir! |
Implements #29974