Merge from vscode 1eb87b0e9ce9886afeaecec22b31abd0d9b7939f (#7282)
* Merge from vscode 1eb87b0e9ce9886afeaecec22b31abd0d9b7939f * fix various icon issues * fix preview features
18
src/bootstrap.js
vendored
@@ -21,6 +21,7 @@ process.on('SIGPIPE', () => {
|
||||
//#endregion
|
||||
|
||||
//#region Add support for redirecting the loading of node modules
|
||||
|
||||
exports.injectNodeModuleLookupPath = function (injectPath) {
|
||||
if (!injectPath) {
|
||||
throw new Error('Missing injectPath');
|
||||
@@ -36,10 +37,8 @@ exports.injectNodeModuleLookupPath = function (injectPath) {
|
||||
const originalResolveLookupPaths = Module._resolveLookupPaths;
|
||||
|
||||
// @ts-ignore
|
||||
Module._resolveLookupPaths = function (moduleName, parent, newReturn) {
|
||||
const result = originalResolveLookupPaths(moduleName, parent, newReturn);
|
||||
|
||||
const paths = newReturn ? result : result[1];
|
||||
Module._resolveLookupPaths = function (moduleName, parent) {
|
||||
const paths = originalResolveLookupPaths(moduleName, parent);
|
||||
for (let i = 0, len = paths.length; i < len; i++) {
|
||||
if (paths[i] === nodeModulesPath) {
|
||||
paths.splice(i, 0, injectPath);
|
||||
@@ -47,7 +46,7 @@ exports.injectNodeModuleLookupPath = function (injectPath) {
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return paths;
|
||||
};
|
||||
};
|
||||
//#endregion
|
||||
@@ -71,11 +70,10 @@ exports.enableASARSupport = function (nodeModulesPath) {
|
||||
|
||||
// @ts-ignore
|
||||
const originalResolveLookupPaths = Module._resolveLookupPaths;
|
||||
// @ts-ignore
|
||||
Module._resolveLookupPaths = function (request, parent, newReturn) {
|
||||
const result = originalResolveLookupPaths(request, parent, newReturn);
|
||||
|
||||
const paths = newReturn ? result : result[1];
|
||||
// @ts-ignore
|
||||
Module._resolveLookupPaths = function (request, parent) {
|
||||
const paths = originalResolveLookupPaths(request, parent);
|
||||
for (let i = 0, len = paths.length; i < len; i++) {
|
||||
if (paths[i] === NODE_MODULES_PATH) {
|
||||
paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
|
||||
@@ -83,7 +81,7 @@ exports.enableASARSupport = function (nodeModulesPath) {
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return paths;
|
||||
};
|
||||
};
|
||||
//#endregion
|
||||
|
||||
@@ -17,7 +17,7 @@ const paths = require('./paths');
|
||||
// @ts-ignore
|
||||
const product = require('../product.json');
|
||||
// @ts-ignore
|
||||
const app = require('electron').app;
|
||||
const { app, protocol } = require('electron');
|
||||
|
||||
// Enable portable support
|
||||
const portable = bootstrap.configurePortable();
|
||||
@@ -33,6 +33,11 @@ app.setPath('userData', userDataPath);
|
||||
// Update cwd based on environment and platform
|
||||
setCurrentWorkingDirectory();
|
||||
|
||||
// Register custom schemes with privileges
|
||||
protocol.registerSchemesAsPrivileged([
|
||||
{ scheme: 'vscode-resource', privileges: { secure: true, supportFetchAPI: true, corsEnabled: true } }
|
||||
]);
|
||||
|
||||
// Global app listeners
|
||||
registerListeners();
|
||||
|
||||
@@ -102,7 +107,7 @@ function onReady() {
|
||||
});
|
||||
};
|
||||
|
||||
// We recevied a valid nlsConfig from a user defined locale
|
||||
// We received a valid nlsConfig from a user defined locale
|
||||
if (nlsConfig) {
|
||||
startup(nlsConfig);
|
||||
}
|
||||
|
||||
@@ -87,42 +87,42 @@
|
||||
}
|
||||
|
||||
/* icons */
|
||||
.vs .icon.extendFullScreen {
|
||||
.vs .codicon.extendFullScreen {
|
||||
/* ExtendToFullScreen_16x_vscode */
|
||||
background-image: url("extendFullScreen.svg");
|
||||
}
|
||||
|
||||
.vs .icon.exitFullScreen {
|
||||
.vs .codicon.exitFullScreen {
|
||||
/* ExitFullScreen_16x_vscode */
|
||||
background-image: url("exitFullScreen.svg");
|
||||
}
|
||||
|
||||
.vs .icon.saveJson {
|
||||
.vs .codicon.saveJson {
|
||||
/* ResultToJSON_16x_vscode */
|
||||
background-image: url("saveJson.svg");
|
||||
}
|
||||
|
||||
.vs .icon.saveCsv {
|
||||
.vs .codicon.saveCsv {
|
||||
/* ResultToCSV_16x_vscode */
|
||||
background-image: url("saveCsv.svg");
|
||||
}
|
||||
|
||||
.vs .icon.saveExcel {
|
||||
.vs .codicon.saveExcel {
|
||||
/* ResultToXlsx_16x_vscode */
|
||||
background-image: url("saveExcel.svg");
|
||||
}
|
||||
|
||||
.vs .icon.saveXml {
|
||||
.vs .codicon.saveXml {
|
||||
/* ResultToXML_16x_vscode */
|
||||
background-image: url("saveXml.svg");
|
||||
}
|
||||
|
||||
.vs .icon.viewChart {
|
||||
.vs .codicon.viewChart {
|
||||
/* ResultToXlsx_16x_vscode */
|
||||
background-image: url("viewChart.svg");
|
||||
}
|
||||
|
||||
.vs .icon.viewVisualizer {
|
||||
.vs .codicon.viewVisualizer {
|
||||
background-image: url("viewVisualizer.svg");
|
||||
}
|
||||
|
||||
@@ -222,54 +222,54 @@
|
||||
}
|
||||
|
||||
/* icons */
|
||||
.vs-dark .icon.extendFullScreen,
|
||||
.hc-black .icon.extendFullScreen {
|
||||
.vs-dark .codicon.extendFullScreen,
|
||||
.hc-black .codicon.extendFullScreen {
|
||||
/* ExtendToFullScreen_16x_vscode_inverse.svg */
|
||||
background-image: url("extendFullScreen_inverse.svg");
|
||||
}
|
||||
|
||||
.vs-dark .icon.exitFullScreen,
|
||||
.hc-black .icon.exitFullScreen {
|
||||
.vs-dark .codicon.exitFullScreen,
|
||||
.hc-black .codicon.exitFullScreen {
|
||||
/* ExitFullScreen_16x_vscode_inverse.svg */
|
||||
background-image: url("exitFullScreen_inverse.svg");
|
||||
}
|
||||
|
||||
.vs-dark .icon.saveJson,
|
||||
.hc-black .icon.saveJson {
|
||||
.vs-dark .codicon.saveJson,
|
||||
.hc-black .codicon.saveJson {
|
||||
/* ResultToJSON_16x_vscode_inverse.svg */
|
||||
background-image: url("saveJson_inverse.svg");
|
||||
}
|
||||
|
||||
.vs-dark .icon.saveCsv,
|
||||
.hc-black .icon.saveCsv {
|
||||
.vs-dark .codicon.saveCsv,
|
||||
.hc-black .codicon.saveCsv {
|
||||
/* ResultToCSV_16x_vscode_inverse.svg */
|
||||
background-image: url("saveCsv_inverse.svg");
|
||||
}
|
||||
|
||||
.vs-dark .icon.saveExcel,
|
||||
.hc-black .icon.saveExcel {
|
||||
.vs-dark .codicon.saveExcel,
|
||||
.hc-black .codicon.saveExcel {
|
||||
/* ResultToXlsx_16x_vscode_inverse.svg */
|
||||
background-image: url("saveExcel_inverse.svg");
|
||||
}
|
||||
|
||||
.vs-dark .icon.saveXml,
|
||||
.hc-black .icon.saveXml {
|
||||
.vs-dark .codicon.saveXml,
|
||||
.hc-black .codicon.saveXml {
|
||||
/* ResultToXml_16x_vscode_inverse.svg */
|
||||
background-image: url("saveXml_inverse.svg");
|
||||
}
|
||||
|
||||
.vs-dark .icon.viewChart,
|
||||
.hc-black .icon.viewChart {
|
||||
.vs-dark .codicon.viewChart,
|
||||
.hc-black .codicon.viewChart {
|
||||
/* ResultToXlsx_16x_vscode */
|
||||
background-image: url("viewChart_inverse.svg");
|
||||
}
|
||||
|
||||
.vs-dark .icon.viewVisualizer,
|
||||
.hc-black .icon.viewVisualizer {
|
||||
.vs-dark .codicon.viewVisualizer,
|
||||
.hc-black .codicon.viewVisualizer {
|
||||
background-image: url("viewVisualizer_inverse.svg");
|
||||
}
|
||||
|
||||
.grid-panel .action-label.icon {
|
||||
.grid-panel .action-label.codicon {
|
||||
height: 16px;
|
||||
min-width: 28px;
|
||||
background-size: 16px;
|
||||
|
||||
@@ -12,109 +12,109 @@
|
||||
background-image: url('ellipsis-inverse.svg');
|
||||
}
|
||||
|
||||
.vs .icon.start,
|
||||
.vs-dark .icon.start,
|
||||
.hc-black .icon.start {
|
||||
.vs .codicon.start,
|
||||
.vs-dark .codicon.start,
|
||||
.hc-black .codicon.start {
|
||||
background-image: url('start.svg');
|
||||
}
|
||||
|
||||
.vs .icon.add,
|
||||
.vs-dark .icon.add,
|
||||
.hc-black .icon.add {
|
||||
.vs .codicon.add,
|
||||
.vs-dark .codicon.add,
|
||||
.hc-black .codicon.add {
|
||||
background-image: url('add.svg');
|
||||
}
|
||||
|
||||
.vs .icon.stop,
|
||||
.vs-dark .icon.stop,
|
||||
.hc-black .icon.stop {
|
||||
.vs .codicon.stop,
|
||||
.vs-dark .codicon.stop,
|
||||
.hc-black .codicon.stop {
|
||||
background-image: url('stop.svg');
|
||||
}
|
||||
|
||||
.vs .icon.disconnect {
|
||||
.vs .codicon.disconnect {
|
||||
background-image: url('disconnect.svg');
|
||||
}
|
||||
|
||||
.vs-dark .icon.disconnect,
|
||||
.hc-black .icon.disconnect {
|
||||
.vs-dark .codicon.disconnect,
|
||||
.hc-black .codicon.disconnect {
|
||||
background-image: url('disconnect_inverse.svg');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.vs .icon.connect {
|
||||
.vs .codicon.connect {
|
||||
background-image: url('connect.svg');
|
||||
}
|
||||
|
||||
.vs-dark .icon.connect,
|
||||
.hc-black .icon.connect {
|
||||
.vs-dark .codicon.connect,
|
||||
.hc-black .codicon.connect {
|
||||
background-image: url('connect_inverse.svg');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.vs .icon.changeConnection {
|
||||
.vs .codicon.changeConnection {
|
||||
background-image: url('change_connection.svg');
|
||||
}
|
||||
|
||||
.vs-dark .icon.changeConnection,
|
||||
.hc-black .icon.changeConnection {
|
||||
.vs-dark .codicon.changeConnection,
|
||||
.hc-black .codicon.changeConnection {
|
||||
background-image: url('change_connection_inverse.svg');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.vs .icon.estimatedQueryPlan,
|
||||
.vs .icon.actualQueryPlan {
|
||||
.vs .codicon.estimatedQueryPlan,
|
||||
.vs .codicon.actualQueryPlan {
|
||||
background-image: url('query-plan.svg');
|
||||
}
|
||||
|
||||
.vs-dark .icon.estimatedQueryPlan,
|
||||
.hc-black .icon.estimatedQueryPlan,
|
||||
.vs-dark .icon.actualQueryPlan,
|
||||
.hc-black .icon.actualQueryPlan {
|
||||
.vs-dark .codicon.estimatedQueryPlan,
|
||||
.hc-black .codicon.estimatedQueryPlan,
|
||||
.vs-dark .codicon.actualQueryPlan,
|
||||
.hc-black .codicon.actualQueryPlan {
|
||||
background-image: url('query-plan-inverse.svg');
|
||||
}
|
||||
|
||||
.vs .icon.createInsight {
|
||||
.vs .codicon.createInsight {
|
||||
background-image: url('create_insight.svg');
|
||||
}
|
||||
|
||||
.vs-dark .icon.createInsight,
|
||||
.hc-black .icon.createInsight {
|
||||
.vs-dark .codicon.createInsight,
|
||||
.hc-black .codicon.createInsight {
|
||||
background-image: url('create_insight_inverse.svg');
|
||||
}
|
||||
|
||||
.vs .icon.copyImage {
|
||||
.vs .codicon.copyImage {
|
||||
background-image: url('copy_image.svg');
|
||||
}
|
||||
|
||||
.vs-dark .icon.copyImage,
|
||||
.hc-black .icon.copyImage {
|
||||
.vs-dark .codicon.copyImage,
|
||||
.hc-black .codicon.copyImage {
|
||||
background-image: url('copy_image_inverse.svg');
|
||||
}
|
||||
|
||||
.vs .icon.saveAsImage {
|
||||
.vs .codicon.saveAsImage {
|
||||
background-image: url('save_as_image.svg');
|
||||
}
|
||||
|
||||
.vs-dark .icon.saveAsImage,
|
||||
.hc-black .icon.saveAsImage {
|
||||
.vs-dark .codicon.saveAsImage,
|
||||
.hc-black .codicon.saveAsImage {
|
||||
background-image: url('save_as_image_inverse.svg');
|
||||
}
|
||||
|
||||
.vs .icon.enablesqlcmd {
|
||||
.vs .codicon.enablesqlcmd {
|
||||
background-image: url('enable_sqlcmd.svg');
|
||||
}
|
||||
|
||||
.vs-dark .icon.enablesqlcmd,
|
||||
.hc-black .icon.enablesqlcmd {
|
||||
.vs-dark .codicon.enablesqlcmd,
|
||||
.hc-black .codicon.enablesqlcmd {
|
||||
background-image: url('enable_sqlcmd_inverse.svg');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.vs .icon.disablesqlcmd {
|
||||
.vs .codicon.disablesqlcmd {
|
||||
background-image: url('disable_sqlcmd.svg');
|
||||
}
|
||||
|
||||
.vs-dark .icon.disablesqlcmd,
|
||||
.hc-black .icon.disablesqlcmd {
|
||||
.vs-dark .codicon.disablesqlcmd,
|
||||
.hc-black .codicon.disablesqlcmd {
|
||||
background-image: url('disable_sqlcmd_inverse.svg');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
@@ -83,6 +83,6 @@
|
||||
|
||||
/* Taskbar Icons */
|
||||
|
||||
.carbon-taskbar .icon {
|
||||
.carbon-taskbar .codicon {
|
||||
background-size: 11px;
|
||||
}
|
||||
|
||||
@@ -112,14 +112,14 @@ export class QueryTextEditor extends BaseTextEditor {
|
||||
|
||||
public setWidth(width: number) {
|
||||
if (this._dimension) {
|
||||
this._dimension.width = width;
|
||||
this._dimension = new DOM.Dimension(width, this._dimension.height);
|
||||
this.layout();
|
||||
}
|
||||
}
|
||||
|
||||
public setHeight(height: number) {
|
||||
if (this._dimension) {
|
||||
this._dimension.height = height;
|
||||
this._dimension = new DOM.Dimension(this._dimension.width, height);
|
||||
this.layout(this._dimension);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,12 @@
|
||||
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { localize } from 'vs/nls';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import { IWindowService } from 'vs/platform/windows/common/windows';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
|
||||
export class EnablePreviewFeatures implements IWorkbenchContribution {
|
||||
|
||||
@@ -19,11 +18,9 @@ export class EnablePreviewFeatures implements IWorkbenchContribution {
|
||||
|
||||
constructor(
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
@INotificationService notificationService: INotificationService,
|
||||
@IWindowService windowService: IWindowService,
|
||||
@IWindowsService windowsService: IWindowsService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IHostService hostService: IHostService,
|
||||
@IConfigurationService configurationService: IConfigurationService
|
||||
) {
|
||||
let previewFeaturesEnabled = configurationService.getValue('workbench')['enablePreviewFeatures'];
|
||||
@@ -32,7 +29,7 @@ export class EnablePreviewFeatures implements IWorkbenchContribution {
|
||||
}
|
||||
Promise.all([
|
||||
windowService.isFocused(),
|
||||
windowsService.getWindowCount()
|
||||
hostService.windowCount
|
||||
]).then(([focused, count]) => {
|
||||
if (!focused && count > 1) {
|
||||
return null;
|
||||
|
||||
@@ -5,16 +5,17 @@
|
||||
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
//tslint:disable-next-line:layering
|
||||
import { ElectronMainService } from 'vs/platform/electron/electron-main/electronMainService';
|
||||
|
||||
export class ShowFileInFolderAction extends Action {
|
||||
|
||||
constructor(private path: string, label: string, private windowsService: IWindowsService) {
|
||||
constructor(private path: string, label: string, private windowsService: ElectronMainService) {
|
||||
super('showItemInFolder.action.id', label);
|
||||
}
|
||||
|
||||
run(): Promise<void> {
|
||||
return this.windowsService.showItemInFolder(URI.file(this.path));
|
||||
return this.windowsService.showItemInFolder(this.path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
import { escape } from 'vs/base/common/strings';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
export function used() {
|
||||
}
|
||||
|
||||
let productQuality: string;
|
||||
|
||||
export function setProductQuality(quality: string): void {
|
||||
|
||||
@@ -22,7 +22,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { SplitView, Sizing } from 'vs/base/browser/ui/splitview/splitview';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { dispose, IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { ISelectionData } from 'azdata';
|
||||
import { Action, IActionViewItem } from 'vs/base/common/actions';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as ConnectionConstants from 'sql/platform/connection/common/constants';
|
||||
import * as Constants from 'sql/workbench/parts/query/common/constants';
|
||||
import * as LocalizedConstants from 'sql/workbench/parts/query/common/localizedConstants';
|
||||
import { SaveResultsRequestParams } from 'azdata';
|
||||
import { IQueryManagementService } from 'sql/platform/query/common/queryManagement';
|
||||
import { ISaveRequest, SaveFormat } from 'sql/workbench/parts/grid/common/interfaces';
|
||||
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWindowsService, FileFilter } from 'vs/platform/windows/common/windows';
|
||||
import { FileFilter } from 'vs/platform/windows/common/windows';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import * as path from 'vs/base/common/path';
|
||||
@@ -26,6 +25,7 @@ import { getRootPath, resolveCurrentDirectory, resolveFilePath } from 'sql/platf
|
||||
import { IOutputService, IOutputChannelRegistry, IOutputChannel, Extensions as OutputExtensions } from 'vs/workbench/contrib/output/common/output';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
let prevSavePath: string;
|
||||
|
||||
@@ -60,9 +60,9 @@ export class ResultSerializer {
|
||||
@IConfigurationService private _configurationService: IConfigurationService,
|
||||
@IEditorService private _editorService: IEditorService,
|
||||
@IWorkspaceContextService private _contextService: IWorkspaceContextService,
|
||||
@IWindowsService private _windowsService: IWindowsService,
|
||||
@IFileDialogService private readonly fileDialogService: IFileDialogService,
|
||||
@INotificationService private _notificationService: INotificationService
|
||||
@INotificationService private _notificationService: INotificationService,
|
||||
@IInstantiationService private readonly _instantiationService: IInstantiationService
|
||||
) { }
|
||||
|
||||
/**
|
||||
@@ -313,14 +313,14 @@ export class ResultSerializer {
|
||||
[{
|
||||
label: nls.localize('openLocation', "Open file location"),
|
||||
run: () => {
|
||||
let action = new ShowFileInFolderAction(savedFilePath, label || path.sep, this._windowsService);
|
||||
let action = this._instantiationService.createInstance(ShowFileInFolderAction, savedFilePath, label || path.sep);
|
||||
action.run();
|
||||
action.dispose();
|
||||
}
|
||||
}, {
|
||||
label: nls.localize('openFile', "Open file"),
|
||||
run: () => {
|
||||
let action = new OpenFileInFolderAction(savedFilePath, label || path.sep, this._windowsService);
|
||||
let action = this._instantiationService.createInstance(OpenFileInFolderAction, savedFilePath, label || path.sep);
|
||||
action.run();
|
||||
action.dispose();
|
||||
}
|
||||
|
||||
@@ -106,9 +106,9 @@
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.vs-dark .connection-dialog .connection-history-actions .action-label.icon,
|
||||
.hc-black .connection-dialog .connection-history-actions .action-label.icon,
|
||||
.connection-dialog .connection-history-actions .action-label.icon {
|
||||
.vs-dark .connection-dialog .connection-history-actions .action-label.codicon,
|
||||
.hc-black .connection-dialog .connection-history-actions .action-label.codicon,
|
||||
.connection-dialog .connection-history-actions .action-label.codicon {
|
||||
display: block;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
|
||||
@@ -25,6 +25,8 @@ import { getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
import { IWorkbenchConstructionOptions } from 'vs/workbench/workbench.web.api';
|
||||
|
||||
class TestEnvironmentService implements IWorkbenchEnvironmentService {
|
||||
settingsSyncPreviewResource: URI;
|
||||
webviewExternalEndpoint: string;
|
||||
logFile: URI;
|
||||
options?: IWorkbenchConstructionOptions;
|
||||
galleryMachineIdResource?: URI;
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
import nls = require('vs/nls');
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
@@ -37,7 +36,7 @@ export class ShowCurrentReleaseNotesAction extends AbstractShowReleaseNotesActio
|
||||
label = ShowCurrentReleaseNotesAction.LABEL,
|
||||
@IInstantiationService instantiationService: IInstantiationService
|
||||
) {
|
||||
super(id, label, pkg.version, instantiationService);
|
||||
super(id, label, product.version, instantiationService);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
4
src/typings/chokidar.d.ts
vendored
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'vscode-chokidar' {
|
||||
declare module 'chokidar' {
|
||||
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
@@ -197,4 +197,4 @@ declare module 'vscode-chokidar' {
|
||||
paths: string | string[],
|
||||
options?: WatchOptions
|
||||
): FSWatcher;
|
||||
}
|
||||
}
|
||||
|
||||
1741
src/typings/electron.d.ts
vendored
@@ -203,16 +203,16 @@ export const toggleClass: (node: HTMLElement | SVGElement, className: string, sh
|
||||
class DomListener implements IDisposable {
|
||||
|
||||
private _handler: (e: any) => void;
|
||||
private _node: Element | Window | Document;
|
||||
private _node: EventTarget;
|
||||
private readonly _type: string;
|
||||
private readonly _useCapture: boolean;
|
||||
private readonly _options: boolean | AddEventListenerOptions;
|
||||
|
||||
constructor(node: Element | Window | Document, type: string, handler: (e: any) => void, useCapture?: boolean) {
|
||||
constructor(node: EventTarget, type: string, handler: (e: any) => void, options?: boolean | AddEventListenerOptions) {
|
||||
this._node = node;
|
||||
this._type = type;
|
||||
this._handler = handler;
|
||||
this._useCapture = (useCapture || false);
|
||||
this._node.addEventListener(this._type, this._handler, this._useCapture);
|
||||
this._options = (options || false);
|
||||
this._node.addEventListener(this._type, this._handler, this._options);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
@@ -221,7 +221,7 @@ class DomListener implements IDisposable {
|
||||
return;
|
||||
}
|
||||
|
||||
this._node.removeEventListener(this._type, this._handler, this._useCapture);
|
||||
this._node.removeEventListener(this._type, this._handler, this._options);
|
||||
|
||||
// Prevent leakers from holding on to the dom or handler func
|
||||
this._node = null!;
|
||||
@@ -229,9 +229,10 @@ class DomListener implements IDisposable {
|
||||
}
|
||||
}
|
||||
|
||||
export function addDisposableListener<K extends keyof GlobalEventHandlersEventMap>(node: Element | Window | Document, type: K, handler: (event: GlobalEventHandlersEventMap[K]) => void, useCapture?: boolean): IDisposable;
|
||||
export function addDisposableListener(node: Element | Window | Document, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable;
|
||||
export function addDisposableListener(node: Element | Window | Document, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable {
|
||||
export function addDisposableListener<K extends keyof GlobalEventHandlersEventMap>(node: EventTarget, type: K, handler: (event: GlobalEventHandlersEventMap[K]) => void, useCapture?: boolean): IDisposable;
|
||||
export function addDisposableListener(node: EventTarget, type: string, handler: (event: any) => void, useCapture?: boolean): IDisposable;
|
||||
export function addDisposableListener(node: EventTarget, type: string, handler: (event: any) => void, useCapture: AddEventListenerOptions): IDisposable;
|
||||
export function addDisposableListener(node: EventTarget, type: string, handler: (event: any) => void, useCapture?: boolean | AddEventListenerOptions): IDisposable {
|
||||
return new DomListener(node, type, handler, useCapture);
|
||||
}
|
||||
|
||||
@@ -559,13 +560,11 @@ class SizeUtils {
|
||||
// Position & Dimension
|
||||
|
||||
export class Dimension {
|
||||
public width: number;
|
||||
public height: number;
|
||||
|
||||
constructor(width: number, height: number) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
constructor(
|
||||
public readonly width: number,
|
||||
public readonly height: number,
|
||||
) { }
|
||||
|
||||
static equals(a: Dimension | undefined, b: Dimension | undefined): boolean {
|
||||
if (a === b) {
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */
|
||||
}
|
||||
|
||||
.monaco-action-bar .action-item .icon {
|
||||
.monaco-action-bar .action-item .icon,
|
||||
.monaco-action-bar .action-item .codicon {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@@ -95,4 +96,4 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,14 +311,14 @@ export class ActionViewItem extends BaseActionViewItem {
|
||||
|
||||
if (this.options.icon) {
|
||||
this.cssClass = this.getAction().class;
|
||||
DOM.addClass(this.label, 'icon');
|
||||
DOM.addClass(this.label, 'codicon');
|
||||
if (this.cssClass) {
|
||||
DOM.addClasses(this.label, this.cssClass);
|
||||
}
|
||||
|
||||
this.updateEnabled();
|
||||
} else {
|
||||
DOM.removeClass(this.label, 'icon');
|
||||
DOM.removeClass(this.label, 'codicon');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ export class Checkbox extends Widget {
|
||||
|
||||
this.domNode = document.createElement('div');
|
||||
this.domNode.title = this._opts.title;
|
||||
this.domNode.className = 'monaco-custom-checkbox ' + (this._opts.actionClassName || '') + ' ' + (this._checked ? 'checked' : 'unchecked');
|
||||
this.domNode.className = 'monaco-custom-checkbox codicon ' + (this._opts.actionClassName || '') + ' ' + (this._checked ? 'checked' : 'unchecked');
|
||||
this.domNode.tabIndex = 0;
|
||||
this.domNode.setAttribute('role', 'checkbox');
|
||||
this.domNode.setAttribute('aria-checked', String(this._checked));
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
@keyframes codicon-spin {
|
||||
100% {
|
||||
transform:rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.codicon-animation-spin {
|
||||
animation: octicon-spin 1.5s linear infinite;
|
||||
}
|
||||
354
src/vs/base/browser/ui/codiconLabel/codicon/codicon.css
Normal file
@@ -0,0 +1,354 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
@font-face {
|
||||
font-family: "codicon";
|
||||
src: url("./codicon.ttf?e042d2dda15ef7b36b910e3edf539f26") format("truetype");
|
||||
}
|
||||
|
||||
.codicon[class*='codicon-'] {
|
||||
font: normal normal normal 16px/1 codicon;
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
text-rendering: auto;
|
||||
text-align: center;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
|
||||
.codicon-add:before { content: "\ea60" }
|
||||
.codicon-plus:before { content: "\ea60" }
|
||||
.codicon-gist-new:before { content: "\ea60" }
|
||||
.codicon-repo-create:before { content: "\ea60" }
|
||||
.codicon-lightbulb:before { content: "\ea61" }
|
||||
.codicon-light-bulb:before { content: "\ea61" }
|
||||
.codicon-repo:before { content: "\ea62" }
|
||||
.codicon-repo-delete:before { content: "\ea62" }
|
||||
.codicon-gist-fork:before { content: "\ea63" }
|
||||
.codicon-repo-forked:before { content: "\ea63" }
|
||||
.codicon-git-pull-request:before { content: "\ea64" }
|
||||
.codicon-git-pull-request-abandoned:before { content: "\ea64" }
|
||||
.codicon-record-keys:before { content: "\ea65" }
|
||||
.codicon-keyboard:before { content: "\ea65" }
|
||||
.codicon-tag:before { content: "\ea66" }
|
||||
.codicon-tag-add:before { content: "\ea66" }
|
||||
.codicon-tag-remove:before { content: "\ea66" }
|
||||
.codicon-person:before { content: "\ea67" }
|
||||
.codicon-person-add:before { content: "\ea67" }
|
||||
.codicon-person-follow:before { content: "\ea67" }
|
||||
.codicon-person-outline:before { content: "\ea67" }
|
||||
.codicon-person-filled:before { content: "\ea67" }
|
||||
.codicon-git-branch:before { content: "\ea68" }
|
||||
.codicon-git-branch-create:before { content: "\ea68" }
|
||||
.codicon-git-branch-delete:before { content: "\ea68" }
|
||||
.codicon-source-control:before { content: "\ea68" }
|
||||
.codicon-mirror:before { content: "\ea69" }
|
||||
.codicon-mirror-public:before { content: "\ea69" }
|
||||
.codicon-star:before { content: "\ea6a" }
|
||||
.codicon-star-add:before { content: "\ea6a" }
|
||||
.codicon-star-delete:before { content: "\ea6a" }
|
||||
.codicon-comment:before { content: "\ea6b" }
|
||||
.codicon-comment-add:before { content: "\ea6b" }
|
||||
.codicon-alert:before { content: "\ea6c" }
|
||||
.codicon-warning:before { content: "\ea6c" }
|
||||
.codicon-search:before { content: "\ea6d" }
|
||||
.codicon-search-save:before { content: "\ea6d" }
|
||||
.codicon-log-out:before { content: "\ea6e" }
|
||||
.codicon-sign-out:before { content: "\ea6e" }
|
||||
.codicon-log-in:before { content: "\ea6f" }
|
||||
.codicon-sign-in:before { content: "\ea6f" }
|
||||
.codicon-eye:before { content: "\ea70" }
|
||||
.codicon-eye-unwatch:before { content: "\ea70" }
|
||||
.codicon-eye-watch:before { content: "\ea70" }
|
||||
.codicon-circle-filled:before { content: "\ea71" }
|
||||
.codicon-primitive-dot:before { content: "\ea71" }
|
||||
.codicon-stop:before { content: "\ea72" }
|
||||
.codicon-primitive-square:before { content: "\ea72" }
|
||||
.codicon-edit:before { content: "\ea73" }
|
||||
.codicon-pencil:before { content: "\ea73" }
|
||||
.codicon-info:before { content: "\ea74" }
|
||||
.codicon-issue-opened:before { content: "\ea74" }
|
||||
.codicon-gist-private:before { content: "\ea75" }
|
||||
.codicon-git-fork-private:before { content: "\ea75" }
|
||||
.codicon-lock:before { content: "\ea75" }
|
||||
.codicon-mirror-private:before { content: "\ea75" }
|
||||
.codicon-close:before { content: "\ea76" }
|
||||
.codicon-remove-close:before { content: "\ea76" }
|
||||
.codicon-x:before { content: "\ea76" }
|
||||
.codicon-repo-sync:before { content: "\ea77" }
|
||||
.codicon-sync:before { content: "\ea77" }
|
||||
.codicon-clone:before { content: "\ea78" }
|
||||
.codicon-desktop-download:before { content: "\ea78" }
|
||||
.codicon-beaker:before { content: "\ea79" }
|
||||
.codicon-microscope:before { content: "\ea79" }
|
||||
.codicon-vm:before { content: "\ea7a" }
|
||||
.codicon-device-desktop:before { content: "\ea7a" }
|
||||
.codicon-file:before { content: "\ea7b" }
|
||||
.codicon-file-text:before { content: "\ea7b" }
|
||||
.codicon-more:before { content: "\ea7c" }
|
||||
.codicon-kebab-horizontal:before { content: "\ea7c" }
|
||||
.codicon-mail-reply:before { content: "\ea7d" }
|
||||
.codicon-reply:before { content: "\ea7d" }
|
||||
.codicon-organization:before { content: "\ea7e" }
|
||||
.codicon-organization-filled:before { content: "\ea7e" }
|
||||
.codicon-organization-outline:before { content: "\ea7e" }
|
||||
.codicon-new-file:before { content: "\ea7f" }
|
||||
.codicon-file-add:before { content: "\ea7f" }
|
||||
.codicon-new-folder:before { content: "\ea80" }
|
||||
.codicon-file-directory-create:before { content: "\ea80" }
|
||||
.codicon-Vector:before { content: "\f101" }
|
||||
.codicon-activate-breakpoints:before { content: "\f102" }
|
||||
.codicon-archive:before { content: "\f103" }
|
||||
.codicon-array:before { content: "\f104" }
|
||||
.codicon-arrow-both:before { content: "\f105" }
|
||||
.codicon-arrow-down:before { content: "\f106" }
|
||||
.codicon-arrow-left:before { content: "\f107" }
|
||||
.codicon-arrow-right:before { content: "\f108" }
|
||||
.codicon-arrow-small-down:before { content: "\f109" }
|
||||
.codicon-arrow-small-left:before { content: "\f10a" }
|
||||
.codicon-arrow-small-right:before { content: "\f10b" }
|
||||
.codicon-arrow-small-up:before { content: "\f10c" }
|
||||
.codicon-arrow-up:before { content: "\f10d" }
|
||||
.codicon-bell:before { content: "\f10e" }
|
||||
.codicon-bold:before { content: "\f10f" }
|
||||
.codicon-book:before { content: "\f110" }
|
||||
.codicon-bookmark:before { content: "\f111" }
|
||||
.codicon-boolean:before { content: "\f112" }
|
||||
.codicon-breakpoint-conditional-unverified:before { content: "\f113" }
|
||||
.codicon-breakpoint-conditional:before { content: "\f114" }
|
||||
.codicon-breakpoint-data-unverified:before { content: "\f115" }
|
||||
.codicon-breakpoint-data:before { content: "\f116" }
|
||||
.codicon-breakpoint-log-unverified:before { content: "\f117" }
|
||||
.codicon-breakpoint-log:before { content: "\f118" }
|
||||
.codicon-briefcase:before { content: "\f119" }
|
||||
.codicon-broadcast:before { content: "\f11a" }
|
||||
.codicon-browser:before { content: "\f11b" }
|
||||
.codicon-bug:before { content: "\f11c" }
|
||||
.codicon-calendar:before { content: "\f11d" }
|
||||
.codicon-case-sensitive:before { content: "\f11e" }
|
||||
.codicon-check:before { content: "\f11f" }
|
||||
.codicon-checklist:before { content: "\f120" }
|
||||
.codicon-chevron-down:before { content: "\f121" }
|
||||
.codicon-chevron-left:before { content: "\f122" }
|
||||
.codicon-chevron-right:before { content: "\f123" }
|
||||
.codicon-chevron-up:before { content: "\f124" }
|
||||
.codicon-circle-outline:before { content: "\f125" }
|
||||
.codicon-circle-slash:before { content: "\f126" }
|
||||
.codicon-circuit-board:before { content: "\f127" }
|
||||
.codicon-class:before { content: "\f128" }
|
||||
.codicon-clear-all:before { content: "\f129" }
|
||||
.codicon-clippy:before { content: "\f12a" }
|
||||
.codicon-close-all:before { content: "\f12b" }
|
||||
.codicon-cloud-download:before { content: "\f12c" }
|
||||
.codicon-cloud-upload:before { content: "\f12d" }
|
||||
.codicon-code:before { content: "\f12e" }
|
||||
.codicon-collapse-all:before { content: "\f12f" }
|
||||
.codicon-color-mode:before { content: "\f130" }
|
||||
.codicon-color:before { content: "\f131" }
|
||||
.codicon-comment-discussion:before { content: "\f132" }
|
||||
.codicon-compare-changes:before { content: "\f133" }
|
||||
.codicon-console:before { content: "\f134" }
|
||||
.codicon-constant:before { content: "\f135" }
|
||||
.codicon-continue:before { content: "\f136" }
|
||||
.codicon-credit-card:before { content: "\f137" }
|
||||
.codicon-current-and-breakpoint:before { content: "\f138" }
|
||||
.codicon-current:before { content: "\f139" }
|
||||
.codicon-dash:before { content: "\f13a" }
|
||||
.codicon-dashboard:before { content: "\f13b" }
|
||||
.codicon-database:before { content: "\f13c" }
|
||||
.codicon-debug:before { content: "\f13d" }
|
||||
.codicon-device-camera-video:before { content: "\f13e" }
|
||||
.codicon-device-camera:before { content: "\f13f" }
|
||||
.codicon-device-mobile:before { content: "\f140" }
|
||||
.codicon-diff-added:before { content: "\f141" }
|
||||
.codicon-diff-ignored:before { content: "\f142" }
|
||||
.codicon-diff-modified:before { content: "\f143" }
|
||||
.codicon-diff-removed:before { content: "\f144" }
|
||||
.codicon-diff-renamed:before { content: "\f145" }
|
||||
.codicon-diff:before { content: "\f146" }
|
||||
.codicon-discard:before { content: "\f147" }
|
||||
.codicon-disconnect-:before { content: "\f148" }
|
||||
.codicon-editor-layout:before { content: "\f149" }
|
||||
.codicon-ellipsis:before { content: "\f14a" }
|
||||
.codicon-empty-window:before { content: "\f14b" }
|
||||
.codicon-enumerator-member:before { content: "\f14c" }
|
||||
.codicon-enumerator:before { content: "\f14d" }
|
||||
.codicon-error:before { content: "\f14e" }
|
||||
.codicon-event:before { content: "\f14f" }
|
||||
.codicon-exclude:before { content: "\f150" }
|
||||
.codicon-extensions:before { content: "\f151" }
|
||||
.codicon-eye-closed:before { content: "\f152" }
|
||||
.codicon-field:before { content: "\f153" }
|
||||
.codicon-file-binary:before { content: "\f154" }
|
||||
.codicon-file-code:before { content: "\f155" }
|
||||
.codicon-file-media:before { content: "\f156" }
|
||||
.codicon-file-pdf:before { content: "\f157" }
|
||||
.codicon-file-submodule:before { content: "\f158" }
|
||||
.codicon-file-symlink-directory:before { content: "\f159" }
|
||||
.codicon-file-symlink-file:before { content: "\f15a" }
|
||||
.codicon-file-zip:before { content: "\f15b" }
|
||||
.codicon-files:before { content: "\f15c" }
|
||||
.codicon-filter:before { content: "\f15d" }
|
||||
.codicon-flame:before { content: "\f15e" }
|
||||
.codicon-fold-down:before { content: "\f15f" }
|
||||
.codicon-fold-up:before { content: "\f160" }
|
||||
.codicon-fold:before { content: "\f161" }
|
||||
.codicon-folder-active:before { content: "\f162" }
|
||||
.codicon-folder-opened:before { content: "\f163" }
|
||||
.codicon-folder:before { content: "\f164" }
|
||||
.codicon-gift:before { content: "\f165" }
|
||||
.codicon-gist-secret:before { content: "\f166" }
|
||||
.codicon-gist:before { content: "\f167" }
|
||||
.codicon-git-commit:before { content: "\f168" }
|
||||
.codicon-git-compare:before { content: "\f169" }
|
||||
.codicon-git-merge:before { content: "\f16a" }
|
||||
.codicon-github-action:before { content: "\f16b" }
|
||||
.codicon-github-alt:before { content: "\f16c" }
|
||||
.codicon-github:before { content: "\f16d" }
|
||||
.codicon-globe:before { content: "\f16e" }
|
||||
.codicon-go-to-file:before { content: "\f16f" }
|
||||
.codicon-grabber:before { content: "\f170" }
|
||||
.codicon-graph:before { content: "\f171" }
|
||||
.codicon-gripper:before { content: "\f172" }
|
||||
.codicon-heart:before { content: "\f173" }
|
||||
.codicon-history:before { content: "\f174" }
|
||||
.codicon-home:before { content: "\f175" }
|
||||
.codicon-horizontal-rule:before { content: "\f176" }
|
||||
.codicon-hubot:before { content: "\f177" }
|
||||
.codicon-inbox:before { content: "\f178" }
|
||||
.codicon-interface:before { content: "\f179" }
|
||||
.codicon-issue-closed:before { content: "\f17a" }
|
||||
.codicon-issue-reopened:before { content: "\f17b" }
|
||||
.codicon-issues:before { content: "\f17c" }
|
||||
.codicon-italic:before { content: "\f17d" }
|
||||
.codicon-jersey:before { content: "\f17e" }
|
||||
.codicon-json:before { content: "\f17f" }
|
||||
.codicon-kebab-vertical:before { content: "\f180" }
|
||||
.codicon-key:before { content: "\f181" }
|
||||
.codicon-keyword:before { content: "\f182" }
|
||||
.codicon-law:before { content: "\f183" }
|
||||
.codicon-lightbulb-autofix:before { content: "\f184" }
|
||||
.codicon-link-external:before { content: "\f185" }
|
||||
.codicon-link:before { content: "\f186" }
|
||||
.codicon-list-ordered:before { content: "\f187" }
|
||||
.codicon-list-unordered:before { content: "\f188" }
|
||||
.codicon-live-share:before { content: "\f189" }
|
||||
.codicon-loading:before { content: "\f18a" }
|
||||
.codicon-location:before { content: "\f18b" }
|
||||
.codicon-mail-read:before { content: "\f18c" }
|
||||
.codicon-mail:before { content: "\f18d" }
|
||||
.codicon-markdown:before { content: "\f18e" }
|
||||
.codicon-megaphone:before { content: "\f18f" }
|
||||
.codicon-mention:before { content: "\f190" }
|
||||
.codicon-method:before { content: "\f191" }
|
||||
.codicon-milestone:before { content: "\f192" }
|
||||
.codicon-misc:before { content: "\f193" }
|
||||
.codicon-mortar-board:before { content: "\f194" }
|
||||
.codicon-move:before { content: "\f195" }
|
||||
.codicon-multiple-windows:before { content: "\f196" }
|
||||
.codicon-mute:before { content: "\f197" }
|
||||
.codicon-namespace:before { content: "\f198" }
|
||||
.codicon-no-newline:before { content: "\f199" }
|
||||
.codicon-note:before { content: "\f19a" }
|
||||
.codicon-numeric:before { content: "\f19b" }
|
||||
.codicon-octoface:before { content: "\f19c" }
|
||||
.codicon-open-preview:before { content: "\f19d" }
|
||||
.codicon-operator:before { content: "\f19e" }
|
||||
.codicon-package:before { content: "\f19f" }
|
||||
.codicon-paintcan:before { content: "\f1a0" }
|
||||
.codicon-parameter:before { content: "\f1a1" }
|
||||
.codicon-pause:before { content: "\f1a2" }
|
||||
.codicon-pin:before { content: "\f1a3" }
|
||||
.codicon-play:before { content: "\f1a4" }
|
||||
.codicon-plug:before { content: "\f1a5" }
|
||||
.codicon-preserve-case:before { content: "\f1a6" }
|
||||
.codicon-preview:before { content: "\f1a7" }
|
||||
.codicon-project:before { content: "\f1a8" }
|
||||
.codicon-property:before { content: "\f1a9" }
|
||||
.codicon-pulse:before { content: "\f1aa" }
|
||||
.codicon-question:before { content: "\f1ab" }
|
||||
.codicon-quote:before { content: "\f1ac" }
|
||||
.codicon-radio-tower:before { content: "\f1ad" }
|
||||
.codicon-reactions:before { content: "\f1ae" }
|
||||
.codicon-references:before { content: "\f1af" }
|
||||
.codicon-refresh:before { content: "\f1b0" }
|
||||
.codicon-regex:before { content: "\f1b1" }
|
||||
.codicon-remote:before { content: "\f1b2" }
|
||||
.codicon-remove:before { content: "\f1b3" }
|
||||
.codicon-replace-all:before { content: "\f1b4" }
|
||||
.codicon-replace:before { content: "\f1b5" }
|
||||
.codicon-repo-clone:before { content: "\f1b6" }
|
||||
.codicon-repo-force-push:before { content: "\f1b7" }
|
||||
.codicon-repo-pull:before { content: "\f1b8" }
|
||||
.codicon-repo-push:before { content: "\f1b9" }
|
||||
.codicon-report:before { content: "\f1ba" }
|
||||
.codicon-request-changes:before { content: "\f1bb" }
|
||||
.codicon-restart:before { content: "\f1bc" }
|
||||
.codicon-rocket:before { content: "\f1bd" }
|
||||
.codicon-root-folder-opened:before { content: "\f1be" }
|
||||
.codicon-root-folder:before { content: "\f1bf" }
|
||||
.codicon-rss:before { content: "\f1c0" }
|
||||
.codicon-ruby:before { content: "\f1c1" }
|
||||
.codicon-ruler:before { content: "\f1c2" }
|
||||
.codicon-save-all:before { content: "\f1c3" }
|
||||
.codicon-save-as:before { content: "\f1c4" }
|
||||
.codicon-save:before { content: "\f1c5" }
|
||||
.codicon-screen-full:before { content: "\f1c6" }
|
||||
.codicon-screen-normal:before { content: "\f1c7" }
|
||||
.codicon-search-stop:before { content: "\f1c8" }
|
||||
.codicon-selection:before { content: "\f1c9" }
|
||||
.codicon-server:before { content: "\f1ca" }
|
||||
.codicon-settings:before { content: "\f1cb" }
|
||||
.codicon-shield:before { content: "\f1cc" }
|
||||
.codicon-smiley:before { content: "\f1cd" }
|
||||
.codicon-snippet:before { content: "\f1ce" }
|
||||
.codicon-sort-precedence:before { content: "\f1cf" }
|
||||
.codicon-split-horizontal:before { content: "\f1d0" }
|
||||
.codicon-split-vertical:before { content: "\f1d1" }
|
||||
.codicon-squirrel:before { content: "\f1d2" }
|
||||
.codicon-star-empty:before { content: "\f1d3" }
|
||||
.codicon-star-full:before { content: "\f1d4" }
|
||||
.codicon-star-half:before { content: "\f1d5" }
|
||||
.codicon-start:before { content: "\f1d6" }
|
||||
.codicon-step-into:before { content: "\f1d7" }
|
||||
.codicon-step-out:before { content: "\f1d8" }
|
||||
.codicon-step-over:before { content: "\f1d9" }
|
||||
.codicon-string:before { content: "\f1da" }
|
||||
.codicon-structure:before { content: "\f1db" }
|
||||
.codicon-tasklist:before { content: "\f1dc" }
|
||||
.codicon-telescope:before { content: "\f1dd" }
|
||||
.codicon-text-size:before { content: "\f1de" }
|
||||
.codicon-three-bars:before { content: "\f1df" }
|
||||
.codicon-thumbsdown:before { content: "\f1e0" }
|
||||
.codicon-thumbsup:before { content: "\f1e1" }
|
||||
.codicon-tools:before { content: "\f1e2" }
|
||||
.codicon-trash:before { content: "\f1e3" }
|
||||
.codicon-triangle-down:before { content: "\f1e4" }
|
||||
.codicon-triangle-left:before { content: "\f1e5" }
|
||||
.codicon-triangle-right:before { content: "\f1e6" }
|
||||
.codicon-triangle-up:before { content: "\f1e7" }
|
||||
.codicon-twitter:before { content: "\f1e8" }
|
||||
.codicon-unfold:before { content: "\f1e9" }
|
||||
.codicon-unlock:before { content: "\f1ea" }
|
||||
.codicon-unmute:before { content: "\f1eb" }
|
||||
.codicon-unverified:before { content: "\f1ec" }
|
||||
.codicon-variable:before { content: "\f1ed" }
|
||||
.codicon-verified:before { content: "\f1ee" }
|
||||
.codicon-versions:before { content: "\f1ef" }
|
||||
.codicon-vm-active:before { content: "\f1f0" }
|
||||
.codicon-vm-outline:before { content: "\f1f1" }
|
||||
.codicon-vm-running:before { content: "\f1f2" }
|
||||
.codicon-watch:before { content: "\f1f3" }
|
||||
.codicon-whitespace:before { content: "\f1f4" }
|
||||
.codicon-whole-word:before { content: "\f1f5" }
|
||||
.codicon-window:before { content: "\f1f6" }
|
||||
.codicon-word-wrap:before { content: "\f1f7" }
|
||||
.codicon-zoom-in:before { content: "\f1f8" }
|
||||
.codicon-zoom-out:before { content: "\f1f9" }
|
||||
BIN
src/vs/base/browser/ui/codiconLabel/codicon/codicon.ttf
Normal file
24
src/vs/base/browser/ui/codiconLabel/codiconLabel.mock.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { escape } from 'vs/base/common/strings';
|
||||
|
||||
export function renderCodicons(text: string): string {
|
||||
return escape(text);
|
||||
}
|
||||
|
||||
export class CodiconLabel {
|
||||
|
||||
private _container: HTMLElement;
|
||||
|
||||
constructor(container: HTMLElement) {
|
||||
this._container = container;
|
||||
}
|
||||
|
||||
set text(text: string) {
|
||||
this._container.innerHTML = renderCodicons(text || '');
|
||||
}
|
||||
|
||||
}
|
||||
33
src/vs/base/browser/ui/codiconLabel/codiconLabel.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./codicon/codicon';
|
||||
import 'vs/css!./codicon/codicon-animations';
|
||||
import { escape } from 'vs/base/common/strings';
|
||||
|
||||
function expand(text: string): string {
|
||||
return text.replace(/\$\(((.+?)(~(.*?))?)\)/g, (_match, _g1, name, _g3, animation) => {
|
||||
return `<span class="codicon codicon-${name} ${animation ? `codicon-animation-${animation}` : ''}"></span>`;
|
||||
});
|
||||
}
|
||||
|
||||
export function renderCodicons(label: string): string {
|
||||
return expand(escape(label));
|
||||
}
|
||||
|
||||
export class CodiconLabel {
|
||||
|
||||
constructor(
|
||||
private readonly _container: HTMLElement
|
||||
) { }
|
||||
|
||||
set text(text: string) {
|
||||
this._container.innerHTML = renderCodicons(text || '');
|
||||
}
|
||||
|
||||
set title(title: string) {
|
||||
this._container.title = title;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.495 9.052L8.386 11.402H9.477L6.237 3H5.217L2 11.402H3.095L3.933 9.052H7.495ZM5.811 4.453L5.855 4.588L7.173 8.162H4.255L5.562 4.588L5.606 4.453L5.644 4.297L5.676 4.145L5.697 4.019H5.72L5.744 4.145L5.773 4.297L5.811 4.453ZM13.795 10.464V11.4H14.755V7.498C14.755 6.779 14.575 6.226 14.216 5.837C13.857 5.448 13.327 5.254 12.628 5.254C12.429 5.254 12.227 5.273 12.022 5.31C11.817 5.347 11.622 5.394 11.439 5.451C11.256 5.508 11.091 5.569 10.944 5.636C10.797 5.703 10.683 5.765 10.601 5.824V6.808C10.867 6.578 11.167 6.397 11.505 6.268C11.843 6.139 12.194 6.075 12.557 6.075C12.745 6.075 12.915 6.103 13.07 6.16C13.225 6.217 13.357 6.306 13.466 6.427C13.575 6.548 13.659 6.706 13.718 6.899C13.777 7.092 13.806 7.326 13.806 7.599L11.995 7.851C11.651 7.898 11.355 7.977 11.107 8.088C10.859 8.199 10.654 8.339 10.492 8.507C10.33 8.675 10.21 8.868 10.132 9.087C10.054 9.306 10.015 9.546 10.015 9.808C10.015 10.054 10.057 10.283 10.139 10.496C10.221 10.709 10.342 10.893 10.502 11.047C10.662 11.201 10.862 11.323 11.1 11.413C11.338 11.503 11.613 11.548 11.926 11.548C12.328 11.548 12.686 11.456 13.001 11.27C13.316 11.084 13.573 10.816 13.772 10.464H13.795ZM11.667 8.721C11.843 8.657 12.068 8.607 12.341 8.572L13.806 8.367V8.976C13.806 9.222 13.765 9.451 13.683 9.664C13.601 9.877 13.486 10.063 13.34 10.221C13.194 10.379 13.019 10.503 12.816 10.593C12.613 10.683 12.39 10.728 12.148 10.728C11.961 10.728 11.795 10.703 11.653 10.652C11.511 10.601 11.392 10.53 11.296 10.441C11.2 10.352 11.127 10.247 11.076 10.125C11.025 10.003 11 9.873 11 9.732C11 9.568 11.018 9.421 11.055 9.292C11.092 9.163 11.16 9.051 11.257 8.958C11.354 8.865 11.491 8.785 11.667 8.721Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.495 9.052L8.386 11.402H9.477L6.237 3H5.217L2 11.402H3.095L3.933 9.052H7.495ZM5.811 4.453L5.855 4.588L7.173 8.162H4.255L5.562 4.588L5.606 4.453L5.644 4.297L5.676 4.145L5.697 4.019H5.72L5.744 4.145L5.773 4.297L5.811 4.453ZM13.795 10.464V11.4H14.755V7.498C14.755 6.779 14.575 6.226 14.216 5.837C13.857 5.448 13.327 5.254 12.628 5.254C12.429 5.254 12.227 5.273 12.022 5.31C11.817 5.347 11.622 5.394 11.439 5.451C11.256 5.508 11.091 5.569 10.944 5.636C10.797 5.703 10.683 5.765 10.601 5.824V6.808C10.867 6.578 11.167 6.397 11.505 6.268C11.843 6.139 12.194 6.075 12.557 6.075C12.745 6.075 12.915 6.103 13.07 6.16C13.225 6.217 13.357 6.306 13.466 6.427C13.575 6.548 13.659 6.706 13.718 6.899C13.777 7.092 13.806 7.326 13.806 7.599L11.995 7.851C11.651 7.898 11.355 7.977 11.107 8.088C10.859 8.199 10.654 8.339 10.492 8.507C10.33 8.675 10.21 8.868 10.132 9.087C10.054 9.306 10.015 9.546 10.015 9.808C10.015 10.054 10.057 10.283 10.139 10.496C10.221 10.709 10.342 10.893 10.502 11.047C10.662 11.201 10.862 11.323 11.1 11.413C11.338 11.503 11.613 11.548 11.926 11.548C12.328 11.548 12.686 11.456 13.001 11.27C13.316 11.084 13.573 10.816 13.772 10.464H13.795ZM11.667 8.721C11.843 8.657 12.068 8.607 12.341 8.572L13.806 8.367V8.976C13.806 9.222 13.765 9.451 13.683 9.664C13.601 9.877 13.486 10.063 13.34 10.221C13.194 10.379 13.019 10.503 12.816 10.593C12.613 10.683 12.39 10.728 12.148 10.728C11.961 10.728 11.795 10.703 11.653 10.652C11.511 10.601 11.392 10.53 11.296 10.441C11.2 10.352 11.127 10.247 11.076 10.125C11.025 10.003 11 9.873 11 9.732C11 9.568 11.018 9.421 11.055 9.292C11.092 9.163 11.16 9.051 11.257 8.958C11.354 8.865 11.491 8.785 11.667 8.721Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.495 9.052L8.386 11.402H9.477L6.237 3H5.217L2 11.402H3.095L3.933 9.052H7.495ZM5.811 4.453L5.855 4.588L7.173 8.162H4.255L5.562 4.588L5.606 4.453L5.644 4.297L5.676 4.145L5.697 4.019H5.72L5.744 4.145L5.773 4.297L5.811 4.453ZM13.795 10.464V11.4H14.755V7.498C14.755 6.779 14.575 6.226 14.216 5.837C13.857 5.448 13.327 5.254 12.628 5.254C12.429 5.254 12.227 5.273 12.022 5.31C11.817 5.347 11.622 5.394 11.439 5.451C11.256 5.508 11.091 5.569 10.944 5.636C10.797 5.703 10.683 5.765 10.601 5.824V6.808C10.867 6.578 11.167 6.397 11.505 6.268C11.843 6.139 12.194 6.075 12.557 6.075C12.745 6.075 12.915 6.103 13.07 6.16C13.225 6.217 13.357 6.306 13.466 6.427C13.575 6.548 13.659 6.706 13.718 6.899C13.777 7.092 13.806 7.326 13.806 7.599L11.995 7.851C11.651 7.898 11.355 7.977 11.107 8.088C10.859 8.199 10.654 8.339 10.492 8.507C10.33 8.675 10.21 8.868 10.132 9.087C10.054 9.306 10.015 9.546 10.015 9.808C10.015 10.054 10.057 10.283 10.139 10.496C10.221 10.709 10.342 10.893 10.502 11.047C10.662 11.201 10.862 11.323 11.1 11.413C11.338 11.503 11.613 11.548 11.926 11.548C12.328 11.548 12.686 11.456 13.001 11.27C13.316 11.084 13.573 10.816 13.772 10.464H13.795ZM11.667 8.721C11.843 8.657 12.068 8.607 12.341 8.572L13.806 8.367V8.976C13.806 9.222 13.765 9.451 13.683 9.664C13.601 9.877 13.486 10.063 13.34 10.221C13.194 10.379 13.019 10.503 12.816 10.593C12.613 10.683 12.39 10.728 12.148 10.728C11.961 10.728 11.795 10.703 11.653 10.652C11.511 10.601 11.392 10.53 11.296 10.441C11.2 10.352 11.127 10.247 11.076 10.125C11.025 10.003 11 9.873 11 9.732C11 9.568 11.018 9.421 11.055 9.292C11.092 9.163 11.16 9.051 11.257 8.958C11.354 8.865 11.491 8.785 11.667 8.721Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,56 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.vs .monaco-custom-checkbox.monaco-case-sensitive {
|
||||
background: url('case-sensitive-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-custom-checkbox.monaco-case-sensitive {
|
||||
background: url('case-sensitive-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.hc-black .monaco-custom-checkbox.monaco-case-sensitive,
|
||||
.hc-black .monaco-custom-checkbox.monaco-case-sensitive:hover {
|
||||
background: url('case-sensitive-hc.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs .monaco-custom-checkbox.monaco-preserve-case {
|
||||
background: url('preserve-case-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-custom-checkbox.monaco-preserve-case {
|
||||
background: url('preserve-case-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.hc-black .monaco-custom-checkbox.monaco-preserve-case,
|
||||
.hc-black .monaco-custom-checkbox.monaco-preserve-case:hover {
|
||||
background: url('preserve-case-hc.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs .monaco-custom-checkbox.monaco-whole-word {
|
||||
background: url('whole-word-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-custom-checkbox.monaco-whole-word {
|
||||
background: url('whole-word-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.hc-black .monaco-custom-checkbox.monaco-whole-word,
|
||||
.hc-black .monaco-custom-checkbox.monaco-whole-word:hover {
|
||||
background: url('whole-word-hc.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs .monaco-custom-checkbox.monaco-regex {
|
||||
background: url('regex-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-custom-checkbox.monaco-regex {
|
||||
background: url('regex-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.hc-black .monaco-custom-checkbox.monaco-regex,
|
||||
.hc-black .monaco-custom-checkbox.monaco-regex:hover {
|
||||
background: url('regex-hc.svg') center center no-repeat;
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import 'vs/css!./findInputCheckboxes';
|
||||
import * as nls from 'vs/nls';
|
||||
|
||||
export interface IFindInputCheckboxOpts {
|
||||
@@ -22,7 +21,7 @@ const NLS_REGEX_CHECKBOX_LABEL = nls.localize('regexDescription', "Use Regular E
|
||||
export class CaseSensitiveCheckbox extends Checkbox {
|
||||
constructor(opts: IFindInputCheckboxOpts) {
|
||||
super({
|
||||
actionClassName: 'monaco-case-sensitive',
|
||||
actionClassName: 'codicon-case-sensitive',
|
||||
title: NLS_CASE_SENSITIVE_CHECKBOX_LABEL + opts.appendTitle,
|
||||
isChecked: opts.isChecked,
|
||||
inputActiveOptionBorder: opts.inputActiveOptionBorder,
|
||||
@@ -34,7 +33,7 @@ export class CaseSensitiveCheckbox extends Checkbox {
|
||||
export class WholeWordsCheckbox extends Checkbox {
|
||||
constructor(opts: IFindInputCheckboxOpts) {
|
||||
super({
|
||||
actionClassName: 'monaco-whole-word',
|
||||
actionClassName: 'codicon-whole-word',
|
||||
title: NLS_WHOLE_WORD_CHECKBOX_LABEL + opts.appendTitle,
|
||||
isChecked: opts.isChecked,
|
||||
inputActiveOptionBorder: opts.inputActiveOptionBorder,
|
||||
@@ -46,7 +45,7 @@ export class WholeWordsCheckbox extends Checkbox {
|
||||
export class RegexCheckbox extends Checkbox {
|
||||
constructor(opts: IFindInputCheckboxOpts) {
|
||||
super({
|
||||
actionClassName: 'monaco-regex',
|
||||
actionClassName: 'codicon-regex',
|
||||
title: NLS_REGEX_CHECKBOX_LABEL + opts.appendTitle,
|
||||
isChecked: opts.isChecked,
|
||||
inputActiveOptionBorder: opts.inputActiveOptionBorder,
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.53437 12.4673H7.4361L6.53859 10.0936H2.94854L2.10418 12.4673H1L4.24757 4H5.27499L8.53437 12.4673ZM6.21383 9.20202L4.88528 5.59426C4.84198 5.47617 4.79868 5.28722 4.75538 5.02741H4.73176C4.69239 5.26754 4.64713 5.45649 4.59595 5.59426L3.27921 9.20202H6.21383Z" fill="#C5C5C5"/>
|
||||
<path d="M9.78617 12.4673V4H12.1953C12.9275 4 13.5081 4.17911 13.9372 4.53733C14.3662 4.89554 14.5808 5.36201 14.5808 5.93674C14.5808 6.41698 14.4509 6.83425 14.1911 7.18853C13.9313 7.54281 13.573 7.79474 13.1164 7.94433V7.96795C13.6872 8.03487 14.1438 8.25137 14.4863 8.61746C14.8288 8.97961 15 9.45199 15 10.0346C15 10.7589 14.7402 11.3454 14.2206 11.7942C13.701 12.2429 13.0456 12.4673 12.2543 12.4673H9.78617ZM10.7782 4.89751V7.63138H11.7938C12.337 7.63138 12.7641 7.50148 13.0751 7.24167C13.3861 6.97793 13.5415 6.6079 13.5415 6.13159C13.5415 5.30887 13.0003 4.89751 11.9178 4.89751H10.7782ZM10.7782 8.52299V11.5698H12.1244C12.707 11.5698 13.1577 11.432 13.4766 11.1565C13.7994 10.8809 13.9608 10.503 13.9608 10.0228C13.9608 9.02292 13.2798 8.52299 11.9178 8.52299H10.7782Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,4 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.53437 12.4673H7.4361L6.53859 10.0936H2.94854L2.10418 12.4673H1L4.24757 4H5.27499L8.53437 12.4673ZM6.21383 9.20202L4.88528 5.59426C4.84198 5.47617 4.79868 5.28722 4.75538 5.02741H4.73176C4.69239 5.26754 4.64713 5.45649 4.59595 5.59426L3.27921 9.20202H6.21383Z" fill="white"/>
|
||||
<path d="M9.78617 12.4673V4H12.1953C12.9275 4 13.5081 4.17911 13.9372 4.53733C14.3662 4.89554 14.5808 5.36201 14.5808 5.93674C14.5808 6.41698 14.4509 6.83425 14.1911 7.18853C13.9313 7.54281 13.573 7.79474 13.1164 7.94433V7.96795C13.6872 8.03487 14.1438 8.25137 14.4863 8.61746C14.8288 8.97961 15 9.45199 15 10.0346C15 10.7589 14.7402 11.3454 14.2206 11.7942C13.701 12.2429 13.0456 12.4673 12.2543 12.4673H9.78617ZM10.7782 4.89751V7.63138H11.7938C12.337 7.63138 12.7641 7.50148 13.0751 7.24167C13.3861 6.97793 13.5415 6.6079 13.5415 6.13159C13.5415 5.30887 13.0003 4.89751 11.9178 4.89751H10.7782ZM10.7782 8.52299V11.5698H12.1244C12.707 11.5698 13.1577 11.432 13.4766 11.1565C13.7994 10.8809 13.9608 10.503 13.9608 10.0228C13.9608 9.02292 13.2798 8.52299 11.9178 8.52299H10.7782Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,4 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.53437 12.4673H7.4361L6.53859 10.0936H2.94854L2.10418 12.4673H1L4.24757 4H5.27499L8.53437 12.4673ZM6.21383 9.20202L4.88528 5.59426C4.84198 5.47617 4.79868 5.28722 4.75538 5.02741H4.73176C4.69239 5.26754 4.64713 5.45649 4.59595 5.59426L3.27921 9.20202H6.21383Z" fill="#424242"/>
|
||||
<path d="M9.78617 12.4673V4H12.1953C12.9275 4 13.5081 4.17911 13.9372 4.53733C14.3662 4.89554 14.5808 5.36201 14.5808 5.93674C14.5808 6.41698 14.4509 6.83425 14.1911 7.18853C13.9313 7.54281 13.573 7.79474 13.1164 7.94433V7.96795C13.6872 8.03487 14.1438 8.25137 14.4863 8.61746C14.8288 8.97961 15 9.45199 15 10.0346C15 10.7589 14.7402 11.3454 14.2206 11.7942C13.701 12.2429 13.0456 12.4673 12.2543 12.4673H9.78617ZM10.7782 4.89751V7.63138H11.7938C12.337 7.63138 12.7641 7.50148 13.0751 7.24167C13.3861 6.97793 13.5415 6.6079 13.5415 6.13159C13.5415 5.30887 13.0003 4.89751 11.9178 4.89751H10.7782ZM10.7782 8.52299V11.5698H12.1244C12.707 11.5698 13.1577 11.432 13.4766 11.1565C13.7994 10.8809 13.9608 10.503 13.9608 10.0228C13.9608 9.02292 13.2798 8.52299 11.9178 8.52299H10.7782Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0122 2H10.9879V5.11346L13.5489 3.55609L14.034 4.44095L11.4702 6L14.034 7.55905L13.5489 8.44391L10.9879 6.88654V10H10.0122V6.88654L7.45114 8.44391L6.96606 7.55905L9.5299 6L6.96606 4.44095L7.45114 3.55609L10.0122 5.11346V2ZM2 10H6V14H2V10Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 412 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0122 2H10.9879V5.11346L13.5489 3.55609L14.034 4.44095L11.4702 6L14.034 7.55905L13.5489 8.44391L10.9879 6.88654V10H10.0122V6.88654L7.45114 8.44391L6.96606 7.55905L9.5299 6L6.96606 4.44095L7.45114 3.55609L10.0122 5.11346V2ZM2 10H6V14H2V10Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 410 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0122 2H10.9879V5.11346L13.5489 3.55609L14.034 4.44095L11.4702 6L14.034 7.55905L13.5489 8.44391L10.9879 6.88654V10H10.0122V6.88654L7.45114 8.44391L6.96606 7.55905L9.5299 6L6.96606 4.44095L7.45114 3.55609L10.0122 5.11346V2ZM2 10H6V14H2V10Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 412 B |
@@ -41,7 +41,7 @@ export class PreserveCaseCheckbox extends Checkbox {
|
||||
constructor(opts: IFindInputCheckboxOpts) {
|
||||
super({
|
||||
// TODO: does this need its own icon?
|
||||
actionClassName: 'monaco-case-sensitive',
|
||||
actionClassName: 'codicon-preserve-case',
|
||||
title: NLS_PRESERVE_CASE_LABEL + opts.appendTitle,
|
||||
isChecked: opts.isChecked,
|
||||
inputActiveOptionBorder: opts.inputActiveOptionBorder
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1 2H15V3H1V2ZM14 4H13V12H14V4ZM11.272 8.387C11.194 8.088 11.073 7.825 10.912 7.601C10.751 7.377 10.547 7.2 10.303 7.071C10.059 6.942 9.769 6.878 9.437 6.878C9.239 6.878 9.057 6.902 8.89 6.951C8.725 7 8.574 7.068 8.437 7.156C8.301 7.244 8.18 7.35 8.072 7.474L7.893 7.732V4.578H7V12H7.893V11.425L8.019 11.6C8.106 11.702 8.208 11.79 8.323 11.869C8.44 11.947 8.572 12.009 8.721 12.055C8.87 12.101 9.035 12.123 9.219 12.123C9.572 12.123 9.885 12.052 10.156 11.911C10.428 11.768 10.655 11.573 10.838 11.325C11.021 11.075 11.159 10.782 11.252 10.446C11.345 10.108 11.392 9.743 11.392 9.349C11.391 9.007 11.352 8.686 11.272 8.387ZM9.793 7.78C9.944 7.851 10.075 7.956 10.183 8.094C10.292 8.234 10.377 8.407 10.438 8.611C10.489 8.785 10.52 8.982 10.527 9.198L10.52 9.323C10.52 9.65 10.487 9.943 10.42 10.192C10.353 10.438 10.259 10.645 10.142 10.806C10.025 10.968 9.882 11.091 9.721 11.172C9.399 11.334 8.961 11.338 8.652 11.187C8.499 11.112 8.366 11.012 8.259 10.891C8.174 10.795 8.103 10.675 8.041 10.524C8.041 10.524 7.862 10.077 7.862 9.577C7.862 9.077 8.041 8.575 8.041 8.575C8.103 8.398 8.177 8.257 8.265 8.145C8.379 8.002 8.521 7.886 8.689 7.8C8.857 7.714 9.054 7.671 9.276 7.671C9.466 7.671 9.64 7.708 9.793 7.78ZM15 13H1V14H15V13ZM2.813 10L2.085 12.031H1L1.025 11.959L3.466 4.87305H4.407L6.892 12.031H5.81L5.032 10H2.813ZM3.934 6.42205H3.912L3.007 9.17505H4.848L3.934 6.42205Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1 2H15V3H1V2ZM14 4H13V12H14V4ZM11.272 8.387C11.194 8.088 11.073 7.825 10.912 7.601C10.751 7.377 10.547 7.2 10.303 7.071C10.059 6.942 9.769 6.878 9.437 6.878C9.239 6.878 9.057 6.902 8.89 6.951C8.725 7 8.574 7.068 8.437 7.156C8.301 7.244 8.18 7.35 8.072 7.474L7.893 7.732V4.578H7V12H7.893V11.425L8.019 11.6C8.106 11.702 8.208 11.79 8.323 11.869C8.44 11.947 8.572 12.009 8.721 12.055C8.87 12.101 9.035 12.123 9.219 12.123C9.572 12.123 9.885 12.052 10.156 11.911C10.428 11.768 10.655 11.573 10.838 11.325C11.021 11.075 11.159 10.782 11.252 10.446C11.345 10.108 11.392 9.743 11.392 9.349C11.391 9.007 11.352 8.686 11.272 8.387ZM9.793 7.78C9.944 7.851 10.075 7.956 10.183 8.094C10.292 8.234 10.377 8.407 10.438 8.611C10.489 8.785 10.52 8.982 10.527 9.198L10.52 9.323C10.52 9.65 10.487 9.943 10.42 10.192C10.353 10.438 10.259 10.645 10.142 10.806C10.025 10.968 9.882 11.091 9.721 11.172C9.399 11.334 8.961 11.338 8.652 11.187C8.499 11.112 8.366 11.012 8.259 10.891C8.174 10.795 8.103 10.675 8.041 10.524C8.041 10.524 7.862 10.077 7.862 9.577C7.862 9.077 8.041 8.575 8.041 8.575C8.103 8.398 8.177 8.257 8.265 8.145C8.379 8.002 8.521 7.886 8.689 7.8C8.857 7.714 9.054 7.671 9.276 7.671C9.466 7.671 9.64 7.708 9.793 7.78ZM15 13H1V14H15V13ZM2.813 10L2.085 12.031H1L1.025 11.959L3.466 4.87305H4.407L6.892 12.031H5.81L5.032 10H2.813ZM3.934 6.42205H3.912L3.007 9.17505H4.848L3.934 6.42205Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1 2H15V3H1V2ZM14 4H13V12H14V4ZM11.272 8.387C11.194 8.088 11.073 7.825 10.912 7.601C10.751 7.377 10.547 7.2 10.303 7.071C10.059 6.942 9.769 6.878 9.437 6.878C9.239 6.878 9.057 6.902 8.89 6.951C8.725 7 8.574 7.068 8.437 7.156C8.301 7.244 8.18 7.35 8.072 7.474L7.893 7.732V4.578H7V12H7.893V11.425L8.019 11.6C8.106 11.702 8.208 11.79 8.323 11.869C8.44 11.947 8.572 12.009 8.721 12.055C8.87 12.101 9.035 12.123 9.219 12.123C9.572 12.123 9.885 12.052 10.156 11.911C10.428 11.768 10.655 11.573 10.838 11.325C11.021 11.075 11.159 10.782 11.252 10.446C11.345 10.108 11.392 9.743 11.392 9.349C11.391 9.007 11.352 8.686 11.272 8.387ZM9.793 7.78C9.944 7.851 10.075 7.956 10.183 8.094C10.292 8.234 10.377 8.407 10.438 8.611C10.489 8.785 10.52 8.982 10.527 9.198L10.52 9.323C10.52 9.65 10.487 9.943 10.42 10.192C10.353 10.438 10.259 10.645 10.142 10.806C10.025 10.968 9.882 11.091 9.721 11.172C9.399 11.334 8.961 11.338 8.652 11.187C8.499 11.112 8.366 11.012 8.259 10.891C8.174 10.795 8.103 10.675 8.041 10.524C8.041 10.524 7.862 10.077 7.862 9.577C7.862 9.077 8.041 8.575 8.041 8.575C8.103 8.398 8.177 8.257 8.265 8.145C8.379 8.002 8.521 7.886 8.689 7.8C8.857 7.714 9.054 7.671 9.276 7.671C9.466 7.671 9.64 7.708 9.793 7.78ZM15 13H1V14H15V13ZM2.813 10L2.085 12.031H1L1.025 11.959L3.466 4.87305H4.407L6.892 12.031H5.81L5.032 10H2.813ZM3.934 6.42205H3.912L3.007 9.17505H4.848L3.934 6.42205Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { renderOcticons } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
|
||||
import { renderCodicons } from 'vs/base/browser/ui/codiconLabel/codiconLabel';
|
||||
import { escape } from 'vs/base/common/strings';
|
||||
|
||||
export interface IHighlight {
|
||||
@@ -65,13 +65,13 @@ export class HighlightedLabel {
|
||||
if (pos < highlight.start) {
|
||||
htmlContent += '<span>';
|
||||
const substring = this.text.substring(pos, highlight.start);
|
||||
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
|
||||
htmlContent += this.supportOcticons ? renderCodicons(substring) : escape(substring);
|
||||
htmlContent += '</span>';
|
||||
pos = highlight.end;
|
||||
}
|
||||
htmlContent += '<span class="highlight">';
|
||||
const substring = this.text.substring(highlight.start, highlight.end);
|
||||
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
|
||||
htmlContent += this.supportOcticons ? renderCodicons(substring) : escape(substring);
|
||||
htmlContent += '</span>';
|
||||
pos = highlight.end;
|
||||
}
|
||||
@@ -79,7 +79,7 @@ export class HighlightedLabel {
|
||||
if (pos < this.text.length) {
|
||||
htmlContent += '<span>';
|
||||
const substring = this.text.substring(pos);
|
||||
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
|
||||
htmlContent += this.supportOcticons ? renderCodicons(substring) : escape(substring);
|
||||
htmlContent += '</span>';
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.monaco-inputbox .monaco-action-bar .action-item .icon {
|
||||
.monaco-inputbox .monaco-action-bar .action-item .codicon {
|
||||
background-repeat: no-repeat;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@font-face {
|
||||
font-family: "octicons2";
|
||||
src: url("./octicons2.ttf?90586c9ac0aa804395e9c9c0d15d1094") format("truetype");
|
||||
src: url("./octicons2.ttf?aa78025ff36faa0aebb5b864685c6dc4") format("truetype");
|
||||
}
|
||||
|
||||
.octicon, .mega-octicon {
|
||||
|
||||
@@ -68,7 +68,8 @@
|
||||
}
|
||||
|
||||
/* TODO: actions should be part of the panel, but they aren't yet */
|
||||
.monaco-panel-view .panel > .panel-header > .actions .action-label.icon {
|
||||
.monaco-panel-view .panel > .panel-header > .actions .action-label.icon,
|
||||
.monaco-panel-view .panel > .panel-header > .actions .action-label.codicon {
|
||||
width: 28px;
|
||||
height: 22px;
|
||||
background-size: 16px;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
|
||||
export namespace Schemas {
|
||||
@@ -60,7 +60,7 @@ class RemoteAuthoritiesImpl {
|
||||
private readonly _ports: { [authority: string]: number; };
|
||||
private readonly _connectionTokens: { [authority: string]: string; };
|
||||
private _preferredWebSchema: 'http' | 'https';
|
||||
private _delegate: ((uri: URI) => UriComponents) | null;
|
||||
private _delegate: ((uri: URI) => URI) | null;
|
||||
|
||||
constructor() {
|
||||
this._hosts = Object.create(null);
|
||||
@@ -74,7 +74,7 @@ class RemoteAuthoritiesImpl {
|
||||
this._preferredWebSchema = schema;
|
||||
}
|
||||
|
||||
public setDelegate(delegate: (uri: URI) => UriComponents): void {
|
||||
public setDelegate(delegate: (uri: URI) => URI): void {
|
||||
this._delegate = delegate;
|
||||
}
|
||||
|
||||
@@ -89,8 +89,7 @@ class RemoteAuthoritiesImpl {
|
||||
|
||||
public rewrite(uri: URI): URI {
|
||||
if (this._delegate) {
|
||||
const result = this._delegate(uri);
|
||||
return URI.revive(result);
|
||||
return this._delegate(uri);
|
||||
}
|
||||
const authority = uri.authority;
|
||||
const host = this._hosts[authority];
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Menu, MenuItem, BrowserWindow, Event, ipcMain } from 'electron';
|
||||
import { Menu, MenuItem, BrowserWindow, ipcMain } from 'electron';
|
||||
import { ISerializableContextMenuItem, CONTEXT_MENU_CLOSE_CHANNEL, CONTEXT_MENU_CHANNEL, IPopupOptions } from 'vs/base/parts/contextmenu/common/contextmenu';
|
||||
|
||||
export function registerContextMenuListener(): void {
|
||||
ipcMain.on(CONTEXT_MENU_CHANNEL, (event: Event, contextMenuId: number, items: ISerializableContextMenuItem[], onClickChannel: string, options?: IPopupOptions) => {
|
||||
ipcMain.on(CONTEXT_MENU_CHANNEL, (event: Electron.IpcMainEvent, contextMenuId: number, items: ISerializableContextMenuItem[], onClickChannel: string, options?: IPopupOptions) => {
|
||||
const menu = createMenu(event, onClickChannel, items);
|
||||
|
||||
menu.popup({
|
||||
@@ -27,7 +27,7 @@ export function registerContextMenuListener(): void {
|
||||
});
|
||||
}
|
||||
|
||||
function createMenu(event: Event, onClickChannel: string, items: ISerializableContextMenuItem[]): Menu {
|
||||
function createMenu(event: Electron.IpcMainEvent, onClickChannel: string, items: ISerializableContextMenuItem[]): Menu {
|
||||
const menu = new Menu();
|
||||
|
||||
items.forEach(item => {
|
||||
|
||||
@@ -32,7 +32,6 @@ export interface IServerChannel<TContext = string> {
|
||||
listen<T>(ctx: TContext, event: string, arg?: any): Event<T>;
|
||||
}
|
||||
|
||||
|
||||
export const enum RequestType {
|
||||
Promise = 100,
|
||||
PromiseCancel = 101,
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9 9H4V10H9V9Z" fill="#C5C5C5"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3L6 2H13L14 3V10L13 11H11V13L10 14H3L2 13V6L3 5H5V3ZM6 5H10L11 6V10H13V3H6V5ZM10 6H3V13H10V6Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 309 B |
@@ -1,4 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9 9H4V10H9V9Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3L6 2H13L14 3V10L13 11H11V13L10 14H3L2 13V6L3 5H5V3ZM6 5H10L11 6V10H13V3H6V5ZM10 6H3V13H10V6Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 305 B |
@@ -1,4 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9 9H4V10H9V9Z" fill="#424242"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3L6 2H13L14 3V10L13 11H11V13L10 14H3L2 13V6L3 5H5V3ZM6 5H10L11 6V10H13V3H6V5ZM10 6H3V13H10V6Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 309 B |
@@ -120,15 +120,3 @@
|
||||
.hc-black .monaco-tree .monaco-tree-rows > .monaco-tree-row.has-children.loading > .content:before {
|
||||
background-image: url('loading-hc.svg');
|
||||
}
|
||||
|
||||
.monaco-tree-action.collapse-all {
|
||||
background: url('collapse-all-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-tree-action.collapse-all {
|
||||
background: url('collapse-all-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.hc-black .monaco-tree-action.collapse-all {
|
||||
background: url('collapse-all-hc.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
default-src 'self';
|
||||
img-src 'self' https: data: blob:;
|
||||
media-src 'none';
|
||||
script-src 'self' https://az416426.vo.msecnd.net 'unsafe-eval' https: 'sha256-4DqvCTjCHj2KW4QxC/Yt6uBwMRyYiEg7kOoykSEkonQ=' 'sha256-meDZW3XhN5JmdjFUrWGhTouRKBiWYtXHltaKnqn/WMo=';
|
||||
script-src 'self' https://az416426.vo.msecnd.net 'unsafe-eval' https: 'sha256-AMRGFXNZ7mBnD/6F4lTV00XAjE5CBSM7ZeIv3DIp5YM=' 'sha256-meDZW3XhN5JmdjFUrWGhTouRKBiWYtXHltaKnqn/WMo=';
|
||||
child-src 'self';
|
||||
frame-src 'self' https://*.vscode-webview-test.com;
|
||||
worker-src 'self';
|
||||
@@ -44,13 +44,13 @@
|
||||
self.require = {
|
||||
baseUrl: `${window.location.origin}/static/out`,
|
||||
paths: {
|
||||
'vscode-textmate': `${window.location.origin}/static/node_modules/vscode-textmate/release/main`,
|
||||
'onigasm-umd': `${window.location.origin}/static/node_modules/onigasm-umd/release/main`,
|
||||
'xterm': `${window.location.origin}/static/node_modules/xterm/lib/xterm.js`,
|
||||
'xterm-addon-search': `${window.location.origin}/static/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
|
||||
'xterm-addon-web-links': `${window.location.origin}/static/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
|
||||
'semver-umd': `${window.location.origin}/static/node_modules/semver-umd/lib/semver-umd.js`,
|
||||
'@microsoft/applicationinsights-web': `${window.location.origin}/static/node_modules/@microsoft/applicationinsights-web/dist/applicationinsights-web.js`,
|
||||
'vscode-textmate': `${window.location.origin}/static/remote/web/node_modules/vscode-textmate/release/main`,
|
||||
'onigasm-umd': `${window.location.origin}/static/remote/web/node_modules/onigasm-umd/release/main`,
|
||||
'xterm': `${window.location.origin}/static/remote/web/node_modules/xterm/lib/xterm.js`,
|
||||
'xterm-addon-search': `${window.location.origin}/static/remote/web/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
|
||||
'xterm-addon-web-links': `${window.location.origin}/static/remote/web/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
|
||||
'semver-umd': `${window.location.origin}/static/remote/web/node_modules/semver-umd/lib/semver-umd.js`,
|
||||
'@microsoft/applicationinsights-web': `${window.location.origin}/static/remote/web/node_modules/@microsoft/applicationinsights-web/dist/applicationinsights-web.js`,
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -3,16 +3,12 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IWorkbenchConstructionOptions, create } from 'vs/workbench/workbench.web.api';
|
||||
import { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { IWorkbenchConstructionOptions, create, URI, Event, Emitter, UriComponents, ICredentialsProvider, IURLCallbackProvider } from 'vs/workbench/workbench.web.api';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { streamToBuffer } from 'vs/base/common/buffer';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { request } from 'vs/base/parts/request/browser/request';
|
||||
import { ICredentialsProvider } from 'vs/workbench/services/credentials/browser/credentialsService';
|
||||
|
||||
interface ICredential {
|
||||
service: string;
|
||||
@@ -24,7 +20,7 @@ class LocalStorageCredentialsProvider implements ICredentialsProvider {
|
||||
|
||||
static readonly CREDENTIALS_OPENED_KEY = 'credentials.provider';
|
||||
|
||||
private _credentials: ICredential[];
|
||||
private _credentials!: ICredential[];
|
||||
private get credentials(): ICredential[] {
|
||||
if (!this._credentials) {
|
||||
try {
|
||||
@@ -205,4 +201,12 @@ const options: IWorkbenchConstructionOptions = JSON.parse(document.getElementByI
|
||||
options.urlCallbackProvider = new PollingURLCallbackProvider();
|
||||
options.credentialsProvider = new LocalStorageCredentialsProvider();
|
||||
|
||||
if (options.folderUri) {
|
||||
options.folderUri = URI.revive(options.folderUri);
|
||||
}
|
||||
|
||||
if (options.workspaceUri) {
|
||||
options.workspaceUri = URI.revive(options.workspaceUri);
|
||||
}
|
||||
|
||||
create(document.body, options);
|
||||
|
||||
@@ -10,8 +10,7 @@ import { $ } from 'vs/base/browser/dom';
|
||||
import * as collections from 'vs/base/common/collections';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import { escape } from 'vs/base/common/strings';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import * as os from 'os';
|
||||
import { debounce } from 'vs/base/common/decorators';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
@@ -33,7 +32,7 @@ import { EnvironmentService } from 'vs/platform/environment/node/environmentServ
|
||||
import { IssueReporterModel, IssueReporterData as IssueReporterModelData } from 'vs/code/electron-browser/issue/issueReporterModel';
|
||||
import { IssueReporterData, IssueReporterStyles, IssueType, ISettingsSearchIssueReporterData, IssueReporterFeatures, IssueReporterExtensionData } from 'vs/platform/issue/node/issue';
|
||||
import BaseHtml from 'vs/code/electron-browser/issue/issueReporterPage';
|
||||
import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
|
||||
import { LoggerChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
|
||||
import { ILogService, getLogLevel } from 'vs/platform/log/common/log';
|
||||
import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
|
||||
import { normalizeGitHubUrl } from 'vs/code/electron-browser/issue/issueReporterUtil';
|
||||
@@ -85,7 +84,7 @@ export class IssueReporter extends Disposable {
|
||||
this.issueReporterModel = new IssueReporterModel({
|
||||
issueType: configuration.data.issueType || IssueType.Bug,
|
||||
versionInfo: {
|
||||
vscodeVersion: `${pkg.name} ${pkg.version} (${product.commit || 'Commit unknown'}, ${product.date || 'Date unknown'})`,
|
||||
vscodeVersion: `${product.nameShort} ${product.version} (${product.commit || 'Commit unknown'}, ${product.date || 'Date unknown'})`,
|
||||
os: `${os.type()} ${os.arch()} ${os.release()}${isSnap ? ' snap' : ''}`
|
||||
},
|
||||
extensionsDisabled: !!this.environmentService.disableExtensions,
|
||||
@@ -301,8 +300,8 @@ export class IssueReporter extends Disposable {
|
||||
this.environmentService = new EnvironmentService(configuration, configuration.execPath);
|
||||
|
||||
const logService = new SpdLogService(`issuereporter${configuration.windowId}`, this.environmentService.logsPath, getLogLevel(this.environmentService));
|
||||
const logLevelClient = new LogLevelSetterChannelClient(mainProcessService.getChannel('loglevel'));
|
||||
this.logService = new FollowerLogService(logLevelClient, logService);
|
||||
const loggerClient = new LoggerChannelClient(mainProcessService.getChannel('logger'));
|
||||
this.logService = new FollowerLogService(loggerClient, logService);
|
||||
|
||||
const sharedProcess = (<IWindowsService>serviceCollection.get(IWindowsService)).whenSharedProcessReady()
|
||||
.then(() => connectNet(this.environmentService.sharedIPCHandle, `window:${configuration.windowId}`));
|
||||
@@ -311,7 +310,7 @@ export class IssueReporter extends Disposable {
|
||||
if (!this.environmentService.isExtensionDevelopment && !this.environmentService.args['disable-telemetry'] && !!product.enableTelemetry) {
|
||||
const channel = getDelayedChannel(sharedProcess.then(c => c.getChannel('telemetryAppender')));
|
||||
const appender = combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(logService));
|
||||
const commonProperties = resolveCommonProperties(product.commit || 'Commit unknown', pkg.version, configuration.machineId, product.msftInternalDomains, this.environmentService.installSourcePath);
|
||||
const commonProperties = resolveCommonProperties(product.commit || 'Commit unknown', product.version, configuration.machineId, product.msftInternalDomains, this.environmentService.installSourcePath);
|
||||
const piiPaths = this.environmentService.extensionsPath ? [this.environmentService.appRoot, this.environmentService.extensionsPath] : [this.environmentService.appRoot];
|
||||
const config: ITelemetryServiceConfig = { appender, commonProperties, piiPaths };
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ html:lang(zh-Hant) {
|
||||
}
|
||||
|
||||
html:lang(ja) {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Meiryo", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Yu Gothic UI", "Meiryo UI", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif;
|
||||
}
|
||||
|
||||
html:lang(ko) {
|
||||
|
||||
@@ -17,7 +17,7 @@ html:lang(zh-Hant) {
|
||||
}
|
||||
|
||||
html:lang(ja) {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Meiryo", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Noto Sans", "Yu Gothic UI", "Meiryo UI", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif;
|
||||
}
|
||||
|
||||
html:lang(ko) {
|
||||
@@ -101,4 +101,4 @@ tbody > tr:hover {
|
||||
img {
|
||||
width: 16px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'vs/css!./media/processExplorer';
|
||||
import { webFrame, ipcRenderer, clipboard } from 'electron';
|
||||
import { repeat } from 'vs/base/common/strings';
|
||||
import { totalmem } from 'os';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { localize } from 'vs/nls';
|
||||
import { ProcessExplorerStyles, ProcessExplorerData } from 'vs/platform/issue/node/issue';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as path from 'vs/base/common/path';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
|
||||
import { IStringDictionary } from 'vs/base/common/collections';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
@@ -8,7 +8,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { toDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { readdir, rimraf, stat } from 'vs/base/node/pfs';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
|
||||
export class NodeCachedDataCleaner {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { join } from 'vs/base/common/path';
|
||||
import { readdir, readFile, rimraf } from 'vs/base/node/pfs';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IBackupWorkspacesFormat } from 'vs/platform/backup/common/backup';
|
||||
import { IBackupWorkspacesFormat } from 'vs/platform/backup/node/backup';
|
||||
|
||||
export class StorageDataCleaner extends Disposable {
|
||||
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { serve, Server, connect } from 'vs/base/parts/ipc/node/ipc.net';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
@@ -27,11 +26,11 @@ import { resolveCommonProperties } from 'vs/platform/telemetry/node/commonProper
|
||||
import { TelemetryAppenderChannel } from 'vs/platform/telemetry/node/telemetryIpc';
|
||||
import { TelemetryService, ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
|
||||
import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import { IWindowsService, ActiveWindowManager } from 'vs/platform/windows/common/windows';
|
||||
import { WindowsService } from 'vs/platform/windows/electron-browser/windowsService';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
|
||||
import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
|
||||
import { LoggerChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
|
||||
import { LocalizationsService } from 'vs/platform/localizations/node/localizations';
|
||||
import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
|
||||
import { LocalizationsChannel } from 'vs/platform/localizations/node/localizationsIpc';
|
||||
@@ -51,7 +50,12 @@ import { FileService } from 'vs/platform/files/common/fileService';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { DiskFileSystemProvider } from 'vs/platform/files/electron-browser/diskFileSystemProvider';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { IProductService } from 'vs/platform/product/common/product';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { IUserDataSyncService, IUserDataSyncStoreService, ISettingsMergeService } from 'vs/platform/userDataSync/common/userDataSync';
|
||||
import { UserDataSyncService, UserDataAutoSync } from 'vs/platform/userDataSync/common/userDataSyncService';
|
||||
import { UserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSyncStoreService';
|
||||
import { UserDataSyncChannel } from 'vs/platform/userDataSync/common/userDataSyncIpc';
|
||||
import { SettingsMergeChannelClient } from 'vs/platform/userDataSync/common/settingsSyncIpc';
|
||||
|
||||
export interface ISharedProcessConfiguration {
|
||||
readonly machineId: string;
|
||||
@@ -97,8 +101,8 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
|
||||
const environmentService = new EnvironmentService(initData.args, process.execPath);
|
||||
|
||||
const mainRouter = new StaticRouter(ctx => ctx === 'main');
|
||||
const logLevelClient = new LogLevelSetterChannelClient(server.getChannel('loglevel', mainRouter));
|
||||
const logService = new FollowerLogService(logLevelClient, new SpdLogService('sharedprocess', environmentService.logsPath, initData.logLevel));
|
||||
const loggerClient = new LoggerChannelClient(server.getChannel('logger', mainRouter));
|
||||
const logService = new FollowerLogService(loggerClient, new SpdLogService('sharedprocess', environmentService.logsPath, initData.logLevel));
|
||||
disposables.add(logService);
|
||||
logService.info('main', JSON.stringify(configuration));
|
||||
|
||||
@@ -118,6 +122,11 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
|
||||
const windowsService = new WindowsService(mainProcessService);
|
||||
services.set(IWindowsService, windowsService);
|
||||
|
||||
const activeWindowManager = new ActiveWindowManager(windowsService);
|
||||
const activeWindowRouter = new StaticRouter(ctx => activeWindowManager.getActiveClientId().then(id => ctx === id));
|
||||
const settingsMergeChannel = server.getChannel('settingsMerge', activeWindowRouter);
|
||||
services.set(ISettingsMergeService, new SettingsMergeChannelClient(settingsMergeChannel));
|
||||
|
||||
// Files
|
||||
const fileService = new FileService(logService);
|
||||
services.set(IFileService, fileService);
|
||||
@@ -136,7 +145,7 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
|
||||
const services = new ServiceCollection();
|
||||
const environmentService = accessor.get(IEnvironmentService);
|
||||
const { appRoot, extensionsPath, extensionDevelopmentLocationURI: extensionDevelopmentLocationURI, isBuilt, installSourcePath } = environmentService;
|
||||
const telemetryLogService = new FollowerLogService(logLevelClient, new SpdLogService('telemetry', environmentService.logsPath, initData.logLevel));
|
||||
const telemetryLogService = new FollowerLogService(loggerClient, new SpdLogService('telemetry', environmentService.logsPath, initData.logLevel));
|
||||
telemetryLogService.info('The below are logs for every telemetry event sent from VS Code once the log level is set to trace.');
|
||||
telemetryLogService.info('===========================================================');
|
||||
|
||||
@@ -148,7 +157,7 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
|
||||
}
|
||||
const config: ITelemetryServiceConfig = {
|
||||
appender: combinedAppender(appInsightsAppender, new LogAppender(logService)),
|
||||
commonProperties: resolveCommonProperties(product.commit, pkg.version, configuration.machineId, product.msftInternalDomains, installSourcePath),
|
||||
commonProperties: resolveCommonProperties(product.commit, product.version, configuration.machineId, product.msftInternalDomains, installSourcePath),
|
||||
piiPaths: extensionsPath ? [appRoot, extensionsPath] : [appRoot]
|
||||
};
|
||||
|
||||
@@ -164,6 +173,8 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
|
||||
services.set(IExtensionGalleryService, new SyncDescriptor(ExtensionGalleryService));
|
||||
services.set(ILocalizationsService, new SyncDescriptor(LocalizationsService));
|
||||
services.set(IDiagnosticsService, new SyncDescriptor(DiagnosticsService));
|
||||
services.set(IUserDataSyncStoreService, new SyncDescriptor(UserDataSyncStoreService));
|
||||
services.set(IUserDataSyncService, new SyncDescriptor(UserDataSyncService));
|
||||
|
||||
const instantiationService2 = instantiationService.createChild(services);
|
||||
|
||||
@@ -181,6 +192,10 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
|
||||
const diagnosticsChannel = new DiagnosticsChannel(diagnosticsService);
|
||||
server.registerChannel('diagnostics', diagnosticsChannel);
|
||||
|
||||
const userDataSyncService = accessor.get(IUserDataSyncService);
|
||||
const userDataSyncChannel = new UserDataSyncChannel(userDataSyncService);
|
||||
server.registerChannel('userDataSync', userDataSyncChannel);
|
||||
|
||||
// clean up deprecated extensions
|
||||
(extensionManagementService as ExtensionManagementService).removeDeprecatedExtensions();
|
||||
// update localizations cache
|
||||
@@ -190,7 +205,8 @@ async function main(server: Server, initData: ISharedProcessInitData, configurat
|
||||
instantiationService2.createInstance(NodeCachedDataCleaner),
|
||||
instantiationService2.createInstance(LanguagePackCachedDataCleaner),
|
||||
instantiationService2.createInstance(StorageDataCleaner),
|
||||
instantiationService2.createInstance(LogsDataCleaner)
|
||||
instantiationService2.createInstance(LogsDataCleaner),
|
||||
instantiationService2.createInstance(UserDataAutoSync)
|
||||
));
|
||||
disposables.add(extensionManagementService as ExtensionManagementService);
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ import { WindowsManager } from 'vs/code/electron-main/windows';
|
||||
import { IWindowsService, OpenContext, ActiveWindowManager, IURIToOpen } from 'vs/platform/windows/common/windows';
|
||||
import { WindowsChannel } from 'vs/platform/windows/common/windowsIpc';
|
||||
import { WindowsService } from 'vs/platform/windows/electron-main/windowsService';
|
||||
import { ILifecycleService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMain';
|
||||
import { ILifecycleMainService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMainService';
|
||||
import { getShellEnvironment } from 'vs/code/node/shellEnv';
|
||||
import { IUpdateService } from 'vs/platform/update/common/update';
|
||||
import { UpdateChannel } from 'vs/platform/update/electron-main/updateIpc';
|
||||
@@ -17,7 +17,7 @@ import { Server as ElectronIPCServer } from 'vs/base/parts/ipc/electron-main/ipc
|
||||
import { Client } from 'vs/base/parts/ipc/common/ipc.net';
|
||||
import { Server, connect } from 'vs/base/parts/ipc/node/ipc.net';
|
||||
import { SharedProcess } from 'vs/code/electron-main/sharedProcess';
|
||||
import { LaunchService, LaunchChannel, ILaunchService } from 'vs/platform/launch/electron-main/launchService';
|
||||
import { LaunchMainService, LaunchChannel, ILaunchMainService } from 'vs/platform/launch/electron-main/launchService';
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
@@ -33,28 +33,26 @@ import { TelemetryAppenderClient } from 'vs/platform/telemetry/node/telemetryIpc
|
||||
import { TelemetryService, ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { resolveCommonProperties } from 'vs/platform/telemetry/node/commonProperties';
|
||||
import { getDelayedChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
import { SimpleServiceProxyChannel } from 'vs/platform/ipc/node/simpleIpcProxy';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { ProxyAuthHandler } from 'vs/code/electron-main/auth';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IWindowsMainService, ICodeWindow } from 'vs/platform/windows/electron-main/windows';
|
||||
import { IHistoryMainService } from 'vs/platform/history/common/history';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { WorkspacesChannel } from 'vs/platform/workspaces/node/workspacesIpc';
|
||||
import { IWorkspacesMainService, hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { WorkspacesChannel } from 'vs/platform/workspaces/electron-main/workspacesIpc';
|
||||
import { hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { getMachineId } from 'vs/base/node/id';
|
||||
import { Win32UpdateService } from 'vs/platform/update/electron-main/updateService.win32';
|
||||
import { LinuxUpdateService } from 'vs/platform/update/electron-main/updateService.linux';
|
||||
import { DarwinUpdateService } from 'vs/platform/update/electron-main/updateService.darwin';
|
||||
import { IIssueService } from 'vs/platform/issue/node/issue';
|
||||
import { IssueChannel } from 'vs/platform/issue/node/issueIpc';
|
||||
import { IssueService } from 'vs/platform/issue/electron-main/issueService';
|
||||
import { LogLevelSetterChannel } from 'vs/platform/log/common/logIpc';
|
||||
import { IssueMainService } from 'vs/platform/issue/electron-main/issueMainService';
|
||||
import { LoggerChannel } from 'vs/platform/log/common/logIpc';
|
||||
import { setUnexpectedErrorHandler, onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { ElectronURLListener } from 'vs/platform/url/electron-main/electronUrlListener';
|
||||
import { serve as serveDriver } from 'vs/platform/driver/electron-main/driver';
|
||||
import { IMenubarService } from 'vs/platform/menubar/node/menubar';
|
||||
import { MenubarService } from 'vs/platform/menubar/electron-main/menubarService';
|
||||
import { MenubarMainService } from 'vs/platform/menubar/electron-main/menubarMainService';
|
||||
import { MenubarChannel } from 'vs/platform/menubar/node/menubarIpc';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { registerContextMenuListener } from 'vs/base/parts/contextmenu/electron-main/contextmenu';
|
||||
@@ -67,10 +65,10 @@ import { IStorageMainService, StorageMainService } from 'vs/platform/storage/nod
|
||||
import { GlobalStorageDatabaseChannel } from 'vs/platform/storage/node/storageIpc';
|
||||
import { startsWith } from 'vs/base/common/strings';
|
||||
import { BackupMainService } from 'vs/platform/backup/electron-main/backupMainService';
|
||||
import { IBackupMainService } from 'vs/platform/backup/common/backup';
|
||||
import { HistoryMainService } from 'vs/platform/history/electron-main/historyMainService';
|
||||
import { IBackupMainService } from 'vs/platform/backup/electron-main/backup';
|
||||
import { HistoryMainService, IHistoryMainService } from 'vs/platform/history/electron-main/historyMainService';
|
||||
import { URLService } from 'vs/platform/url/node/urlService';
|
||||
import { WorkspacesMainService } from 'vs/platform/workspaces/electron-main/workspacesMainService';
|
||||
import { WorkspacesMainService, IWorkspacesMainService } from 'vs/platform/workspaces/electron-main/workspacesMainService';
|
||||
import { statSync } from 'fs';
|
||||
import { DiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsIpc';
|
||||
import { IDiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsService';
|
||||
@@ -78,6 +76,8 @@ import { FileService } from 'vs/platform/files/common/fileService';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider';
|
||||
import { ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc';
|
||||
import { IElectronService } from 'vs/platform/electron/node/electron';
|
||||
import { ElectronMainService } from 'vs/platform/electron/electron-main/electronMainService';
|
||||
|
||||
export class CodeApplication extends Disposable {
|
||||
|
||||
@@ -92,7 +92,7 @@ export class CodeApplication extends Disposable {
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService,
|
||||
@ILifecycleService private readonly lifecycleService: ILifecycleService,
|
||||
@ILifecycleMainService private readonly lifecycleMainService: ILifecycleMainService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IStateService private readonly stateService: IStateService
|
||||
) {
|
||||
@@ -109,7 +109,7 @@ export class CodeApplication extends Disposable {
|
||||
process.on('unhandledRejection', (reason: unknown) => onUnexpectedError(reason));
|
||||
|
||||
// Dispose on shutdown
|
||||
this.lifecycleService.onWillShutdown(() => this.dispose());
|
||||
this.lifecycleMainService.onWillShutdown(() => this.dispose());
|
||||
|
||||
// Contextmenu via IPC support
|
||||
registerContextMenuListener();
|
||||
@@ -255,10 +255,10 @@ export class CodeApplication extends Disposable {
|
||||
this.logService.trace('IPC#vscode:exit', code);
|
||||
|
||||
this.dispose();
|
||||
this.lifecycleService.kill(code);
|
||||
this.lifecycleMainService.kill(code);
|
||||
});
|
||||
|
||||
ipc.on('vscode:fetchShellEnv', async (event: Event) => {
|
||||
ipc.on('vscode:fetchShellEnv', async (event: Electron.IpcMainEvent) => {
|
||||
const webContents = event.sender;
|
||||
|
||||
try {
|
||||
@@ -275,14 +275,14 @@ export class CodeApplication extends Disposable {
|
||||
}
|
||||
});
|
||||
|
||||
ipc.on('vscode:toggleDevTools', (event: Event) => event.sender.toggleDevTools());
|
||||
ipc.on('vscode:openDevTools', (event: Event) => event.sender.openDevTools());
|
||||
ipc.on('vscode:toggleDevTools', (event: Electron.IpcMainEvent) => event.sender.toggleDevTools());
|
||||
ipc.on('vscode:openDevTools', (event: Electron.IpcMainEvent) => event.sender.openDevTools());
|
||||
|
||||
ipc.on('vscode:reloadWindow', (event: Event) => event.sender.reload());
|
||||
ipc.on('vscode:reloadWindow', (event: Electron.IpcMainEvent) => event.sender.reload());
|
||||
|
||||
// Some listeners after window opened
|
||||
(async () => {
|
||||
await this.lifecycleService.when(LifecycleMainPhase.AfterWindowOpen);
|
||||
await this.lifecycleMainService.when(LifecycleMainPhase.AfterWindowOpen);
|
||||
|
||||
// After waking up from sleep (after window opened)
|
||||
powerMonitor.on('resume', () => {
|
||||
@@ -361,7 +361,7 @@ export class CodeApplication extends Disposable {
|
||||
// Spawn shared process after the first window has opened and 3s have passed
|
||||
const sharedProcess = this.instantiationService.createInstance(SharedProcess, machineId, this.userEnv);
|
||||
const sharedProcessClient = sharedProcess.whenReady().then(() => connect(this.environmentService.sharedIPCHandle, 'main'));
|
||||
this.lifecycleService.when(LifecycleMainPhase.AfterWindowOpen).then(() => {
|
||||
this.lifecycleMainService.when(LifecycleMainPhase.AfterWindowOpen).then(() => {
|
||||
this._register(new RunOnceScheduler(async () => {
|
||||
const userEnv = await getShellEnvironment(this.logService, this.environmentService);
|
||||
|
||||
@@ -424,7 +424,6 @@ export class CodeApplication extends Disposable {
|
||||
private async createServices(machineId: string, trueMachineId: string | undefined, sharedProcess: SharedProcess, sharedProcessClient: Promise<Client<string>>): Promise<IInstantiationService> {
|
||||
const services = new ServiceCollection();
|
||||
|
||||
// Files
|
||||
const fileService = this._register(new FileService(this.logService));
|
||||
services.set(IFileService, fileService);
|
||||
|
||||
@@ -451,17 +450,18 @@ export class CodeApplication extends Disposable {
|
||||
|
||||
services.set(IWindowsMainService, new SyncDescriptor(WindowsManager, [machineId, this.userEnv]));
|
||||
services.set(IWindowsService, new SyncDescriptor(WindowsService, [sharedProcess]));
|
||||
services.set(ILaunchService, new SyncDescriptor(LaunchService));
|
||||
services.set(ILaunchMainService, new SyncDescriptor(LaunchMainService));
|
||||
|
||||
const diagnosticsChannel = getDelayedChannel(sharedProcessClient.then(client => client.getChannel('diagnostics')));
|
||||
services.set(IDiagnosticsService, new SyncDescriptor(DiagnosticsService, [diagnosticsChannel]));
|
||||
|
||||
services.set(IIssueService, new SyncDescriptor(IssueService, [machineId, this.userEnv]));
|
||||
services.set(IMenubarService, new SyncDescriptor(MenubarService));
|
||||
services.set(IIssueService, new SyncDescriptor(IssueMainService, [machineId, this.userEnv]));
|
||||
services.set(IElectronService, new SyncDescriptor(ElectronMainService));
|
||||
services.set(IMenubarService, new SyncDescriptor(MenubarMainService));
|
||||
|
||||
const storageMainService = new StorageMainService(this.logService, this.environmentService);
|
||||
services.set(IStorageMainService, storageMainService);
|
||||
this.lifecycleService.onWillShutdown(e => e.join(storageMainService.close()));
|
||||
this.lifecycleMainService.onWillShutdown(e => e.join(storageMainService.close()));
|
||||
|
||||
const backupMainService = new BackupMainService(this.environmentService, this.configurationService, this.logService);
|
||||
services.set(IBackupMainService, backupMainService);
|
||||
@@ -474,7 +474,7 @@ export class CodeApplication extends Disposable {
|
||||
if (!this.environmentService.isExtensionDevelopment && !this.environmentService.args['disable-telemetry'] && !!product.enableTelemetry) {
|
||||
const channel = getDelayedChannel(sharedProcessClient.then(client => client.getChannel('telemetryAppender')));
|
||||
const appender = combinedAppender(new TelemetryAppenderClient(channel), new LogAppender(this.logService));
|
||||
const commonProperties = resolveCommonProperties(product.commit, pkg.version, machineId, product.msftInternalDomains, this.environmentService.installSourcePath);
|
||||
const commonProperties = resolveCommonProperties(product.commit, product.version, machineId, product.msftInternalDomains, this.environmentService.installSourcePath);
|
||||
const piiPaths = this.environmentService.extensionsPath ? [this.environmentService.appRoot, this.environmentService.extensionsPath] : [this.environmentService.appRoot];
|
||||
const config: ITelemetryServiceConfig = { appender, commonProperties, piiPaths, trueMachineId };
|
||||
|
||||
@@ -529,8 +529,8 @@ export class CodeApplication extends Disposable {
|
||||
private openFirstWindow(accessor: ServicesAccessor, electronIpcServer: ElectronIPCServer, sharedProcessClient: Promise<Client<string>>): ICodeWindow[] {
|
||||
|
||||
// Register more Main IPC services
|
||||
const launchService = accessor.get(ILaunchService);
|
||||
const launchChannel = new LaunchChannel(launchService);
|
||||
const launchMainService = accessor.get(ILaunchMainService);
|
||||
const launchChannel = new LaunchChannel(launchMainService);
|
||||
this.mainIpcServer.registerChannel('launch', launchChannel);
|
||||
|
||||
// Register more Electron IPC services
|
||||
@@ -539,11 +539,15 @@ export class CodeApplication extends Disposable {
|
||||
electronIpcServer.registerChannel('update', updateChannel);
|
||||
|
||||
const issueService = accessor.get(IIssueService);
|
||||
const issueChannel = new IssueChannel(issueService);
|
||||
const issueChannel = new SimpleServiceProxyChannel(issueService);
|
||||
electronIpcServer.registerChannel('issue', issueChannel);
|
||||
|
||||
const workspacesService = accessor.get(IWorkspacesMainService);
|
||||
const workspacesChannel = new WorkspacesChannel(workspacesService);
|
||||
const electronService = accessor.get(IElectronService);
|
||||
const electronChannel = new SimpleServiceProxyChannel(electronService);
|
||||
electronIpcServer.registerChannel('electron', electronChannel);
|
||||
|
||||
const workspacesMainService = accessor.get(IWorkspacesMainService);
|
||||
const workspacesChannel = new WorkspacesChannel(workspacesMainService);
|
||||
electronIpcServer.registerChannel('workspaces', workspacesChannel);
|
||||
|
||||
const windowsService = accessor.get(IWindowsService);
|
||||
@@ -563,16 +567,15 @@ export class CodeApplication extends Disposable {
|
||||
const storageChannel = this._register(new GlobalStorageDatabaseChannel(this.logService, storageMainService));
|
||||
electronIpcServer.registerChannel('storage', storageChannel);
|
||||
|
||||
// Log level management
|
||||
const logLevelChannel = new LogLevelSetterChannel(accessor.get(ILogService));
|
||||
electronIpcServer.registerChannel('loglevel', logLevelChannel);
|
||||
sharedProcessClient.then(client => client.registerChannel('loglevel', logLevelChannel));
|
||||
const loggerChannel = new LoggerChannel(accessor.get(ILogService));
|
||||
electronIpcServer.registerChannel('logger', loggerChannel);
|
||||
sharedProcessClient.then(client => client.registerChannel('logger', loggerChannel));
|
||||
|
||||
// ExtensionHost Debug broadcast service
|
||||
electronIpcServer.registerChannel(ExtensionHostDebugBroadcastChannel.ChannelName, new ExtensionHostDebugBroadcastChannel());
|
||||
|
||||
// Signal phase: ready (services set)
|
||||
this.lifecycleService.phase = LifecycleMainPhase.Ready;
|
||||
this.lifecycleMainService.phase = LifecycleMainPhase.Ready;
|
||||
|
||||
// Propagate to clients
|
||||
const windowsMainService = this.windowsMainService = accessor.get(IWindowsMainService);
|
||||
@@ -682,7 +685,7 @@ export class CodeApplication extends Disposable {
|
||||
private afterWindowOpen(): void {
|
||||
|
||||
// Signal phase: after window open
|
||||
this.lifecycleService.phase = LifecycleMainPhase.AfterWindowOpen;
|
||||
this.lifecycleMainService.phase = LifecycleMainPhase.AfterWindowOpen;
|
||||
|
||||
// Remote Authorities
|
||||
this.handleRemoteAuthorities();
|
||||
|
||||
@@ -7,12 +7,12 @@ import 'vs/platform/update/common/update.config.contribution';
|
||||
import { app, dialog } from 'electron';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { parseMainProcessArgv } from 'vs/platform/environment/node/argvHelper';
|
||||
import { addArg, createWaitMarkerFile } from 'vs/platform/environment/node/argv';
|
||||
import { mkdirp } from 'vs/base/node/pfs';
|
||||
import { validatePaths } from 'vs/code/node/paths';
|
||||
import { LifecycleService, ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain';
|
||||
import { LifecycleMainService, ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService';
|
||||
import { Server, serve, connect } from 'vs/base/parts/ipc/node/ipc.net';
|
||||
import { LaunchChannelClient } from 'vs/platform/launch/electron-main/launchService';
|
||||
import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -27,7 +27,7 @@ import { EnvironmentService, xdgRuntimeDir } from 'vs/platform/environment/node/
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ConfigurationService } from 'vs/platform/configuration/node/configurationService';
|
||||
import { IRequestService } from 'vs/platform/request/common/request';
|
||||
import { RequestService } from 'vs/platform/request/electron-main/requestService';
|
||||
import { RequestMainService } from 'vs/platform/request/electron-main/requestMainService';
|
||||
import * as fs from 'fs';
|
||||
import { CodeApplication } from 'vs/code/electron-main/app';
|
||||
import { localize } from 'vs/nls';
|
||||
@@ -116,13 +116,13 @@ class CodeMain {
|
||||
await instantiationService.invokeFunction(async accessor => {
|
||||
const environmentService = accessor.get(IEnvironmentService);
|
||||
const logService = accessor.get(ILogService);
|
||||
const lifecycleService = accessor.get(ILifecycleService);
|
||||
const lifecycleMainService = accessor.get(ILifecycleMainService);
|
||||
const configurationService = accessor.get(IConfigurationService);
|
||||
|
||||
const mainIpcServer = await this.doStartup(logService, environmentService, lifecycleService, instantiationService, true);
|
||||
const mainIpcServer = await this.doStartup(logService, environmentService, lifecycleMainService, instantiationService, true);
|
||||
|
||||
bufferLogService.logger = new SpdLogService('main', environmentService.logsPath, bufferLogService.getLevel());
|
||||
once(lifecycleService.onWillShutdown)(() => (configurationService as ConfigurationService).dispose());
|
||||
once(lifecycleMainService.onWillShutdown)(() => (configurationService as ConfigurationService).dispose());
|
||||
|
||||
return instantiationService.createInstance(CodeApplication, mainIpcServer, instanceEnvironment).startup();
|
||||
});
|
||||
@@ -143,9 +143,9 @@ class CodeMain {
|
||||
services.set(ILogService, logService);
|
||||
|
||||
services.set(IConfigurationService, new ConfigurationService(environmentService.settingsResource));
|
||||
services.set(ILifecycleService, new SyncDescriptor(LifecycleService));
|
||||
services.set(ILifecycleMainService, new SyncDescriptor(LifecycleMainService));
|
||||
services.set(IStateService, new SyncDescriptor(StateService));
|
||||
services.set(IRequestService, new SyncDescriptor(RequestService));
|
||||
services.set(IRequestService, new SyncDescriptor(RequestMainService));
|
||||
services.set(IThemeMainService, new SyncDescriptor(ThemeMainService));
|
||||
services.set(ISignService, new SyncDescriptor(SignService));
|
||||
|
||||
@@ -191,7 +191,7 @@ class CodeMain {
|
||||
return instanceEnvironment;
|
||||
}
|
||||
|
||||
private async doStartup(logService: ILogService, environmentService: IEnvironmentService, lifecycleService: ILifecycleService, instantiationService: IInstantiationService, retry: boolean): Promise<Server> {
|
||||
private async doStartup(logService: ILogService, environmentService: IEnvironmentService, lifecycleMainService: ILifecycleMainService, instantiationService: IInstantiationService, retry: boolean): Promise<Server> {
|
||||
|
||||
// Try to setup a server for running. If that succeeds it means
|
||||
// we are the first instance to startup. Otherwise it is likely
|
||||
@@ -199,7 +199,7 @@ class CodeMain {
|
||||
let server: Server;
|
||||
try {
|
||||
server = await serve(environmentService.mainIPCHandle);
|
||||
once(lifecycleService.onWillShutdown)(() => server.dispose());
|
||||
once(lifecycleMainService.onWillShutdown)(() => server.dispose());
|
||||
} catch (error) {
|
||||
|
||||
// Handle unexpected errors (the only expected error is EADDRINUSE that
|
||||
@@ -247,7 +247,7 @@ class CodeMain {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return this.doStartup(logService, environmentService, lifecycleService, instantiationService, false);
|
||||
return this.doStartup(logService, environmentService, lifecycleMainService, instantiationService, false);
|
||||
}
|
||||
|
||||
// Tests from CLI require to be the only instance currently
|
||||
@@ -376,7 +376,7 @@ class CodeMain {
|
||||
|
||||
private quit(accessor: ServicesAccessor, reason?: ExpectedError | Error): void {
|
||||
const logService = accessor.get(ILogService);
|
||||
const lifecycleService = accessor.get(ILifecycleService);
|
||||
const lifecycleMainService = accessor.get(ILifecycleMainService);
|
||||
|
||||
let exitCode = 0;
|
||||
|
||||
@@ -396,7 +396,7 @@ class CodeMain {
|
||||
}
|
||||
}
|
||||
|
||||
lifecycleService.kill(exitCode);
|
||||
lifecycleMainService.kill(exitCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { BrowserWindow, ipcMain } from 'electron';
|
||||
import { ISharedProcess } from 'vs/platform/windows/electron-main/windows';
|
||||
import { Barrier } from 'vs/base/common/async';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain';
|
||||
import { ILifecycleMainService } from 'vs/platform/lifecycle/electron-main/lifecycleMainService';
|
||||
import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainService';
|
||||
import { toDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
|
||||
@@ -24,7 +24,7 @@ export class SharedProcess implements ISharedProcess {
|
||||
private readonly machineId: string,
|
||||
private userEnv: NodeJS.ProcessEnv,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService,
|
||||
@ILifecycleService private readonly lifecycleService: ILifecycleService,
|
||||
@ILifecycleMainService private readonly lifecycleMainService: ILifecycleMainService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@IThemeMainService private readonly themeMainService: IThemeMainService
|
||||
) { }
|
||||
@@ -36,9 +36,8 @@ export class SharedProcess implements ISharedProcess {
|
||||
backgroundColor: this.themeMainService.getBackgroundColor(),
|
||||
webPreferences: {
|
||||
images: false,
|
||||
webaudio: false,
|
||||
webgl: false,
|
||||
nodeIntegration: true,
|
||||
webgl: false,
|
||||
disableBlinkFeatures: 'Auxclick' // do NOT change, allows us to identify this window as shared-process in the process explorer
|
||||
}
|
||||
});
|
||||
@@ -69,7 +68,7 @@ export class SharedProcess implements ISharedProcess {
|
||||
|
||||
const disposables = new DisposableStore();
|
||||
|
||||
this.lifecycleService.onWillShutdown(() => {
|
||||
this.lifecycleMainService.onWillShutdown(() => {
|
||||
disposables.dispose();
|
||||
|
||||
// Shut the shared process down when we are quitting
|
||||
|
||||
@@ -12,13 +12,14 @@ import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { IWindowSettings, MenuBarVisibility, IWindowConfiguration, ReadyState, getTitleBarStyle } from 'vs/platform/windows/common/windows';
|
||||
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform';
|
||||
import { ICodeWindow, IWindowState, WindowMode } from 'vs/platform/windows/electron-main/windows';
|
||||
import { IWorkspaceIdentifier, IWorkspacesMainService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IBackupMainService } from 'vs/platform/backup/common/backup';
|
||||
import { IWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IWorkspacesMainService } from 'vs/platform/workspaces/electron-main/workspacesMainService';
|
||||
import { IBackupMainService } from 'vs/platform/backup/electron-main/backup';
|
||||
import { ISerializableCommandAction } from 'vs/platform/actions/common/actions';
|
||||
import * as perf from 'vs/base/common/performance';
|
||||
import { resolveMarketplaceHeaders } from 'vs/platform/extensionManagement/common/extensionGalleryService';
|
||||
@@ -26,7 +27,6 @@ import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainServ
|
||||
import { endsWith } from 'vs/base/common/strings';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
|
||||
const RUN_TEXTMATE_IN_WORKER = false;
|
||||
|
||||
@@ -310,7 +310,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
private handleMarketplaceRequests(): void {
|
||||
|
||||
// Resolve marketplace headers
|
||||
this.marketplaceHeadersPromise = resolveMarketplaceHeaders(pkg.version, this.environmentService, this.fileService);
|
||||
this.marketplaceHeadersPromise = resolveMarketplaceHeaders(product.version, this.environmentService, this.fileService);
|
||||
|
||||
// Inject headers when requests are incoming
|
||||
const urls = ['https://marketplace.visualstudio.com/*', 'https://*.vsassets.io/*'];
|
||||
@@ -561,7 +561,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
autoDetectHighContrast = false;
|
||||
}
|
||||
windowConfiguration.highContrast = isWindows && autoDetectHighContrast && systemPreferences.isInvertedColorScheme();
|
||||
windowConfiguration.accessibilitySupport = app.isAccessibilitySupportEnabled();
|
||||
windowConfiguration.accessibilitySupport = app.accessibilitySupportEnabled;
|
||||
|
||||
// Title style related
|
||||
windowConfiguration.maximized = this._win.isMaximized();
|
||||
|
||||
@@ -8,24 +8,26 @@ import { basename, normalize, join, dirname } from 'vs/base/common/path';
|
||||
import { localize } from 'vs/nls';
|
||||
import * as arrays from 'vs/base/common/arrays';
|
||||
import { assign, mixin } from 'vs/base/common/objects';
|
||||
import { IBackupMainService, IEmptyWindowBackupInfo } from 'vs/platform/backup/common/backup';
|
||||
import { IBackupMainService } from 'vs/platform/backup/electron-main/backup';
|
||||
import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup';
|
||||
import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
import { IStateService } from 'vs/platform/state/common/state';
|
||||
import { CodeWindow, defaultWindowState } from 'vs/code/electron-main/window';
|
||||
import { ipcMain as ipc, screen, BrowserWindow, dialog, systemPreferences, FileFilter } from 'electron';
|
||||
import { parseLineAndColumnAware } from 'vs/code/node/paths';
|
||||
import { ILifecycleService, UnloadReason, LifecycleService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMain';
|
||||
import { ILifecycleMainService, UnloadReason, LifecycleMainService, LifecycleMainPhase } from 'vs/platform/lifecycle/electron-main/lifecycleMainService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWindowSettings, OpenContext, IPath, IWindowConfiguration, INativeOpenDialogOptions, IPathsToWaitFor, IEnterWorkspaceResult, IMessageBoxResult, INewWindowOptions, IURIToOpen, isFileToOpen, isWorkspaceToOpen, isFolderToOpen } from 'vs/platform/windows/common/windows';
|
||||
import { getLastActiveWindow, findBestWindowOrFolderForFile, findWindowOnWorkspace, findWindowOnExtensionDevelopmentPath, findWindowOnWorkspaceOrFolderUri } from 'vs/code/node/windowsFinder';
|
||||
import { Event as CommonEvent, Emitter } from 'vs/base/common/event';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { ITelemetryService, ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IWindowsMainService, IOpenConfiguration, IWindowsCountChangedEvent, ICodeWindow, IWindowState as ISingleWindowState, WindowMode } from 'vs/platform/windows/electron-main/windows';
|
||||
import { IHistoryMainService, IRecent } from 'vs/platform/history/common/history';
|
||||
import { IRecent } from 'vs/platform/history/common/history';
|
||||
import { IHistoryMainService } from 'vs/platform/history/electron-main/historyMainService';
|
||||
import { IProcessEnvironment, isMacintosh, isWindows } from 'vs/base/common/platform';
|
||||
import { IWorkspacesMainService, IWorkspaceIdentifier, WORKSPACE_FILTER, isSingleFolderWorkspaceIdentifier, hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IWorkspaceIdentifier, WORKSPACE_FILTER, isSingleFolderWorkspaceIdentifier, hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { mnemonicButtonLabel } from 'vs/base/common/labels';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
@@ -36,7 +38,7 @@ import { exists, dirExists } from 'vs/base/node/pfs';
|
||||
import { getComparisonKey, isEqual, normalizePath, basename as resourcesBasename, originalFSPath, hasTrailingPathSeparator, removeTrailingPathSeparator } from 'vs/base/common/resources';
|
||||
import { getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts';
|
||||
import { restoreWindowsState, WindowsStateStorageData, getWindowsStateStoreData } from 'vs/code/electron-main/windowsStateStorage';
|
||||
import { getWorkspaceIdentifier } from 'vs/platform/workspaces/electron-main/workspacesMainService';
|
||||
import { getWorkspaceIdentifier, IWorkspacesMainService } from 'vs/platform/workspaces/electron-main/workspacesMainService';
|
||||
import { once } from 'vs/base/common/functional';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
@@ -186,7 +188,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@IStateService private readonly stateService: IStateService,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService,
|
||||
@ILifecycleService private readonly lifecycleService: ILifecycleService,
|
||||
@ILifecycleMainService private readonly lifecycleMainService: ILifecycleMainService,
|
||||
@IBackupMainService private readonly backupMainService: IBackupMainService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@@ -205,8 +207,8 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
this.dialogs = new Dialogs(stateService, this);
|
||||
this.workspacesManager = new WorkspacesManager(workspacesMainService, backupMainService, this);
|
||||
|
||||
this.lifecycleService.when(LifecycleMainPhase.Ready).then(() => this.registerListeners());
|
||||
this.lifecycleService.when(LifecycleMainPhase.AfterWindowOpen).then(() => this.installWindowsMutex());
|
||||
this.lifecycleMainService.when(LifecycleMainPhase.Ready).then(() => this.registerListeners());
|
||||
this.lifecycleMainService.when(LifecycleMainPhase.AfterWindowOpen).then(() => this.installWindowsMutex());
|
||||
}
|
||||
|
||||
private installWindowsMutex(): void {
|
||||
@@ -215,7 +217,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
try {
|
||||
const WindowsMutex = (require.__$__nodeRequire('windows-mutex') as typeof import('windows-mutex')).Mutex;
|
||||
const mutex = new WindowsMutex(win32MutexName);
|
||||
once(this.lifecycleService.onWillShutdown)(() => mutex.release());
|
||||
once(this.lifecycleMainService.onWillShutdown)(() => mutex.release());
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
@@ -249,8 +251,8 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
}
|
||||
|
||||
// Handle various lifecycle events around windows
|
||||
this.lifecycleService.onBeforeWindowClose(window => this.onBeforeWindowClose(window));
|
||||
this.lifecycleService.onBeforeShutdown(() => this.onBeforeShutdown());
|
||||
this.lifecycleMainService.onBeforeWindowClose(window => this.onBeforeWindowClose(window));
|
||||
this.lifecycleMainService.onBeforeShutdown(() => this.onBeforeShutdown());
|
||||
this.onWindowsCountChanged(e => {
|
||||
if (e.newCount - e.oldCount > 0) {
|
||||
// clear last closed window state when a new window opens. this helps on macOS where
|
||||
@@ -338,7 +340,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
|
||||
// See note on #onBeforeShutdown() for details how these events are flowing
|
||||
private onBeforeWindowClose(win: ICodeWindow): void {
|
||||
if (this.lifecycleService.quitRequested) {
|
||||
if (this.lifecycleMainService.quitRequested) {
|
||||
return; // during quit, many windows close in parallel so let it be handled in the before-quit handler
|
||||
}
|
||||
|
||||
@@ -983,7 +985,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
|
||||
private getRestoreWindowsSetting(): RestoreWindowsSetting {
|
||||
let restoreWindows: RestoreWindowsSetting;
|
||||
if (this.lifecycleService.wasRestarted) {
|
||||
if (this.lifecycleMainService.wasRestarted) {
|
||||
restoreWindows = 'all'; // always reopen all windows when an update was applied
|
||||
} else {
|
||||
const windowConfig = this.configurationService.getValue<IWindowSettings>('window');
|
||||
@@ -1326,7 +1328,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
|
||||
// Window state is from a previous session: only allow fullscreen when we got updated or user wants to restore
|
||||
else {
|
||||
allowFullscreen = this.lifecycleService.wasRestarted || (windowConfig && windowConfig.restoreFullscreen);
|
||||
allowFullscreen = this.lifecycleMainService.wasRestarted || (windowConfig && windowConfig.restoreFullscreen);
|
||||
}
|
||||
|
||||
if (state.mode === WindowMode.Fullscreen && !allowFullscreen) {
|
||||
@@ -1362,7 +1364,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
window.win.on('closed', () => this.onWindowClosed(window!));
|
||||
|
||||
// Lifecycle
|
||||
(this.lifecycleService as LifecycleService).registerWindow(window);
|
||||
(this.lifecycleMainService as LifecycleMainService).registerWindow(window);
|
||||
}
|
||||
|
||||
// Existing window
|
||||
@@ -1385,7 +1387,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
// first and only load the new configuration if that was
|
||||
// not vetoed
|
||||
if (window.isReady) {
|
||||
this.lifecycleService.unload(window, UnloadReason.LOAD).then(veto => {
|
||||
this.lifecycleMainService.unload(window, UnloadReason.LOAD).then(veto => {
|
||||
if (!veto) {
|
||||
this.doOpenInBrowserWindow(window!, configuration, options);
|
||||
}
|
||||
@@ -1552,7 +1554,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
async reload(win: ICodeWindow, cli?: ParsedArgs): Promise<void> {
|
||||
|
||||
// Only reload when the window has not vetoed this
|
||||
const veto = await this.lifecycleService.unload(win, UnloadReason.RELOAD);
|
||||
const veto = await this.lifecycleMainService.unload(win, UnloadReason.RELOAD);
|
||||
if (!veto) {
|
||||
win.reload(undefined, cli);
|
||||
}
|
||||
@@ -1864,7 +1866,7 @@ export class WindowsManager extends Disposable implements IWindowsMainService {
|
||||
// Otherwise: normal quit
|
||||
else {
|
||||
setTimeout(() => {
|
||||
this.lifecycleService.quit();
|
||||
this.lifecycleMainService.quit();
|
||||
}, 10 /* delay to unwind callback stack (IPC) */);
|
||||
}
|
||||
}
|
||||
@@ -1955,24 +1957,21 @@ class Dialogs {
|
||||
}
|
||||
|
||||
showMessageBox(options: Electron.MessageBoxOptions, window?: ICodeWindow): Promise<IMessageBoxResult> {
|
||||
return this.getDialogQueue(window).queue(() => {
|
||||
return new Promise(resolve => {
|
||||
const callback = (response: number, checkboxChecked: boolean) => {
|
||||
resolve({ button: response, checkboxChecked });
|
||||
};
|
||||
return this.getDialogQueue(window).queue(async () => {
|
||||
let result: Electron.MessageBoxReturnValue;
|
||||
if (window) {
|
||||
result = await dialog.showMessageBox(window.win, options);
|
||||
} else {
|
||||
result = await dialog.showMessageBox(options);
|
||||
}
|
||||
|
||||
if (window) {
|
||||
dialog.showMessageBox(window.win, options, callback);
|
||||
} else {
|
||||
dialog.showMessageBox(options, callback);
|
||||
}
|
||||
});
|
||||
return { button: result.response, checkboxChecked: result.checkboxChecked };
|
||||
});
|
||||
}
|
||||
|
||||
showSaveDialog(options: Electron.SaveDialogOptions, window?: ICodeWindow): Promise<string> {
|
||||
|
||||
function normalizePath(path: string): string {
|
||||
function normalizePath(path: string | undefined): string | undefined {
|
||||
if (path && isMacintosh) {
|
||||
path = normalizeNFC(path); // normalize paths returned from the OS
|
||||
}
|
||||
@@ -1980,24 +1979,21 @@ class Dialogs {
|
||||
return path;
|
||||
}
|
||||
|
||||
return this.getDialogQueue(window).queue(() => {
|
||||
return new Promise(resolve => {
|
||||
const callback = (path: string) => {
|
||||
resolve(normalizePath(path));
|
||||
};
|
||||
return this.getDialogQueue(window).queue(async () => {
|
||||
let result: Electron.SaveDialogReturnValue;
|
||||
if (window) {
|
||||
result = await dialog.showSaveDialog(window.win, options);
|
||||
} else {
|
||||
result = await dialog.showSaveDialog(options);
|
||||
}
|
||||
|
||||
if (window) {
|
||||
dialog.showSaveDialog(window.win, options, callback);
|
||||
} else {
|
||||
dialog.showSaveDialog(options, callback);
|
||||
}
|
||||
});
|
||||
return normalizePath(result.filePath);
|
||||
});
|
||||
}
|
||||
|
||||
showOpenDialog(options: Electron.OpenDialogOptions, window?: ICodeWindow): Promise<string[]> {
|
||||
|
||||
function normalizePaths(paths: string[]): string[] {
|
||||
function normalizePaths(paths: string[] | undefined): string[] | undefined {
|
||||
if (paths && paths.length > 0 && isMacintosh) {
|
||||
paths = paths.map(path => normalizeNFC(path)); // normalize paths returned from the OS
|
||||
}
|
||||
@@ -2005,32 +2001,25 @@ class Dialogs {
|
||||
return paths;
|
||||
}
|
||||
|
||||
return this.getDialogQueue(window).queue(() => {
|
||||
return new Promise(resolve => {
|
||||
return this.getDialogQueue(window).queue(async () => {
|
||||
|
||||
// Ensure the path exists (if provided)
|
||||
let validatePathPromise: Promise<void> = Promise.resolve();
|
||||
if (options.defaultPath) {
|
||||
validatePathPromise = exists(options.defaultPath).then(exists => {
|
||||
if (!exists) {
|
||||
options.defaultPath = undefined;
|
||||
}
|
||||
});
|
||||
// Ensure the path exists (if provided)
|
||||
if (options.defaultPath) {
|
||||
const pathExists = await exists(options.defaultPath);
|
||||
if (!pathExists) {
|
||||
options.defaultPath = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
// Show dialog and wrap as promise
|
||||
validatePathPromise.then(() => {
|
||||
const callback = (paths: string[]) => {
|
||||
resolve(normalizePaths(paths));
|
||||
};
|
||||
// Show dialog
|
||||
let result: Electron.OpenDialogReturnValue;
|
||||
if (window) {
|
||||
result = await dialog.showOpenDialog(window.win, options);
|
||||
} else {
|
||||
result = await dialog.showOpenDialog(options);
|
||||
}
|
||||
|
||||
if (window) {
|
||||
dialog.showOpenDialog(window.win, options, callback);
|
||||
} else {
|
||||
dialog.showOpenDialog(options, callback);
|
||||
}
|
||||
});
|
||||
});
|
||||
return normalizePaths(result.filePaths);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,7 @@ import { spawn, ChildProcess, SpawnOptions } from 'child_process';
|
||||
import { buildHelpMessage, buildVersionMessage, addArg, createWaitMarkerFile, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { parseCLIProcessArgv } from 'vs/platform/environment/node/argvHelper';
|
||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import * as paths from 'vs/base/common/path';
|
||||
import * as os from 'os';
|
||||
import * as fs from 'fs';
|
||||
@@ -16,7 +15,7 @@ import { whenDeleted, writeFileSync } from 'vs/base/node/pfs';
|
||||
import { findFreePort, randomPort } from 'vs/base/node/ports';
|
||||
import { resolveTerminalEncoding } from 'vs/base/node/encoding';
|
||||
import * as iconv from 'iconv-lite';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import { isWindows, isLinux } from 'vs/base/common/platform';
|
||||
import { ProfilingSession, Target } from 'v8-inspect-profiler';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
|
||||
@@ -46,12 +45,12 @@ export async function main(argv: string[]): Promise<any> {
|
||||
// Help
|
||||
if (args.help) {
|
||||
const executable = `${product.applicationName}${os.platform() === 'win32' ? '.exe' : ''}`;
|
||||
console.log(buildHelpMessage(product.nameLong, executable, pkg.version, OPTIONS));
|
||||
console.log(buildHelpMessage(product.nameLong, executable, product.version, OPTIONS));
|
||||
}
|
||||
|
||||
// Version Info
|
||||
else if (args.version) {
|
||||
console.log(buildVersionMessage(pkg.version, product.commit));
|
||||
console.log(buildVersionMessage(product.version, product.commit));
|
||||
}
|
||||
|
||||
// Extensions Management
|
||||
@@ -361,6 +360,10 @@ export async function main(argv: string[]): Promise<any> {
|
||||
options['stdio'] = 'ignore';
|
||||
}
|
||||
|
||||
if (isLinux) {
|
||||
addArg(argv, '--no-sandbox'); // Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox
|
||||
}
|
||||
|
||||
const child = spawn(process.execPath, argv.slice(2), options);
|
||||
|
||||
if (args.wait && waitMarkerFilePath) {
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import * as path from 'vs/base/common/path';
|
||||
import * as semver from 'semver-umd';
|
||||
|
||||
@@ -46,7 +45,7 @@ import { FileService } from 'vs/platform/files/common/fileService';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IProductService } from 'vs/platform/product/common/product';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
|
||||
const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id);
|
||||
const notInstalled = (id: string) => localize('notInstalled', "Extension '{0}' is not installed.", id);
|
||||
@@ -350,7 +349,7 @@ export async function main(argv: ParsedArgs): Promise<void> {
|
||||
|
||||
const config: ITelemetryServiceConfig = {
|
||||
appender: combinedAppender(...appenders),
|
||||
commonProperties: resolveCommonProperties(product.commit, pkg.version, stateService.getItem('telemetry.machineId'), product.msftInternalDomains, installSourcePath),
|
||||
commonProperties: resolveCommonProperties(product.commit, product.version, stateService.getItem('telemetry.machineId'), product.msftInternalDomains, installSourcePath),
|
||||
piiPaths: extensionsPath ? [appRoot, extensionsPath] : [appRoot]
|
||||
};
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { equalsIgnoreCase } from 'vs/base/common/strings';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IOpener, IOpenerService, IValidator } from 'vs/platform/opener/common/opener';
|
||||
import { IOpener, IOpenerService, IValidator, IExternalUriResolver } from 'vs/platform/opener/common/opener';
|
||||
|
||||
export class OpenerService extends Disposable implements IOpenerService {
|
||||
|
||||
@@ -21,6 +21,7 @@ export class OpenerService extends Disposable implements IOpenerService {
|
||||
|
||||
private readonly _openers = new LinkedList<IOpener>();
|
||||
private readonly _validators = new LinkedList<IValidator>();
|
||||
private readonly _resolvers = new LinkedList<IExternalUriResolver>();
|
||||
|
||||
constructor(
|
||||
@ICodeEditorService private readonly _editorService: ICodeEditorService,
|
||||
@@ -39,6 +40,11 @@ export class OpenerService extends Disposable implements IOpenerService {
|
||||
return { dispose: remove };
|
||||
}
|
||||
|
||||
registerExternalUriResolver(resolver: IExternalUriResolver): IDisposable {
|
||||
const remove = this._resolvers.push(resolver);
|
||||
return { dispose: remove };
|
||||
}
|
||||
|
||||
async open(resource: URI, options?: { openToSide?: boolean, openExternal?: boolean }): Promise<boolean> {
|
||||
// no scheme ?!?
|
||||
if (!resource.scheme) {
|
||||
@@ -118,7 +124,11 @@ export class OpenerService extends Disposable implements IOpenerService {
|
||||
}
|
||||
}
|
||||
|
||||
private _doOpenExternal(resource: URI): Promise<boolean> {
|
||||
private async _doOpenExternal(resource: URI): Promise<boolean> {
|
||||
for (const resolver of this._resolvers.toArray()) {
|
||||
resource = await resolver.resolveExternalUri(resource);
|
||||
}
|
||||
|
||||
dom.windowOpenNoOpener(encodeURI(resource.toString(true)));
|
||||
|
||||
return Promise.resolve(true);
|
||||
|
||||
@@ -101,15 +101,6 @@ export class LineNumbersOverlay extends DynamicViewOverlay {
|
||||
}
|
||||
const modelLineNumber = modelPosition.lineNumber;
|
||||
|
||||
if (!this._renderFinalNewline) {
|
||||
const lineCount = this._context.model.getLineCount();
|
||||
const lineContent = this._context.model.getLineContent(modelLineNumber);
|
||||
|
||||
if (modelLineNumber === lineCount && lineContent === '') {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
if (this._renderCustomLineNumbers) {
|
||||
return this._renderCustomLineNumbers(modelLineNumber);
|
||||
}
|
||||
@@ -146,10 +137,19 @@ export class LineNumbersOverlay extends DynamicViewOverlay {
|
||||
const visibleEndLineNumber = ctx.visibleRange.endLineNumber;
|
||||
const common = '<div class="' + LineNumbersOverlay.CLASS_NAME + lineHeightClassName + '" style="left:' + this._lineNumbersLeft.toString() + 'px;width:' + this._lineNumbersWidth.toString() + 'px;">';
|
||||
|
||||
const lineCount = this._context.model.getLineCount();
|
||||
const output: string[] = [];
|
||||
for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) {
|
||||
const lineIndex = lineNumber - visibleStartLineNumber;
|
||||
|
||||
if (!this._renderFinalNewline) {
|
||||
if (lineNumber === lineCount && this._context.model.getLineLength(lineNumber) === 0) {
|
||||
// Do not render last (empty) line
|
||||
output[lineIndex] = '';
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
const renderLineNumber = this._getLineRenderLineNumber(lineNumber);
|
||||
|
||||
if (renderLineNumber) {
|
||||
|
||||
@@ -179,7 +179,7 @@ export class ShiftCommand implements ICommand {
|
||||
}
|
||||
|
||||
this._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, indentationEndIndex + 1), desiredIndent);
|
||||
if (lineNumber === startLine) {
|
||||
if (lineNumber === startLine && !this._selection.isEmpty()) {
|
||||
// Force the startColumn to stay put because we're inserting after it
|
||||
this._selectionStartColumnStaysPut = (this._selection.startColumn <= indentationEndIndex + 1);
|
||||
}
|
||||
@@ -226,7 +226,7 @@ export class ShiftCommand implements ICommand {
|
||||
this._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, indentationEndIndex + 1), '');
|
||||
} else {
|
||||
this._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, 1), oneIndent);
|
||||
if (lineNumber === startLine) {
|
||||
if (lineNumber === startLine && !this._selection.isEmpty()) {
|
||||
// Force the startColumn to stay put because we're inserting after it
|
||||
this._selectionStartColumnStaysPut = (this._selection.startColumn === 1);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
/* Checkbox */
|
||||
|
||||
.monaco-checkbox .label {
|
||||
.monaco-checkbox .codicon-selection {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border: 1px solid black;
|
||||
@@ -24,7 +24,7 @@
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.monaco-checkbox .checkbox:checked + .label {
|
||||
.monaco-checkbox .checkbox:checked + .codicon-selection {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
@@ -166,6 +166,9 @@
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .button:not(.disabled):hover {
|
||||
@@ -200,14 +203,6 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .previous {
|
||||
background-image: url('images/chevron-previous-light.svg');
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .next {
|
||||
background-image: url('images/chevron-next-light.svg');
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .disabled {
|
||||
opacity: 0.3;
|
||||
cursor: default;
|
||||
@@ -221,54 +216,32 @@
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .monaco-checkbox .label {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-image: url('images/find-selection-light.svg');
|
||||
.monaco-editor .find-widget .monaco-checkbox .codicon-selection {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .monaco-checkbox .checkbox:disabled + .label {
|
||||
.monaco-editor .find-widget .monaco-checkbox .checkbox:disabled + .codicon-selection {
|
||||
opacity: 0.3;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .monaco-checkbox .checkbox:not(:disabled) + .label {
|
||||
.monaco-editor .find-widget .monaco-checkbox .checkbox:not(:disabled) + .codicon-selection {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .monaco-checkbox .checkbox:not(:disabled):hover:before + .label {
|
||||
.monaco-editor .find-widget .monaco-checkbox .checkbox:not(:disabled):hover:before + .codicon-selection {
|
||||
background-color: #DDD;
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .monaco-checkbox .checkbox:checked + .label {
|
||||
.monaco-editor .find-widget .monaco-checkbox .checkbox:checked + .codicon-selection {
|
||||
background-color: rgba(100, 100, 100, 0.2);
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .close-fw {
|
||||
background-image: url('images/close-light.svg');
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .expand {
|
||||
background-image: url('images/tree-expanded-light.svg');
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .collapse {
|
||||
background-image: url('images/tree-collapsed-light.svg');
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .replace {
|
||||
background-image: url('images/replace-light.svg');
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget .replace-all {
|
||||
background-image: url('images/replace-all-light.svg');
|
||||
}
|
||||
|
||||
.monaco-editor .find-widget > .replace-part {
|
||||
display: none;
|
||||
}
|
||||
@@ -329,52 +302,13 @@
|
||||
margin-left: -4px;
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .find-widget .previous,
|
||||
.monaco-editor.vs-dark .find-widget .previous {
|
||||
background-image: url('images/chevron-previous-dark.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .find-widget .next,
|
||||
.monaco-editor.vs-dark .find-widget .next {
|
||||
background-image: url('images/chevron-next-dark.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .find-widget .monaco-checkbox .label,
|
||||
.monaco-editor.vs-dark .find-widget .monaco-checkbox .label {
|
||||
background-image: url('images/find-selection-dark.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.vs-dark .find-widget .monaco-checkbox .checkbox:not(:disabled):hover:before + .label {
|
||||
.monaco-editor.vs-dark .find-widget .monaco-checkbox .checkbox:not(:disabled):hover:before + .codicon-selection {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .find-widget .close-fw,
|
||||
.monaco-editor.vs-dark .find-widget .close-fw {
|
||||
background-image: url('images/close-dark.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .find-widget .replace,
|
||||
.monaco-editor.vs-dark .find-widget .replace {
|
||||
background-image: url('images/replace-dark.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .find-widget .replace-all,
|
||||
.monaco-editor.vs-dark .find-widget .replace-all {
|
||||
background-image: url('images/replace-all-dark.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .find-widget .expand,
|
||||
.monaco-editor.vs-dark .find-widget .expand {
|
||||
background-image: url('images/tree-expanded-dark.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .find-widget .collapse,
|
||||
.monaco-editor.vs-dark .find-widget .collapse {
|
||||
background-image: url('images/tree-collapsed-dark.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .find-widget .button:not(.disabled):hover,
|
||||
.monaco-editor.vs-dark .find-widget .button:not(.disabled):hover {
|
||||
.monaco-editor.vs-dark .find-widget .button:not(.disabled):hover,
|
||||
.monaco-editor.vs-dark .find-widget .monaco-checkbox:not(.disabled):hover {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
@@ -384,6 +318,6 @@
|
||||
left: 2px;
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .find-widget .monaco-checkbox .checkbox:checked + .label {
|
||||
.monaco-editor.hc-black .find-widget .monaco-checkbox .checkbox:checked + .codicon-selection {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
@@ -453,8 +453,8 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
this._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);
|
||||
|
||||
dom.toggleClass(this._domNode, 'replaceToggled', this._isReplaceVisible);
|
||||
this._toggleReplaceBtn.toggleClass('collapse', !this._isReplaceVisible);
|
||||
this._toggleReplaceBtn.toggleClass('expand', this._isReplaceVisible);
|
||||
this._toggleReplaceBtn.toggleClass('codicon-chevron-right', !this._isReplaceVisible);
|
||||
this._toggleReplaceBtn.toggleClass('codicon-chevron-down', this._isReplaceVisible);
|
||||
this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);
|
||||
|
||||
let canReplace = !this._codeEditor.getOption(EditorOption.readOnly);
|
||||
@@ -642,6 +642,10 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
if (!this._isVisible) {
|
||||
return;
|
||||
}
|
||||
if (!dom.isInDOM(this._domNode)) {
|
||||
// the widget is not in the DOM
|
||||
return;
|
||||
}
|
||||
|
||||
const layoutInfo = this._codeEditor.getLayoutInfo();
|
||||
const editorContentWidth = layoutInfo.contentWidth;
|
||||
@@ -951,7 +955,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
// Previous button
|
||||
this._prevBtn = this._register(new SimpleButton({
|
||||
label: NLS_PREVIOUS_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.PreviousMatchFindAction),
|
||||
className: 'previous',
|
||||
className: 'codicon codicon-arrow-up',
|
||||
onTrigger: () => {
|
||||
this._codeEditor.getAction(FIND_IDS.PreviousMatchFindAction).run().then(undefined, onUnexpectedError);
|
||||
}
|
||||
@@ -960,7 +964,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
// Next button
|
||||
this._nextBtn = this._register(new SimpleButton({
|
||||
label: NLS_NEXT_MATCH_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.NextMatchFindAction),
|
||||
className: 'next',
|
||||
className: 'codicon codicon-arrow-down',
|
||||
onTrigger: () => {
|
||||
this._codeEditor.getAction(FIND_IDS.NextMatchFindAction).run().then(undefined, onUnexpectedError);
|
||||
}
|
||||
@@ -1000,7 +1004,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
// Close button
|
||||
this._closeBtn = this._register(new SimpleButton({
|
||||
label: NLS_CLOSE_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.CloseFindWidgetCommand),
|
||||
className: 'close-fw',
|
||||
className: 'codicon codicon-close',
|
||||
onTrigger: () => {
|
||||
this._state.change({ isRevealed: false, searchScope: null }, false);
|
||||
},
|
||||
@@ -1063,7 +1067,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
// Replace one button
|
||||
this._replaceBtn = this._register(new SimpleButton({
|
||||
label: NLS_REPLACE_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.ReplaceOneAction),
|
||||
className: 'replace',
|
||||
className: 'codicon codicon-replace',
|
||||
onTrigger: () => {
|
||||
this._controller.replace();
|
||||
},
|
||||
@@ -1078,7 +1082,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
// Replace all button
|
||||
this._replaceAllBtn = this._register(new SimpleButton({
|
||||
label: NLS_REPLACE_ALL_BTN_LABEL + this._keybindingLabelFor(FIND_IDS.ReplaceAllAction),
|
||||
className: 'replace-all',
|
||||
className: 'codicon codicon-replace-all',
|
||||
onTrigger: () => {
|
||||
this._controller.replaceAll();
|
||||
}
|
||||
@@ -1098,7 +1102,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
// Toggle replace button
|
||||
this._toggleReplaceBtn = this._register(new SimpleButton({
|
||||
label: NLS_TOGGLE_REPLACE_MODE_BTN_LABEL,
|
||||
className: 'toggle left',
|
||||
className: 'codicon toggle left',
|
||||
onTrigger: () => {
|
||||
this._state.change({ isReplaceRevealed: !this._isReplaceVisible }, false);
|
||||
if (this._isReplaceVisible) {
|
||||
@@ -1108,8 +1112,8 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
this._showViewZone();
|
||||
}
|
||||
}));
|
||||
this._toggleReplaceBtn.toggleClass('expand', this._isReplaceVisible);
|
||||
this._toggleReplaceBtn.toggleClass('collapse', !this._isReplaceVisible);
|
||||
this._toggleReplaceBtn.toggleClass('codicon-chevron-down', this._isReplaceVisible);
|
||||
this._toggleReplaceBtn.toggleClass('codicon-chevron-right', !this._isReplaceVisible);
|
||||
this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);
|
||||
|
||||
// Widget
|
||||
@@ -1227,7 +1231,7 @@ class SimpleCheckbox extends Widget {
|
||||
this._checkbox.tabIndex = -1;
|
||||
|
||||
this._label = document.createElement('label');
|
||||
this._label.className = 'label';
|
||||
this._label.className = 'codicon codicon-selection';
|
||||
// Connect the label and the checkbox. Checkbox will get checked when the label receives a click.
|
||||
this._label.htmlFor = this._checkbox.id;
|
||||
this._label.tabIndex = -1;
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0719 8.00005L5.71461 12.3574L6.33333 12.9761L11 8.30941V7.69069L6.33333 3.02402L5.71461 3.64274L10.0719 8.00005Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 287 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0719 8.00005L5.71461 12.3574L6.33333 12.9761L11 8.30941V7.69069L6.33333 3.02402L5.71461 3.64274L10.0719 8.00005Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 287 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.97603 10.0719L12.3333 5.7146L12.9521 6.33332L8.28539 11L7.66667 11L3 6.33332L3.61872 5.7146L7.97603 10.0719Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 282 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.97603 10.0719L12.3333 5.7146L12.9521 6.33332L8.28539 11L7.66667 11L3 6.33332L3.61872 5.7146L7.97603 10.0719Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 282 B |
@@ -37,6 +37,10 @@
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
.monaco-editor-hover p > code {
|
||||
font-family: var(--monaco-monospace-font);
|
||||
}
|
||||
|
||||
.monaco-editor-hover hr {
|
||||
margin-top: 4px;
|
||||
margin-bottom: -6px;
|
||||
|
||||
@@ -928,6 +928,28 @@ suite('Editor Contrib - Line Operations', () => {
|
||||
model.dispose();
|
||||
});
|
||||
|
||||
test('issue #80736: Indenting while the cursor is at the start of a line of text causes the added spaces or tab to be selected', () => {
|
||||
const model = createTextModel(
|
||||
[
|
||||
'Some text'
|
||||
].join('\n'),
|
||||
{
|
||||
insertSpaces: false,
|
||||
}
|
||||
);
|
||||
|
||||
withTestCodeEditor(null, { model: model }, (editor) => {
|
||||
const indentLinesAction = new IndentLinesAction();
|
||||
editor.setPosition(new Position(1, 1));
|
||||
|
||||
indentLinesAction.run(null!, editor);
|
||||
assert.equal(model.getLineContent(1), '\tSome text');
|
||||
assert.deepEqual(editor.getSelection(), new Selection(1, 2, 1, 2));
|
||||
});
|
||||
|
||||
model.dispose();
|
||||
});
|
||||
|
||||
test('issue #62112: Delete line does not work properly when multiple cursors are on line', () => {
|
||||
const TEXT = [
|
||||
'a',
|
||||
|
||||
@@ -332,7 +332,12 @@ export class ParameterHintsWidget extends Disposable implements IContentWidget,
|
||||
|
||||
private updateMaxHeight(): void {
|
||||
const height = Math.max(this.editor.getLayoutInfo().height / 4, 250);
|
||||
this.element.style.maxHeight = `${height}px`;
|
||||
const maxHeight = `${height}px`;
|
||||
this.element.style.maxHeight = maxHeight;
|
||||
const wrapper = this.element.getElementsByClassName('wrapper') as HTMLCollectionOf<HTMLElement>;
|
||||
if (wrapper.length) {
|
||||
wrapper[0].style.maxHeight = maxHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00001 8.70708L11.6465 12.3535L12.3536 11.6464L8.70711 7.99998L12.3536 4.35353L11.6465 3.64642L8.00001 7.29287L4.35356 3.64642L3.64645 4.35353L7.2929 7.99998L3.64645 11.6464L4.35356 12.3535L8.00001 8.70708Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 379 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00001 8.70708L11.6465 12.3535L12.3536 11.6464L8.70711 7.99998L12.3536 4.35353L11.6465 3.64642L8.00001 7.29287L4.35356 3.64642L3.64645 4.35353L7.2929 7.99998L3.64645 11.6464L4.35356 12.3535L8.00001 8.70708Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 379 B |
@@ -56,10 +56,6 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.monaco-editor .peekview-widget .head .peekview-actions .action-label.icon.close-peekview-action {
|
||||
background: url('close-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.monaco-editor .peekview-widget > .body {
|
||||
border-top: 1px solid;
|
||||
position: relative;
|
||||
@@ -68,25 +64,20 @@
|
||||
/* Dark Theme */
|
||||
/* High Contrast Theme */
|
||||
|
||||
.monaco-editor.hc-black .peekview-widget .head .peekview-actions .action-label.icon.close-peekview-action,
|
||||
.monaco-editor.vs-dark .peekview-widget .head .peekview-actions .action-label.icon.close-peekview-action {
|
||||
background: url('close-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.monaco-editor .peekview-widget .peekview-actions .icon.chevron-up {
|
||||
.monaco-editor .peekview-widget .peekview-actions .codicon.chevron-up {
|
||||
background: url('chevron-previous-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-editor .peekview-widget .peekview-actions .icon.chevron-up,
|
||||
.hc-black .monaco-editor .peekview-widget .peekview-actions .icon.chevron-up {
|
||||
.vs-dark .monaco-editor .peekview-widget .peekview-actions .codicon.chevron-up,
|
||||
.hc-black .monaco-editor .peekview-widget .peekview-actions .codicon.chevron-up {
|
||||
background: url('chevron-previous-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.monaco-editor .peekview-widget .peekview-actions .icon.chevron-down {
|
||||
.monaco-editor .peekview-widget .peekview-actions .codicon.chevron-down {
|
||||
background: url('chevron-next-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-editor .peekview-widget .peekview-actions .icon.chevron-down,
|
||||
.hc-black .monaco-editor .peekview-widget .peekview-actions .icon.chevron-down {
|
||||
.vs-dark .monaco-editor .peekview-widget .peekview-actions .codicon.chevron-down,
|
||||
.hc-black .monaco-editor .peekview-widget .peekview-actions .codicon.chevron-down {
|
||||
background: url('chevron-next-dark.svg') center center no-repeat;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
this._actionbarWidget = new ActionBar(actionsContainer, actionBarOptions);
|
||||
this._disposables.add(this._actionbarWidget);
|
||||
|
||||
this._actionbarWidget.push(new Action('peekview.close', nls.localize('label.close', "Close"), 'close-peekview-action', true, () => {
|
||||
this._actionbarWidget.push(new Action('peekview.close', nls.localize('label.close', "Close"), 'codicon-close', true, () => {
|
||||
this.dispose();
|
||||
return Promise.resolve();
|
||||
}), { label: false, icon: true });
|
||||
|
||||
@@ -53,6 +53,10 @@
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.monaco-editor .suggest-widget > .details p > code {
|
||||
font-family: var(--monaco-monospace-font);
|
||||
}
|
||||
|
||||
/* Styles for Message element for when widget is loading or is empty */
|
||||
.monaco-editor .suggest-widget > .message {
|
||||
padding-left: 22px;
|
||||
|
||||
@@ -186,6 +186,10 @@ export class SimpleDialogService implements IDialogService {
|
||||
public show(severity: Severity, message: string, buttons: string[], options?: IDialogOptions): Promise<IShowResult> {
|
||||
return Promise.resolve({ choice: 0 });
|
||||
}
|
||||
|
||||
public about(): Promise<void> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
export class SimpleNotificationService implements INotificationService {
|
||||
|
||||
@@ -92,7 +92,7 @@ suite('Editor Commands - ShiftCommand', () => {
|
||||
'',
|
||||
'123'
|
||||
],
|
||||
new Selection(1, 1, 1, 2)
|
||||
new Selection(1, 2, 1, 2)
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
10
src/vs/nls.d.ts
vendored
@@ -9,11 +9,17 @@ export interface ILocalizeInfo {
|
||||
}
|
||||
|
||||
/**
|
||||
* Localize a message. `message` can contain `{n}` notation where it is replaced by the nth value in `...args`.
|
||||
* Localize a message.
|
||||
*
|
||||
* `message` can contain `{n}` notation where it is replaced by the nth value in `...args`
|
||||
* For example, `localize('hello {0}', name)`
|
||||
*/
|
||||
export declare function localize(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string;
|
||||
|
||||
/**
|
||||
* Localize a message. `message` can contain `{n}` notation where it is replaced by the nth value in `...args`.
|
||||
* Localize a message.
|
||||
*
|
||||
* `message` can contain `{n}` notation where it is replaced by the nth value in `...args`
|
||||
* For example, `localize('hello {0}', name)`
|
||||
*/
|
||||
export declare function localize(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string;
|
||||
|
||||
@@ -93,6 +93,7 @@ export const enum MenuId {
|
||||
SearchContext,
|
||||
StatusBarWindowIndicatorMenu,
|
||||
TouchBarContext,
|
||||
TitleBarContext,
|
||||
ViewItemContext,
|
||||
ViewTitle,
|
||||
ObjectExplorerItemContext, // {{SQL CARBON EDIT}}
|
||||
|
||||
@@ -6,27 +6,10 @@
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export interface ISerializedWorkspace { id: string; configURIPath: string; remoteAuthority?: string; }
|
||||
|
||||
export interface IBackupWorkspacesFormat {
|
||||
rootURIWorkspaces: ISerializedWorkspace[];
|
||||
folderURIWorkspaces: string[];
|
||||
emptyWorkspaceInfos: IEmptyWindowBackupInfo[];
|
||||
|
||||
// deprecated
|
||||
folderWorkspaces?: string[]; // use folderURIWorkspaces instead
|
||||
emptyWorkspaces?: string[];
|
||||
rootWorkspaces?: { id: string, configPath: string }[]; // use rootURIWorkspaces instead
|
||||
}
|
||||
import { IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup';
|
||||
|
||||
export const IBackupMainService = createDecorator<IBackupMainService>('backupMainService');
|
||||
|
||||
export interface IEmptyWindowBackupInfo {
|
||||
backupFolder: string;
|
||||
remoteAuthority?: string;
|
||||
}
|
||||
|
||||
export interface IWorkspaceBackupInfo {
|
||||
workspace: IWorkspaceIdentifier;
|
||||
remoteAuthority?: string;
|
||||
@@ -48,4 +31,4 @@ export interface IBackupMainService {
|
||||
unregisterWorkspaceBackupSync(workspace: IWorkspaceIdentifier): void;
|
||||
unregisterFolderBackupSync(folderUri: URI): void;
|
||||
unregisterEmptyWindowBackupSync(backupFolder: string): void;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,8 @@ import * as path from 'vs/base/common/path';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import { writeFileSync, writeFile, readFile, readdir, exists, rimraf, rename, RimRafMode } from 'vs/base/node/pfs';
|
||||
import * as arrays from 'vs/base/common/arrays';
|
||||
import { IBackupMainService, IBackupWorkspacesFormat, IEmptyWindowBackupInfo, IWorkspaceBackupInfo } from 'vs/platform/backup/common/backup';
|
||||
import { IBackupMainService, IWorkspaceBackupInfo } from 'vs/platform/backup/electron-main/backup';
|
||||
import { IBackupWorkspacesFormat, IEmptyWindowBackupInfo } from 'vs/platform/backup/node/backup';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IFilesConfiguration, HotExitConfiguration } from 'vs/platform/files/common/files';
|
||||
|
||||
22
src/vs/platform/backup/node/backup.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export interface ISerializedWorkspace { id: string; configURIPath: string; remoteAuthority?: string; }
|
||||
|
||||
export interface IBackupWorkspacesFormat {
|
||||
rootURIWorkspaces: ISerializedWorkspace[];
|
||||
folderURIWorkspaces: string[];
|
||||
emptyWorkspaceInfos: IEmptyWindowBackupInfo[];
|
||||
|
||||
// deprecated
|
||||
folderWorkspaces?: string[]; // use folderURIWorkspaces instead
|
||||
emptyWorkspaces?: string[];
|
||||
rootWorkspaces?: { id: string, configPath: string }[]; // use rootURIWorkspaces instead
|
||||
}
|
||||
|
||||
export interface IEmptyWindowBackupInfo {
|
||||
backupFolder: string;
|
||||
remoteAuthority?: string;
|
||||
}
|
||||
@@ -9,11 +9,12 @@ import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'vs/base/common/path';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
import { URI as Uri, URI } from 'vs/base/common/uri';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
|
||||
import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||
import { BackupMainService } from 'vs/platform/backup/electron-main/backupMainService';
|
||||
import { IBackupWorkspacesFormat, ISerializedWorkspace, IWorkspaceBackupInfo } from 'vs/platform/backup/common/backup';
|
||||
import { IWorkspaceBackupInfo } from 'vs/platform/backup/electron-main/backup';
|
||||
import { IBackupWorkspacesFormat, ISerializedWorkspace } from 'vs/platform/backup/node/backup';
|
||||
import { HotExitConfiguration } from 'vs/platform/files/common/files';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { ConsoleLogMainService } from 'vs/platform/log/common/log';
|
||||
@@ -24,7 +25,7 @@ import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
suite('BackupMainService', () => {
|
||||
|
||||
function assertEqualUris(actual: Uri[], expected: Uri[]) {
|
||||
function assertEqualUris(actual: URI[], expected: URI[]) {
|
||||
assert.deepEqual(actual.map(a => a.toString()), expected.map(a => a.toString()));
|
||||
}
|
||||
|
||||
@@ -43,12 +44,12 @@ suite('BackupMainService', () => {
|
||||
this.workspacesJsonPath = backupWorkspacesPath;
|
||||
}
|
||||
|
||||
public toBackupPath(arg: Uri | string): string {
|
||||
const id = arg instanceof Uri ? super.getFolderHash(arg) : arg;
|
||||
public toBackupPath(arg: URI | string): string {
|
||||
const id = arg instanceof URI ? super.getFolderHash(arg) : arg;
|
||||
return path.join(this.backupHome, id);
|
||||
}
|
||||
|
||||
public getFolderHash(folderUri: Uri): string {
|
||||
public getFolderHash(folderUri: URI): string {
|
||||
return super.getFolderHash(folderUri);
|
||||
}
|
||||
|
||||
@@ -81,7 +82,7 @@ suite('BackupMainService', () => {
|
||||
};
|
||||
}
|
||||
|
||||
async function ensureFolderExists(uri: Uri): Promise<void> {
|
||||
async function ensureFolderExists(uri: URI): Promise<void> {
|
||||
if (!fs.existsSync(uri.fsPath)) {
|
||||
fs.mkdirSync(uri.fsPath);
|
||||
}
|
||||
@@ -110,10 +111,10 @@ suite('BackupMainService', () => {
|
||||
return platform.isLinux ? p : p.toLowerCase();
|
||||
}
|
||||
|
||||
const fooFile = Uri.file(platform.isWindows ? 'C:\\foo' : '/foo');
|
||||
const barFile = Uri.file(platform.isWindows ? 'C:\\bar' : '/bar');
|
||||
const fooFile = URI.file(platform.isWindows ? 'C:\\foo' : '/foo');
|
||||
const barFile = URI.file(platform.isWindows ? 'C:\\bar' : '/bar');
|
||||
|
||||
const existingTestFolder1 = Uri.file(path.join(parentDir, 'folder1'));
|
||||
const existingTestFolder1 = URI.file(path.join(parentDir, 'folder1'));
|
||||
|
||||
let service: TestBackupMainService;
|
||||
let configService: TestConfigurationService;
|
||||
@@ -231,7 +232,7 @@ suite('BackupMainService', () => {
|
||||
const backupPathToMigrate = service.toBackupPath(fooFile);
|
||||
fs.mkdirSync(backupPathToMigrate);
|
||||
fs.writeFileSync(path.join(backupPathToMigrate, 'backup.txt'), 'Some Data');
|
||||
service.registerFolderBackupSync(Uri.file(backupPathToMigrate));
|
||||
service.registerFolderBackupSync(URI.file(backupPathToMigrate));
|
||||
|
||||
const workspaceBackupPath = service.registerWorkspaceBackupSync(toWorkspaceBackupInfo(barFile.fsPath), backupPathToMigrate);
|
||||
|
||||
@@ -247,12 +248,12 @@ suite('BackupMainService', () => {
|
||||
const backupPathToMigrate = service.toBackupPath(fooFile);
|
||||
fs.mkdirSync(backupPathToMigrate);
|
||||
fs.writeFileSync(path.join(backupPathToMigrate, 'backup.txt'), 'Some Data');
|
||||
service.registerFolderBackupSync(Uri.file(backupPathToMigrate));
|
||||
service.registerFolderBackupSync(URI.file(backupPathToMigrate));
|
||||
|
||||
const backupPathToPreserve = service.toBackupPath(barFile);
|
||||
fs.mkdirSync(backupPathToPreserve);
|
||||
fs.writeFileSync(path.join(backupPathToPreserve, 'backup.txt'), 'Some Data');
|
||||
service.registerFolderBackupSync(Uri.file(backupPathToPreserve));
|
||||
service.registerFolderBackupSync(URI.file(backupPathToPreserve));
|
||||
|
||||
const workspaceBackupPath = service.registerWorkspaceBackupSync(toWorkspaceBackupInfo(barFile.fsPath), backupPathToMigrate);
|
||||
|
||||
@@ -270,8 +271,8 @@ suite('BackupMainService', () => {
|
||||
test('migration folder path to URI makes sure to preserve existing backups', async () => {
|
||||
let path1 = path.join(parentDir, 'folder1');
|
||||
let path2 = path.join(parentDir, 'FOLDER2');
|
||||
let uri1 = Uri.file(path1);
|
||||
let uri2 = Uri.file(path2);
|
||||
let uri1 = URI.file(path1);
|
||||
let uri2 = URI.file(path2);
|
||||
|
||||
if (!fs.existsSync(path1)) {
|
||||
fs.mkdirSync(path1);
|
||||
@@ -372,8 +373,8 @@ suite('BackupMainService', () => {
|
||||
});
|
||||
|
||||
test('getFolderBackupPaths() should return [] when files.hotExit = "onExitAndWindowClose"', async () => {
|
||||
service.registerFolderBackupSync(Uri.file(fooFile.fsPath.toUpperCase()));
|
||||
assertEqualUris(service.getFolderBackupPaths(), [Uri.file(fooFile.fsPath.toUpperCase())]);
|
||||
service.registerFolderBackupSync(URI.file(fooFile.fsPath.toUpperCase()));
|
||||
assertEqualUris(service.getFolderBackupPaths(), [URI.file(fooFile.fsPath.toUpperCase())]);
|
||||
configService.setUserConfiguration('files.hotExit', HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE);
|
||||
await service.initialize();
|
||||
assertEqualUris(service.getFolderBackupPaths(), []);
|
||||
@@ -591,11 +592,11 @@ suite('BackupMainService', () => {
|
||||
});
|
||||
|
||||
test('should always store the workspace path in workspaces.json using the case given, regardless of whether the file system is case-sensitive (folder workspace)', () => {
|
||||
service.registerFolderBackupSync(Uri.file(fooFile.fsPath.toUpperCase()));
|
||||
assertEqualUris(service.getFolderBackupPaths(), [Uri.file(fooFile.fsPath.toUpperCase())]);
|
||||
service.registerFolderBackupSync(URI.file(fooFile.fsPath.toUpperCase()));
|
||||
assertEqualUris(service.getFolderBackupPaths(), [URI.file(fooFile.fsPath.toUpperCase())]);
|
||||
return pfs.readFile(backupWorkspacesPath, 'utf-8').then(buffer => {
|
||||
const json = <IBackupWorkspacesFormat>JSON.parse(buffer);
|
||||
assert.deepEqual(json.folderURIWorkspaces, [Uri.file(fooFile.fsPath.toUpperCase()).toString()]);
|
||||
assert.deepEqual(json.folderURIWorkspaces, [URI.file(fooFile.fsPath.toUpperCase()).toString()]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -681,11 +682,11 @@ suite('BackupMainService', () => {
|
||||
}
|
||||
|
||||
if (platform.isMacintosh) {
|
||||
assert.equal(service.getFolderHash(Uri.file('/foo')), service.getFolderHash(Uri.file('/FOO')));
|
||||
assert.equal(service.getFolderHash(URI.file('/foo')), service.getFolderHash(URI.file('/FOO')));
|
||||
}
|
||||
|
||||
if (platform.isWindows) {
|
||||
assert.equal(service.getFolderHash(Uri.file('c:\\foo')), service.getFolderHash(Uri.file('C:\\FOO')));
|
||||
assert.equal(service.getFolderHash(URI.file('c:\\foo')), service.getFolderHash(URI.file('C:\\FOO')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -693,7 +694,7 @@ suite('BackupMainService', () => {
|
||||
suite('mixed path casing', () => {
|
||||
test('should handle case insensitive paths properly (registerWindowForBackupsSync) (folder workspace)', () => {
|
||||
service.registerFolderBackupSync(fooFile);
|
||||
service.registerFolderBackupSync(Uri.file(fooFile.fsPath.toUpperCase()));
|
||||
service.registerFolderBackupSync(URI.file(fooFile.fsPath.toUpperCase()));
|
||||
|
||||
if (platform.isLinux) {
|
||||
assert.equal(service.getFolderBackupPaths().length, 2);
|
||||
@@ -722,7 +723,7 @@ suite('BackupMainService', () => {
|
||||
|
||||
// mixed case
|
||||
service.registerFolderBackupSync(fooFile);
|
||||
service.unregisterFolderBackupSync(Uri.file(fooFile.fsPath.toUpperCase()));
|
||||
service.unregisterFolderBackupSync(URI.file(fooFile.fsPath.toUpperCase()));
|
||||
|
||||
if (platform.isLinux) {
|
||||
assert.equal(service.getFolderBackupPaths().length, 1);
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { IRemoteConsoleLog } from 'vs/base/common/console';
|
||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
import { IProcessEnvironment } from 'vs/base/common/platform';
|
||||
|
||||
export const IExtensionHostDebugService = createDecorator<IExtensionHostDebugService>('extensionHostDebugService');
|
||||
|
||||
@@ -37,17 +39,19 @@ export interface IExtensionHostDebugService {
|
||||
_serviceBrand: undefined;
|
||||
|
||||
reload(sessionId: string): void;
|
||||
onReload: Event<IReloadSessionEvent>;
|
||||
readonly onReload: Event<IReloadSessionEvent>;
|
||||
|
||||
close(sessionId: string): void;
|
||||
onClose: Event<ICloseSessionEvent>;
|
||||
readonly onClose: Event<ICloseSessionEvent>;
|
||||
|
||||
attachSession(sessionId: string, port: number, subId?: string): void;
|
||||
onAttachSession: Event<IAttachSessionEvent>;
|
||||
readonly onAttachSession: Event<IAttachSessionEvent>;
|
||||
|
||||
logToSession(sessionId: string, log: IRemoteConsoleLog): void;
|
||||
onLogToSession: Event<ILogToSessionEvent>;
|
||||
readonly onLogToSession: Event<ILogToSessionEvent>;
|
||||
|
||||
terminateSession(sessionId: string, subId?: string): void;
|
||||
onTerminateSession: Event<ITerminateSessionEvent>;
|
||||
readonly onTerminateSession: Event<ITerminateSessionEvent>;
|
||||
|
||||
openExtensionDevelopmentHostWindow(args: ParsedArgs, env: IProcessEnvironment): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import { IReloadSessionEvent, ICloseSessionEvent, IAttachSessionEvent, ILogToSes
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IRemoteConsoleLog } from 'vs/base/common/console';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
import { IProcessEnvironment } from 'vs/base/common/platform';
|
||||
|
||||
export class ExtensionHostDebugBroadcastChannel<TContext> implements IServerChannel<TContext> {
|
||||
|
||||
@@ -99,4 +101,10 @@ export class ExtensionHostDebugChannelClient extends Disposable implements IExte
|
||||
get onTerminateSession(): Event<ITerminateSessionEvent> {
|
||||
return this.channel.listen('terminate');
|
||||
}
|
||||
}
|
||||
|
||||
openExtensionDevelopmentHostWindow(args: ParsedArgs, env: IProcessEnvironment): Promise<void> {
|
||||
// TODO@Isidor
|
||||
//return this.channel.call('openExtensionDevelopmentHostWindow', [args, env]);
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { IServerChannel, IChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { IRemoteDiagnosticInfo, IRemoteDiagnosticError, SystemInfo, PerformanceInfo } from 'vs/platform/diagnostics/common/diagnostics';
|
||||
import { IDiagnosticsService } from './diagnosticsService';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { IMainProcessInfo } from 'vs/platform/launch/common/launchService';
|
||||
import { IMainProcessInfo } from 'vs/platform/launch/common/launch';
|
||||
import { IWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||
|
||||
export class DiagnosticsChannel implements IServerChannel {
|
||||
|
||||
@@ -9,13 +9,12 @@ import { readdir, stat, exists, readFile } from 'fs';
|
||||
import { join, basename } from 'vs/base/common/path';
|
||||
import { parse, ParseError } from 'vs/base/common/json';
|
||||
import { listProcesses } from 'vs/base/node/ps';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { repeat, pad } from 'vs/base/common/strings';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ProcessItem } from 'vs/base/common/processes';
|
||||
import { IMainProcessInfo } from 'vs/platform/launch/common/launchService';
|
||||
import { IMainProcessInfo } from 'vs/platform/launch/common/launch';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
@@ -267,7 +266,7 @@ export class DiagnosticsService implements IDiagnosticsService {
|
||||
const GB = 1024 * MB;
|
||||
|
||||
const output: string[] = [];
|
||||
output.push(`Version: ${pkg.name} ${pkg.version} (${product.commit || 'Commit unknown'}, ${product.date || 'Date unknown'})`);
|
||||
output.push(`Version: ${product.nameShort} ${product.version} (${product.commit || 'Commit unknown'}, ${product.date || 'Date unknown'})`);
|
||||
output.push(`OS Version: ${osLib.type()} ${osLib.arch()} ${osLib.release()}`);
|
||||
const cpus = osLib.cpus();
|
||||
if (cpus && cpus.length > 0) {
|
||||
|
||||
@@ -172,6 +172,11 @@ export interface IDialogService {
|
||||
* option then promise with index `0` is returned.
|
||||
*/
|
||||
show(severity: Severity, message: string, buttons: string[], options?: IDialogOptions): Promise<IShowResult>;
|
||||
|
||||
/**
|
||||
* Present the about dialog to the user.
|
||||
*/
|
||||
about(): Promise<void>;
|
||||
}
|
||||
|
||||
export const IFileDialogService = createDecorator<IFileDialogService>('fileDialogService');
|
||||
@@ -235,11 +240,10 @@ export interface IFileDialogService {
|
||||
* Shows a open file dialog and returns the chosen file URI.
|
||||
*/
|
||||
showOpenDialog(options: IOpenDialogOptions): Promise<URI[] | undefined>;
|
||||
|
||||
}
|
||||
|
||||
const MAX_CONFIRM_FILES = 10;
|
||||
export function getConfirmMessage(start: string, resourcesToConfirm: URI[]): string {
|
||||
export function getConfirmMessage(start: string, resourcesToConfirm: readonly URI[]): string {
|
||||
const message = [start];
|
||||
message.push('');
|
||||
message.push(...resourcesToConfirm.slice(0, MAX_CONFIRM_FILES).map(r => basename(r)));
|
||||
|
||||