text: // Copyright 2017 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 {Plugin} from './Plugin.js';
  
  export class SnippetsPlugin extends Plugin {
    /**
     * @param {!SourceFrame.SourcesTextEditor} textEditor
     * @param {!Workspace.UISourceCode} uiSourceCode
     */
    constructor(textEditor, uiSourceCode) {
      super();
      this._textEditor = textEditor;
      this._uiSourceCode = uiSourceCode;
    }
  
    /**
     * @override
     * @param {!Workspace.UISourceCode} uiSourceCode
     * @return {boolean}
     */
    static accepts(uiSourceCode) {
      return Snippets.isSnippetsUISourceCode(uiSourceCode);
    }
  
    /**
     * @override
     * @return {!Promise<!Array<!UI.ToolbarItem>>}
     */
    async rightToolbarItems() {
      const runSnippet = UI.Toolbar.createActionButtonForId('debugger.run-snippet');
      runSnippet.setText(Host.isMac() ? Common.UIString('\u2318+Enter') : Common.UIString('Ctrl+Enter'));
  
      return [runSnippet];
    }
  }
  