[markers] enable single-click and keyboard arrow selection to navigate markers#5646
[markers] enable single-click and keyboard arrow selection to navigate markers#5646vince-fugnitto merged 1 commit intomasterfrom
Conversation
|
Question: while testing, I noticed the selected file opens, but the visible position of the line is not selected, could it be possible to highlight or select the line where the marker is pointing to, not just opening the file ? |
fangnx
left a comment
There was a problem hiding this comment.
Single-clicking works smoothly. As Jacques suggested, it would be better to set the focus to the specific line of the problem, but I guess that can be a different PR.
6036fa2 to
575edb2
Compare
|
@fangnx @lmcbout thanks guys, I updated the code, it should work a lot better now :) When a marker node is selected in the tree (through single-click or with the keyboard arrows) the corresponding marker in the editor should be revealed and highlighted without the cursor (so that the |
Files nodes are expanded using Enter, is this not sufficient? I actually prefer it this way, it means I can easily navigate to the file I want, press Enter and get the errors I care about. If I were to expand at each selection it'd take me much longer. |
lmcbout
left a comment
There was a problem hiding this comment.
Explanation about the "enter" key is fine, also for performance
Code looks OK
Testing: LGTM
Thanks @vince-fugnitto
|
@lmcbout thank you! I'll wait for others to give a review as well. |
|
|
||
| this.addClipboardListener(this.node, 'copy', e => this.handleCopy(e)); | ||
| this.toDispose.push(this.model.onSelectionChanged(selection => { | ||
| const node = selection[0]; |
There was a problem hiding this comment.
this event is fired even if someone programmatically select a node, you don't want to focus in this case
There was a problem hiding this comment.
I was following other designs from other tree-widgets which used the same event but I'll try using the suggestion you made.
There was a problem hiding this comment.
Could you point me to this code?
There was a problem hiding this comment.
Sure, there's a few other widgets that did it similarly to my initial implementation:
There was a problem hiding this comment.
It will bite there if someone trigers programmatic selection. I am not sure that a user then wants to have some editors pop up.
There was a problem hiding this comment.
It will bite there if someone trigers programmatic selection. I am not sure that a user then wants to have some editors pop up.
Should we file issues to track and fix them?
There was a problem hiding this comment.
Let's wait for someone to open. It is probably very rare case.
|
You should implement it explicitly by overriding |
Will this work when using the keyboard to select tree nodes and navigating? |
|
@vince-fugnitto No, when you should override other widget methods which are responsible for keyboard navigation. You cannot rely on generic selection event. |
d76c038 to
905c907
Compare
|
@akosyakov I overwrote the |
|
@vince-fugnitto yes, that's what i meant |
905c907 to
1c25288
Compare
Thank you for the feedback and your help implementing it better! |
|
@akosyakov are you fine with me merging the PR? |
akosyakov
left a comment
There was a problem hiding this comment.
I've only reviewed the code.
…markers Fixes #5003 - the current implementation of the `problems-widget` requires double-clicking nodes in order to navigate to the problems. This is an annoying behavior and inconsistent with vscode where if you single-click a marker the corresponding editor is revealed. The feature works both with single clicking markers, as well as selecting them with the keyboard arrow keys. Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
1c25288 to
d36a918
Compare

Fixes #5003
problems-widgetrequires double-clickingnodes in order to navigate to the problems. This is an annoying behavior and
inconsistent with vscode where if you single-click a marker the corresponding
editor is revealed. The feature works both with single clicking markers, as well
as selecting them with the keyboard arrow keys.
Signed-off-by: Vincent Fugnitto vincent.fugnitto@ericsson.com