mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 16:58:55 -05:00
adopt clipboard module
This commit is contained in:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user