// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @implements {TextEditor.CodeMirrorMimeMode}
 */
export class DefaultCodeMirrorMimeMode {
  /**
   * @param {!Root.Runtime.Extension} extension
   * @return {!Promise}
   * @override
   */
  async install(extension) {
    const modeFileName = extension.descriptor()['fileName'];

    return /** @type {!Promise} */ (eval(`import('./${modeFileName}')`));
  }
}

CmModes.DefaultCodeMirrorMimeMode = DefaultCodeMirrorMimeMode;

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import * as TextEditor from '../text_editor/text_editor.js';  // eslint-disable-line no-unused-vars

/**
 * @implements {TextEditor.CodeMirrorTextEditor.CodeMirrorMimeMode}
 */
export class DefaultCodeMirrorMimeMode {
  /**
   * @param {!Root.Runtime.Extension} extension
   * @return {!Promise}
   * @override
   */
  async install(extension) {
    const modeFileName = extension.descriptor()['fileName'];

    return /** @type {!Promise} */ (eval(`import('./${modeFileName}')`));
  }
}

CmModes.DefaultCodeMirrorMimeMode = DefaultCodeMirrorMimeMode;

Migrate cm_modes/ to import cross-module
Migrate cm_modes/ to import cross-module

roll CodeMirror

Bug: 1006759
Change-Id: I053cabf7d9fb2882816c0b23595ad441d4727464
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054160
Commit-Queue: Tim van der Lippe <dba8716ee7f8d16236046f74d2167cb94410f6ed@chromium.org>
Reviewed-by: Paul Lewis <8915f5d5c39a08c5a3e8a8d7314756e4580816f9@chromium.org>
