File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
src/vs/workbench/contrib/terminalContrib/suggest/browser Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,11 @@ class TerminalSuggestContribution extends DisposableStore implements ITerminalCo
9090
9191 // Initialize the dynamic providers configuration manager
9292 TerminalSuggestProvidersConfigurationManager . initialize ( this . _instantiationService ) ;
93+
94+ // Listen for terminal location changes to update the suggest widget container
95+ this . add ( this . _ctx . instance . onDidChangeTarget ( ( target ) => {
96+ this . _updateContainerForTarget ( target ) ;
97+ } ) ) ;
9398 }
9499
95100 xtermOpen ( xterm : IXtermTerminal & { raw : RawXtermTerminal } ) : void {
@@ -195,6 +200,28 @@ class TerminalSuggestContribution extends DisposableStore implements ITerminalCo
195200 // Relies on shell type being set
196201 this . _loadLspCompletionAddon ( this . _ctx . instance . xterm . raw ) ;
197202 }
203+
204+ private _updateContainerForTarget ( target : TerminalLocation | undefined ) : void {
205+ const addon = this . _addon . value ;
206+ if ( ! addon || ! this . _ctx . instance . xterm ?. raw ) {
207+ return ;
208+ }
209+
210+ const xtermElement = this . _ctx . instance . xterm . raw . element ;
211+ if ( ! xtermElement ) {
212+ return ;
213+ }
214+
215+ // Update the container based on the new target location
216+ if ( target === TerminalLocation . Editor ) {
217+ addon . setContainerWithOverflow ( xtermElement ) ;
218+ } else {
219+ const panelContainer = dom . findParentWithClass ( xtermElement , 'panel' ) ;
220+ if ( panelContainer ) {
221+ addon . setContainerWithOverflow ( panelContainer ) ;
222+ }
223+ }
224+ }
198225}
199226
200227registerTerminalContribution ( TerminalSuggestContribution . ID , TerminalSuggestContribution ) ;
You can’t perform that action at this time.
0 commit comments