Compare commits
3 Commits
1.1106-vsc
...
1.1119-vsc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2ad3d4ff4 | ||
|
|
4a29cd1664 | ||
|
|
0462a93f11 |
6
packages/ide-api/api.d.ts
vendored
6
packages/ide-api/api.d.ts
vendored
@@ -1,6 +1,9 @@
|
||||
// tslint:disable no-any
|
||||
|
||||
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
|
||||
import { IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
|
||||
export interface EvalHelper { }
|
||||
interface ActiveEvalEmitter {
|
||||
@@ -146,7 +149,10 @@ declare namespace ide {
|
||||
export const client: {};
|
||||
|
||||
export const workbench: {
|
||||
readonly action: Action,
|
||||
readonly syncActionDescriptor: SyncActionDescriptor,
|
||||
readonly statusbarService: IStatusbarService;
|
||||
readonly actionsRegistry: IWorkbenchActionRegistry;
|
||||
readonly notificationService: INotificationService;
|
||||
readonly storageService: IStorageService;
|
||||
readonly menuRegistry: IMenuRegistry;
|
||||
|
||||
@@ -6,13 +6,17 @@ import { IStatusbarService, StatusbarAlignment } from "vs/platform/statusbar/com
|
||||
import * as paths from "./fill/paths";
|
||||
import product from "./fill/product";
|
||||
import "./vscode.scss";
|
||||
import { MenuId, MenuRegistry } from "vs/platform/actions/common/actions";
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
|
||||
import { CommandsRegistry } from "vs/platform/commands/common/commands";
|
||||
import { IFileService, FileOperation } from "vs/platform/files/common/files";
|
||||
import { ITextFileService } from "vs/workbench/services/textfile/common/textfiles";
|
||||
import { IModelService } from "vs/editor/common/services/modelService";
|
||||
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
|
||||
import { IStorageService } from "vs/platform/storage/common/storage";
|
||||
|
||||
// NOTE: shouldn't import anything from VS Code here or anything that will
|
||||
// depend on a synchronous fill like `os`.
|
||||
|
||||
@@ -33,11 +37,12 @@ class VSClient extends IdeClient {
|
||||
window.ide = {
|
||||
client: ideClientInstance,
|
||||
workbench: {
|
||||
action: Action,
|
||||
syncActionDescriptor: SyncActionDescriptor,
|
||||
commandRegistry: CommandsRegistry,
|
||||
// tslint:disable-next-line:no-any
|
||||
menuRegistry: MenuRegistry as any,
|
||||
// tslint:disable-next-line:no-any
|
||||
statusbarService: getService<IStatusbarService>(IStatusbarService) as any,
|
||||
actionsRegistry: Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions),
|
||||
menuRegistry: MenuRegistry,
|
||||
statusbarService: getService<IStatusbarService>(IStatusbarService),
|
||||
notificationService: getService<INotificationService>(INotificationService),
|
||||
terminalService: getService<ITerminalService>(ITerminalService),
|
||||
storageService: {
|
||||
|
||||
@@ -52,7 +52,15 @@ export type DialogOptions = OpenDialogOptions | SaveDialogOptions;
|
||||
|
||||
export const showOpenDialog = (options: OpenDialogOptions): Promise<string> => {
|
||||
return new Promise<string>((resolve, reject): void => {
|
||||
const dialog = new Dialog(DialogType.Open, options);
|
||||
// Make the default to show hidden files and directories since there is no
|
||||
// other way to make them visible in the dialogs currently.
|
||||
const dialog = new Dialog(DialogType.Open, typeof options.properties.showHiddenFiles === "undefined" ? {
|
||||
...options,
|
||||
properties: {
|
||||
...options.properties,
|
||||
showHiddenFiles: true,
|
||||
},
|
||||
} : options);
|
||||
dialog.onSelect((e) => {
|
||||
dialog.dispose();
|
||||
resolve(e);
|
||||
@@ -505,9 +513,8 @@ class DialogEntryRenderer implements ITreeRenderer<DialogEntry, string, DialogEn
|
||||
*/
|
||||
private humanReadableSize(bytes: number): string {
|
||||
const units = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
||||
const i = Math.min(Math.floor(Math.log(bytes) / Math.log(1000)), units.length - 1);
|
||||
const i = Math.min(Math.floor(bytes && Math.log(bytes) / Math.log(1000)), units.length - 1);
|
||||
|
||||
return (bytes / Math.pow(1000, i)).toFixed(2)
|
||||
+ " " + units[i];
|
||||
return (bytes / Math.pow(1000, i)).toFixed(2) + " " + units[i];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user