Skip to content

Improve window.showTextDocument API when called with no/default options #263012

@Drakmyth

Description

@Drakmyth

While using the ms-vscode.cpptools extension, I frequently edit classes in a split-screen view, with the *.cpp file open on the left and the *.h file open on the right. If I add a function definition to my *.h file and select the "Create definition in *.cpp file" option, it opens the *.cpp file in a new tab in the right-hand tab group, rather than switching focus to the already open instance in the left-hand tab group.

I opened a discussion question in the microsoft/vscode-cpptools repo asking if there was an option to change this behavior, and it was requested that I open an issue here as they say this behavior is due to the default behavior of the window.showTextDocument API when called with no options.

Steps to Reproduce:

  1. Install the ms-vscode.cpptools extension
  2. Create an example.cpp file
  3. Create an example.h file
  4. Dock the example.h file to the right of the example.cpp file
  5. Add an Example class definition in the example.h file
  6. Add a void Testing(); method definition to the Example class
  7. On the Testing method definition, select the Create definition of 'Testing' in example.cpp Quick Fix option

Metadata

Metadata

Assignees

No one assigned

    Labels

    apifeature-requestRequest for new features or functionalityworkbench-editorsManaging of editor widgets in workbench window

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions