Make SwitchHeaderSource use workbench.editor.revealIfOpen setting#8857
Make SwitchHeaderSource use workbench.editor.revealIfOpen setting#8857sean-mcmanus merged 10 commits intomicrosoft:mainfrom
Conversation
headerSourcePaneJumping controls whether the SwitchHeaderSource command will jump to a different editor split if the destination file is already visible.
sean-mcmanus
left a comment
There was a problem hiding this comment.
Seems fine to me, other than the one comment.
…de-cpptools into updateSwitchHeaderSource
|
Hi @sean-mcmanus, thanks for looking at this. I'm happy to change any of the naming/text if there's a a way to phrase things that better aligns with the project's terminology. |
|
Is there any desire for this to be a more general setting to cover any cases where we would open/focus a text editor? (For example, goto definition) |
|
As far as I can tell, Go to Definition, Go To Declaration, and Go To Type Definition all operate within the focused editor. |
|
If the definition is outside the current document, we should be opening a new file. But I forget whether that is done by vscode or us. |
There was a problem hiding this comment.
Instead of adding a new setting, maybe the switching should read the VS Code workbench.editor.revealIfOpen setting unless I'm misunderstanding that setting or there's a reason to separate out this particular case? I think that defaults to false. i.e. check the result of vscode.workspace.getConfiguration("workbench.editor.revealIfOpen ".
|
@sean-mcmanus - I'll take a look at this. I did not know about this setting, but it sounds like making SwitchHeaderSource obey it will do what I want. |
This change makes the SwitchHeaderSource command respect the workbench.editor.revealIfOpen setting.
C_Cpp.SwitchHeaderSourcehas different behavior depending on whether the destination file is visible in a different editor pane or not. This commit adds an optionheaderSourcePaneJumpingwhich controls whether the command will jump to a different editor if the destination file is already visible there. The default value of true preserves the command's original behavior.Personally I do not want the default behavior; I want it to simply toggle back and forth between header / source in the same editor that is focused, regardless of what the other ones are displaying.I'm new to vscode and still finding my way around, so it is likely that I've missed or overlooked something. Feedback/guidance is welcome.