提交 d6c4086d 编写于 作者: B Benjamin Pasero

adopt clipboard module

上级 7d32e8f2
......@@ -18,11 +18,9 @@ import model = require('vs/workbench/parts/debug/common/debugModel');
import { IViewletService } from 'vs/workbench/services/viewlet/common/viewletService';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybindingService';
import remote = require('remote');
import {clipboard} from 'electron';
import IDebugService = debug.IDebugService;
const clipboard = remote.require('clipboard');
export class AbstractDebugAction extends actions.Action {
protected debugService: IDebugService;
......
......@@ -27,7 +27,7 @@ import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlighte
import { Action } from 'vs/base/common/actions';
import * as semver from 'semver';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import {shell} from 'electron';
import { shell } from 'electron';
const $ = dom.emmet;
......
......@@ -18,10 +18,7 @@ import {asFileEditorInput} from 'vs/workbench/common/editor';
import {IMessageService} from 'vs/platform/message/common/message';
import {INullService} from 'vs/platform/instantiation/common/instantiation';
import remote = require('remote');
import {ipcRenderer as ipc, shell} from 'electron';
const Clipboard = remote.require('clipboard');
import {ipcRenderer as ipc, shell, clipboard} from 'electron';
export class RevealInOSAction extends Action {
private resource: uri;
......@@ -79,7 +76,7 @@ export class CopyPathAction extends Action {
}
public run(): Promise {
Clipboard.writeText(labels.getPathLabel(this.resource));
clipboard.writeText(labels.getPathLabel(this.resource));
return Promise.as(true);
}
......@@ -102,7 +99,7 @@ export class GlobalCopyPathAction extends Action {
public run(): Promise {
let fileInput = asFileEditorInput(this.editorService.getActiveEditorInput(), true);
if (fileInput) {
Clipboard.writeText(labels.getPathLabel(fileInput.getResource()));
clipboard.writeText(labels.getPathLabel(fileInput.getResource()));
this.editorService.focusEditor(); // focus back to editor
} else {
this.messageService.show(severity.Info, nls.localize('openFileToCopy', "Open a file first to copy its path"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册