fix: terminal suggestion positioning#199420
Merged
Tyriar merged 3 commits intomicrosoft:mainfrom Dec 1, 2023
cpendery:fix/terminal-suggestion-positioning
Merged
fix: terminal suggestion positioning#199420Tyriar merged 3 commits intomicrosoft:mainfrom cpendery:fix/terminal-suggestion-positioning
Tyriar merged 3 commits intomicrosoft:mainfrom
cpendery:fix/terminal-suggestion-positioning
Conversation
Signed-off-by: Chapman Pendery <cpendery@microsoft.com>
Signed-off-by: Chapman Pendery <cpendery@microsoft.com>
cpendery
commented
Nov 28, 2023
| } | ||
| // TODO: What do frozen and auto do? | ||
| const xtermBox = this._terminal.element.getBoundingClientRect(); | ||
| const xtermBox = this._terminal.element!.querySelector('.xterm-screen')!.getBoundingClientRect(); |
Member
Author
Tyriar
approved these changes
Nov 28, 2023
Member
There was a problem hiding this comment.
Looks great! I'll merge this when we branch the release off (likely this Friday). In the meantime if you want to build more upon this you can checkout with this branch as the base and make the PR against that:
git checkout fix/terminal-suggestion-positioning
git checkout -b fix/terminal-suggestion-positioning__second
Or just independently if they don't conflict
Comment on lines
+270
to
+276
| private _getTerminalDimensions(): { width: number; height: number } { | ||
| return { | ||
| width: (this._terminal as any)._core._renderService.dimensions.css.cell.width, | ||
| height: (this._terminal as any)._core._renderService.dimensions.css.cell.height, | ||
| }; | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
Here's a slightly safer way of doing this:
((this._terminal as any)._core as IXtermCore)._renderService.dimensions.css.cell.heightWe can also pull _core out on activate so we just do the cast a single time.
| } | ||
| // TODO: What do frozen and auto do? | ||
| const xtermBox = this._terminal.element!.getBoundingClientRect(); | ||
| const xtermBox = this._terminal.element!.querySelector('.xterm-screen')!.getBoundingClientRect(); |
Member
There was a problem hiding this comment.
If/when we move SuggestAddon into a terminalContrib we can do this a single time in ITerminalContribution.xtermOpen
DonJayamanne
approved these changes
Nov 29, 2023
DonJayamanne
approved these changes
Nov 29, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Fixes the position of the terminal suggestions modal.
Testing