X Tutup
The Wayback Machine - https://web.archive.org/web/20230402004114/https://github.com/microsoft/vscode/pull/112389
Skip to content
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

add option for preview navigation behavior #112389

Merged
merged 6 commits into from Dec 15, 2020

Conversation

goldst
Copy link
Contributor

@goldst goldst commented Dec 13, 2020

This PR fixes #112348
Let me know whether the description text of the new option is ok, so I can fix it if necessary.

@microsoft-cla-retired
Copy link

microsoft-cla-retired bot commented Dec 13, 2020

CLA assistant check
All CLA requirements met.

@bpasero bpasero added this to the January 2021 milestone Dec 14, 2020
'workbench.editor.enablePreviewFromCodeNavigation': {
'type': 'boolean',
'description': nls.localize('enablePreviewFromCodeNavigation', "Controls whether preview editors should be kept open as regular editors when opening a second editor from the preview (e.g. via go to definition)"),
'default': true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'default': true
'default': false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? In my implementation true means new behavior (keeping old preview editor open). Your suggestion would make the old behavior default again. I can also change it to false means new behavior, if that's what you mean.

@@ -75,7 +77,9 @@ export class CodeEditorService extends CodeEditorServiceImpl {
// should be pinned or not. This ensures that the source of a navigation
// is not being replaced by the target. An example is "Goto definition"
// that otherwise would replace the editor everytime the user navigates.
const pinPreview = this.configurationService.getValue<boolean>('workbench.editor.enablePreviewFromCodeNavigation');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if we would lookup this setting similar to how we do it here:

const editorConfig = this.configurationService.getValue<IWorkbenchEditorConfiguration>().workbench.editor;

Aka add it to IWorkbenchEditorConfiguration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it, thanks for the pointer

@goldst
Copy link
Contributor Author

goldst commented Dec 14, 2020

@bpasero, would you please help me with the macOS Integration Tests? I'm not sure why it fails all of a sudden, I don't think I changed anything that could cause a timeout... is there a way to restart it?

@bpasero bpasero merged commit a1f815a into microsoft:master Dec 15, 2020
1 of 2 checks passed
@bpasero
Copy link
Member

bpasero commented Dec 15, 2020

Thanks 🥂

@goldst goldst deleted the preview-code-navigation branch December 15, 2020 14:02
myovan pushed a commit to myovan/vscode that referenced this pull request Dec 29, 2020
* add option for preview navigation behavior microsoft#112348

* fix test to comply with changes for microsoft#112348

* fix test to comply with changes for microsoft#112348

* get pinPreview using IWorkbenchEditorConfiguration

* adjust for changes

Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to switch to previous behavior on 1.52.0 'Preview editor improvements'
2 participants
X Tutup