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

vscode: Support location in TerminalOptions #12006

Merged
merged 2 commits into from
Jan 9, 2023

Conversation

xai
Copy link
Contributor

@xai xai commented Dec 19, 2022

What it does

Support location in TerminalOptions, whereas location can be

  • a TerminalLocation enum with the values Editor and Panel
  • a TerminalEditorLocationOptions object which contains a ViewColumn and an optional preserveFocus boolean
    ViewColumn can be Active, Besides, or an explicit column from One to Nine
  • a TerminalSplitLocationOptions object which contains a parentTerminal that is supposed to be split.

Contributed on behalf of STMicroelectronics

Fixes #11506

How to test

  • Download test extension and copy it into the plugins folder.
  • Start Theia and verify that the commands provided by the test extension trigger the correct1 behavior:
    • Open terminal in editor opens a terminal in the main area
    • Open terminal in panel opens a terminal in the bottom area
    • Open terminal with TerminalSplitLocationOptions splits the provided parent terminal, the test extension uses the most recent one as parent argument
      Apparently, this one is currently broken in VS Code and just opens a terminal/tab in the panel area without splitting anything
    • Open terminal with TerminalEditorLocationOptions provides quick picks for ViewColumn and PreserveFocus
      • ViewColumn 'Active' should open terminal in the current column
        Apparently this is currently broken in VS Code, it seems to always open a tab in the first column. No idea what is actually supposed to happen - maybe tab in active column if there already is a terminal?
      • ViewColumn 'Besides' should open a terminal to the right of the current terminal
      • ViewColumn should open a terminal in the specified column if possible
      • PerserveFocus specifies whether the focus should remain untouched (default is false)

Review checklist

Reminder for reviewers

Footnotes

  1. The VSCode API specification and the current behavior of VSCode seems to be misaligned and at least partly broken in VSCode.

@JonasHelming
Copy link
Contributor

@xai Could you resolve the conflicts, please?

xai and others added 2 commits January 4, 2023 19:10
* Add support for TerminalOptions.location
* Implement TerminalLocation
* Implement TerminalSplitLocationOptions
* Implement TerminalEditorLocationOptions
* Keep (bottom area aka TerminalLocation.Panel) as default target

Fixes eclipse-theia#11506

Contributed on behalf of STMicroelectronics

Co-authored-by: Lucas Koehler <[email protected]>
Signed-off-by: Olaf Lessenich <[email protected]>
The enum ViewColumn is used to specify in which column of the main area
a widget is supposed to be opened.

Contributed on behalf of ST Microelectronics

Signed-off-by: Olaf Lessenich <[email protected]>
@xai
Copy link
Contributor Author

xai commented Jan 4, 2023

@xai Could you resolve the conflicts, please?

Solved and rebased to current master.

@JonasHelming
Copy link
Contributor

@vince-fugnitto This is part of the 1.64 support we would aim for for the January release. So if possible, please have a look as soon as possible.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The updates look good to me 👍

  • confirmed that the API comparator now passes for the added APIs
  • confirmed that the sample extension works as expected
  • code looks correct

@vince-fugnitto vince-fugnitto added this to the 1.34.0 milestone Jan 9, 2023
@vince-fugnitto vince-fugnitto added terminal issues related to the terminal vscode issues related to VSCode compatibility labels Jan 9, 2023
@JonasHelming JonasHelming merged commit d8c9a2e into eclipse-theia:master Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
terminal issues related to the terminal vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vscode] Support specifying the location in terminal options
3 participants