@@ -13,7 +13,7 @@ import { ISelection } from 'vs/editor/common/core/selection';
13
13
import { IDecorationOptions , IDecorationRenderOptions } from 'vs/editor/common/editorCommon' ;
14
14
import { ISingleEditOperation } from 'vs/editor/common/core/editOperation' ;
15
15
import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
16
- import { ITextEditorOptions , IResourceEditorInput , EditorActivation } from 'vs/platform/editor/common/editor' ;
16
+ import { ITextEditorOptions , IResourceEditorInput , EditorActivation , EditorResolution } from 'vs/platform/editor/common/editor' ;
17
17
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
18
18
import { MainThreadTextEditor } from 'vs/workbench/api/browser/mainThreadEditor' ;
19
19
import { ExtHostContext , ExtHostEditorsShape , IApplyEditsOptions , ITextDocumentShowOptions , ITextEditorConfigurationUpdate , ITextEditorPositionData , IUndoStopOptions , MainThreadTextEditorsShape , TextEditorRevealType } from 'vs/workbench/api/common/extHost.protocol' ;
@@ -25,8 +25,8 @@ import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/wo
25
25
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions' ;
26
26
import { ILineChange } from 'vs/editor/common/diff/smartLinesDiffComputer' ;
27
27
import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers' ;
28
- import { DEFAULT_EDITOR_ASSOCIATION , IEditorControl } from 'vs/workbench/common/editor' ;
29
- import { ICodeEditor } from 'vs/editor/browser/editorBrowser' ;
28
+ import { IEditorControl } from 'vs/workbench/common/editor' ;
29
+ import { getCodeEditor , ICodeEditor } from 'vs/editor/browser/editorBrowser' ;
30
30
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
31
31
32
32
export interface IMainThreadEditorLocator {
@@ -127,7 +127,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
127
127
// preserve pre 1.38 behaviour to not make group active when preserveFocus: true
128
128
// but make sure to restore the editor to fix https://github.com/microsoft/vscode/issues/79633
129
129
activation : options . preserveFocus ? EditorActivation . RESTORE : undefined ,
130
- override : DEFAULT_EDITOR_ASSOCIATION . id
130
+ override : EditorResolution . EXCLUSIVE_ONLY
131
131
} ;
132
132
133
133
const input : IResourceEditorInput = {
@@ -139,7 +139,10 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
139
139
if ( ! editor ) {
140
140
return undefined ;
141
141
}
142
- return this . _editorLocator . findTextEditorIdFor ( editor ) ;
142
+ // Composite editors are made up of many editors so we return the active one at the time of opening
143
+ const editorControl = editor . getControl ( ) ;
144
+ const codeEditor = getCodeEditor ( editorControl ) ;
145
+ return codeEditor ? this . _editorLocator . getIdOfCodeEditor ( codeEditor ) : undefined ;
143
146
}
144
147
145
148
async $tryShowEditor ( id : string , position ?: EditorGroupColumn ) : Promise < void > {
0 commit comments