Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ##229995. Exclude empty editor hint in notebook diff editor #230001

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { IAccessibilityService } from '../../../../../platform/accessibility/com
import { localize } from '../../../../../nls.js';
import { IEditorConstructionOptions } from '../../../../../editor/browser/config/editorConfiguration.js';
import { IDiffEditorConstructionOptions } from '../../../../../editor/browser/editorBrowser.js';
import { EditorExtensionsRegistry } from '../../../../../editor/browser/editorExtensions.js';

export class NotebookCellTextDiffListDelegate implements IListVirtualDelegate<IDiffElementViewModelBase> {
private readonly lineHeight: number;
Expand Down Expand Up @@ -607,7 +608,9 @@ function buildDiffEditorWidget(instantiationService: IInstantiationService, note

function buildSourceEditor(instantiationService: IInstantiationService, notebookEditor: INotebookTextDiffEditor, sourceContainer: HTMLElement, options: IEditorConstructionOptions = {}) {
const editorContainer = DOM.append(sourceContainer, DOM.$('.editor-container'));

const skipContributions = [
'editor.contrib.emptyTextEditorHint'
];
const editor = instantiationService.createInstance(CodeEditorWidget, editorContainer, {
...fixedEditorOptions,
glyphMargin: false,
Expand All @@ -618,7 +621,9 @@ function buildSourceEditor(instantiationService: IInstantiationService, notebook
automaticLayout: false,
overflowWidgetsDomNode: notebookEditor.getOverflowContainerDomNode(),
readOnly: true,
}, {});
}, {
contributions: EditorExtensionsRegistry.getEditorContributions().filter(c => skipContributions.indexOf(c.id) === -1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the filter condition might be more readable with .includes() instead of .indexOf()

});

return { editor, editorContainer };
}
Loading