-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Allow EditorManager to Open with Selection before Attachment #9004
Allow EditorManager to Open with Selection before Attachment #9004
Conversation
3b4e2fd
to
baaf722
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some syntax errors (missing semicolon) which failed the build.
We may want to rebase the pull-request on master
to resolve the issue with downloading the builtin extensions.
baaf722
to
20a0a3a
Compare
@colin-grant-work looks like there is two different Colin authors :) |
I keep trying to expunge the other one from the git history, but he's quite persistent! I'll make another attempt... |
20a0a3a
to
1622c24
Compare
I believe the ghost has been banished, and the code seems to be up to date, despite a slow pipeline between my fork and this PR. |
a0afbdc
to
6060fe7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colin-grant-work the changes look good to me, and they fix the described issue 👍
This commit ensures that if a selection is passed to the editor-manager when an editor is created, the selection is revealed before the widget is attached. Signed-off-by: Colin Grant <[email protected]>
6060fe7
to
06a5feb
Compare
Signed-off-by: Colin Grant [email protected]
What it does
This PR fixes #8955 by interposing
EditorManager.revealSelection
between the creation of an editor widget and its attachment / opening. Previously, an editor would be attached, either independently or as part of anEditorPreviewWidget
, and thenrevealSelection
would be called. As a consequence,EditorManager.onCurrentEditorChangedEmitter
was fired when the editor was picked up by the shell, beforerevealSelection
had been called, and the top of the file would always be added to the navigation stack. With this PR,revealSelection
can be called before the widget is picked up by the shell.Alternative solutions to the problem include:
revealSelection
is run and making the navigation system respond by removing the top of the relevant file from the top of the navigation stack. (Works pretty well)EditorManager
from firing theonCurrentEditorChanged
event for a widget that hasn't beenopen
ed yet. (Haven't tried, EditorPreviews - the most problematic case - do eventually callopen
.)get(OrCreate)ByUri
mechanism.How to test
Go back
Review checklist
Reminder for reviewers