Skip to content

Commit

Permalink
Disable cell editor search widget
Browse files Browse the repository at this point in the history
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
  • Loading branch information
jonah-iden committed Jun 21, 2024
1 parent 611d83d commit aace955
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 6 additions & 7 deletions packages/monaco/src/browser/simple-monaco-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { EditorServiceOverrides, MonacoEditor, MonacoEditorServices } from './monaco-editor';

import { CodeEditorWidget } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/codeEditorWidget';
import { CodeEditorWidget, ICodeEditorWidgetOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/codeEditorWidget';
import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation';
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
import { ServiceCollection } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/serviceCollection';
Expand Down Expand Up @@ -51,7 +51,8 @@ export class SimpleMonacoEditor extends MonacoEditorServices implements Disposab
readonly node: HTMLElement,
services: MonacoEditorServices,
options?: MonacoEditor.IOptions,
override?: EditorServiceOverrides
override?: EditorServiceOverrides,
widgetOptions?: ICodeEditorWidgetOptions
) {
super(services);
this.toDispose.pushAll([
Expand All @@ -66,7 +67,7 @@ export class SimpleMonacoEditor extends MonacoEditorServices implements Disposab
this.toDispose.push(this.create({
...MonacoEditor.createReadOnlyOptions(document.readOnly),
...options
}, override));
}, override, widgetOptions));
this.addHandlers(this.editor);
this.editor.setModel(document.textEditorModel);
}
Expand All @@ -75,7 +76,7 @@ export class SimpleMonacoEditor extends MonacoEditorServices implements Disposab
return this.editor;
}

protected create(options?: MonacoEditor.IOptions, override?: EditorServiceOverrides): Disposable {
protected create(options?: MonacoEditor.IOptions, override?: EditorServiceOverrides, widgetOptions?: ICodeEditorWidgetOptions): Disposable {
const combinedOptions = {
...options,
lightbulb: { enabled: true },
Expand All @@ -97,9 +98,7 @@ export class SimpleMonacoEditor extends MonacoEditorServices implements Disposab
width: 0,
height: 0
},
}, {

});
}, widgetOptions ?? {});
}

protected addHandlers(codeEditor: CodeEditorWidget): void {
Expand Down
4 changes: 3 additions & 1 deletion packages/notebook/src/browser/view/notebook-cell-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { DisposableCollection, OS } from '@theia/core';
import { NotebookViewportService } from './notebook-viewport-service';
import { BareFontInfo } from '@theia/monaco-editor-core/esm/vs/editor/common/config/fontInfo';
import { NOTEBOOK_CELL_CURSOR_FIRST_LINE, NOTEBOOK_CELL_CURSOR_LAST_LINE } from '../contributions/notebook-context-keys';
import { EditorExtensionsRegistry } from '@theia/monaco-editor-core/esm/vs/editor/browser/editorExtensions';

interface CellEditorProps {
notebookModel: NotebookModel,
Expand Down Expand Up @@ -117,7 +118,8 @@ export class CellEditor extends React.Component<CellEditorProps, {}> {
editorNode,
monacoServices,
{ ...DEFAULT_EDITOR_OPTIONS, ...cell.editorOptions },
[[IContextKeyService, this.props.notebookContextManager.scopedStore]]);
[[IContextKeyService, this.props.notebookContextManager.scopedStore]],
{ contributions: EditorExtensionsRegistry.getEditorContributions().filter(c => c.id !== 'editor.contrib.findController') });
this.toDispose.push(this.editor);
this.editor.setLanguage(cell.language);
this.toDispose.push(this.editor.getControl().onDidContentSizeChange(() => {
Expand Down

0 comments on commit aace955

Please sign in to comment.