UNPKG

@theia/output

Version:
72 lines 3.39 kB
"use strict"; // ***************************************************************************** // Copyright (C) 2020 TypeFox and others. // // This program and the accompanying materials are made available under the // terms of the Eclipse Public License v. 2.0 which is available at // http://www.eclipse.org/legal/epl-2.0. // // This Source Code may also be made available under the following Secondary // Licenses when the conditions for such availability set forth in the Eclipse // Public License v. 2.0 are satisfied: GNU General Public License, version 2 // with the GNU Classpath Exception which is available at // https://www.gnu.org/software/classpath/license.html. // // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // ***************************************************************************** Object.defineProperty(exports, "__esModule", { value: true }); exports.OutputEditorFactory = void 0; const tslib_1 = require("tslib"); const inversify_1 = require("@theia/core/shared/inversify"); const uri_1 = tslib_1.__importDefault(require("@theia/core/lib/common/uri")); const monaco_context_menu_1 = require("@theia/monaco/lib/browser/monaco-context-menu"); const monaco_editor_1 = require("@theia/monaco/lib/browser/monaco-editor"); const output_uri_1 = require("../common/output-uri"); const output_context_menu_1 = require("./output-context-menu"); const contextView_1 = require("@theia/monaco-editor-core/esm/vs/platform/contextview/browser/contextView"); let OutputEditorFactory = class OutputEditorFactory { constructor() { this.scheme = output_uri_1.OutputUri.SCHEME; } create(model, defaultsOptions) { const uri = new uri_1.default(model.uri); const options = this.createOptions(model, defaultsOptions); const overrides = this.createOverrides(model); return monaco_editor_1.MonacoEditor.create(uri, model, document.createElement('div'), this.services, options, overrides); } createOptions(model, defaultOptions) { return { ...defaultOptions, overviewRulerLanes: 3, lineNumbersMinChars: 3, fixedOverflowWidgets: true, wordWrap: 'off', lineNumbers: 'off', glyphMargin: false, lineDecorationsWidth: 20, rulers: [], folding: false, scrollBeyondLastLine: false, readOnly: true, renderLineHighlight: 'none', minimap: { enabled: false }, matchBrackets: 'never' }; } *createOverrides(model) { yield [contextView_1.IContextMenuService, this.contextMenuService]; } }; exports.OutputEditorFactory = OutputEditorFactory; tslib_1.__decorate([ (0, inversify_1.inject)(monaco_editor_1.MonacoEditorServices), tslib_1.__metadata("design:type", monaco_editor_1.MonacoEditorServices) ], OutputEditorFactory.prototype, "services", void 0); tslib_1.__decorate([ (0, inversify_1.inject)(output_context_menu_1.OutputContextMenuService), tslib_1.__metadata("design:type", monaco_context_menu_1.MonacoContextMenuService) ], OutputEditorFactory.prototype, "contextMenuService", void 0); exports.OutputEditorFactory = OutputEditorFactory = tslib_1.__decorate([ (0, inversify_1.injectable)() ], OutputEditorFactory); //# sourceMappingURL=output-editor-factory.js.map