import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
import { localizeWithPath } from '../../../../nls.js';
import { sep } from '../../../../base/common/path.js';
import { Registry } from '../../../../platform/registry/common/platform.js';
import { registerWorkbenchContribution2, Extensions } from '../../../common/contributions.js';
import { EditorExtensions } from '../../../common/editor.js';
import { FILE_EDITOR_INPUT_ID, BINARY_TEXT_FILE_MODE } from '../common/files.js';
import { TextFileEditorTracker } from './editors/textFileEditorTracker.js';
import { TextFileSaveErrorHandler } from './editors/textFileSaveErrorHandler.js';
import { FileEditorInput } from './editors/fileEditorInput.js';
import { BinaryFileEditor } from './editors/binaryFileEditor.js';
import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js';
import { isWindows } from '../../../../base/common/platform.js';
import { EditorPaneDescriptor } from '../../../browser/editor.js';
import { ILabelService } from '../../../../platform/label/common/label.service.js';
import { Schemas } from '../../../../base/common/network.js';
import { WorkspaceWatcher } from './workspaceWatcher.js';
import { DirtyFilesIndicator } from '../common/dirtyFilesIndicator.js';
import { FileEditorInputSerializer, FileEditorWorkingCopyEditorHandler } from './editors/fileEditorHandler.js';
import { ModesRegistry } from '../../../../editor/common/languages/modesRegistry.js';
import { TextFileEditor } from './editors/textFileEditor.js';
import './files.fileEditorFactory.contribution.js';
const _moduleId = "vs/workbench/contrib/files/browser/files.editorPane.contribution";
let FileUriLabelContribution = class FileUriLabelContribution {
    static { this.ID = 'workbench.contrib.fileUriLabel'; }
    constructor(labelService) {
        labelService.registerFormatter({
            scheme: Schemas.file,
            formatting: {
                label: '${authority}${path}',
                separator: sep,
                tildify: !isWindows,
                normalizeDriveLetter: isWindows,
                authorityPrefix: sep + sep,
                workspaceSuffix: ''
            }
        });
    }
};
FileUriLabelContribution = ( (__decorate([
    ( (__param(0, ILabelService)))
], FileUriLabelContribution)));
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(TextFileEditor, TextFileEditor.ID, ( localizeWithPath(_moduleId, 0, "Text File Editor"))), [
    ( (new SyncDescriptor(FileEditorInput)))
]);
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(BinaryFileEditor, BinaryFileEditor.ID, ( localizeWithPath(_moduleId, 1, "Binary File Editor"))), [
    ( (new SyncDescriptor(FileEditorInput)))
]);
( (Registry.as(EditorExtensions.EditorFactory))).registerEditorSerializer(FILE_EDITOR_INPUT_ID, FileEditorInputSerializer);
registerWorkbenchContribution2(FileEditorWorkingCopyEditorHandler.ID, FileEditorWorkingCopyEditorHandler, 2 );
registerWorkbenchContribution2(TextFileEditorTracker.ID, TextFileEditorTracker, 1 );
registerWorkbenchContribution2(TextFileSaveErrorHandler.ID, TextFileSaveErrorHandler, 1 );
registerWorkbenchContribution2(FileUriLabelContribution.ID, FileUriLabelContribution, 1 );
( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(WorkspaceWatcher, 3 );
registerWorkbenchContribution2(DirtyFilesIndicator.ID, DirtyFilesIndicator, 1 );
ModesRegistry.registerLanguage({
    id: BINARY_TEXT_FILE_MODE,
    aliases: ['Binary'],
    mimetypes: ['text/x-code-binary']
});
