@@ -26,6 +26,7 @@ import { IMenuService, MenuId } from 'vs/platform/actions/common/actions';
26
26
import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem' ;
27
27
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
28
28
import { IAction } from 'vs/base/common/actions' ;
29
+ import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget' ;
29
30
30
31
export interface IRangeHighlightDecoration {
31
32
resource : URI ;
@@ -224,28 +225,31 @@ export class FloatingClickMenu extends Disposable implements IEditorContribution
224
225
) {
225
226
super ( ) ;
226
227
227
- const menu = menuService . createMenu ( MenuId . EditorContent , contextKeyService ) ;
228
- const menuDisposables = new DisposableStore ( ) ;
229
- const renderMenuAsFloatingClickBtn = ( ) => {
230
- menuDisposables . clear ( ) ;
231
- if ( ! editor . hasModel ( ) || editor . getOption ( EditorOption . inDiffEditor ) ) {
232
- return ;
233
- }
234
- const actions : IAction [ ] = [ ] ;
235
- createAndFillInActionBarActions ( menu , { renderShortTitle : true , shouldForwardArgs : true } , actions ) ;
236
- if ( actions . length === 0 ) {
237
- return ;
238
- }
239
- // todo@jrieken find a way to handle N actions, like showing a context menu
240
- const [ first ] = actions ;
241
- const widget = instantiationService . createInstance ( FloatingClickWidget , editor , first . label , first . id ) ;
242
- menuDisposables . add ( widget ) ;
243
- menuDisposables . add ( widget . onClick ( ( ) => first . run ( editor . getModel ( ) . uri ) ) ) ;
244
- widget . render ( ) ;
245
- } ;
246
- this . _store . add ( menu ) ;
247
- this . _store . add ( menuDisposables ) ;
248
- this . _store . add ( menu . onDidChange ( renderMenuAsFloatingClickBtn ) ) ;
249
- renderMenuAsFloatingClickBtn ( ) ;
228
+ // DISABLED for embedded editors. In the future we can use a different MenuId for embedded editors
229
+ if ( ! ( editor instanceof EmbeddedCodeEditorWidget ) ) {
230
+ const menu = menuService . createMenu ( MenuId . EditorContent , contextKeyService ) ;
231
+ const menuDisposables = new DisposableStore ( ) ;
232
+ const renderMenuAsFloatingClickBtn = ( ) => {
233
+ menuDisposables . clear ( ) ;
234
+ if ( ! editor . hasModel ( ) || editor . getOption ( EditorOption . inDiffEditor ) ) {
235
+ return ;
236
+ }
237
+ const actions : IAction [ ] = [ ] ;
238
+ createAndFillInActionBarActions ( menu , { renderShortTitle : true , shouldForwardArgs : true } , actions ) ;
239
+ if ( actions . length === 0 ) {
240
+ return ;
241
+ }
242
+ // todo@jrieken find a way to handle N actions, like showing a context menu
243
+ const [ first ] = actions ;
244
+ const widget = instantiationService . createInstance ( FloatingClickWidget , editor , first . label , first . id ) ;
245
+ menuDisposables . add ( widget ) ;
246
+ menuDisposables . add ( widget . onClick ( ( ) => first . run ( editor . getModel ( ) . uri ) ) ) ;
247
+ widget . render ( ) ;
248
+ } ;
249
+ this . _store . add ( menu ) ;
250
+ this . _store . add ( menuDisposables ) ;
251
+ this . _store . add ( menu . onDidChange ( renderMenuAsFloatingClickBtn ) ) ;
252
+ renderMenuAsFloatingClickBtn ( ) ;
253
+ }
250
254
}
251
255
}
0 commit comments