Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7c593490
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7c593490
编写于
9月 22, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sandbox - self invoke functions for shared process, issues and process explorer
上级
5497e60e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
92 addition
and
56 deletion
+92
-56
src/bootstrap-window.js
src/bootstrap-window.js
+4
-0
src/vs/code/electron-browser/sharedProcess/sharedProcess.js
src/vs/code/electron-browser/sharedProcess/sharedProcess.js
+36
-24
src/vs/code/electron-sandbox/issue/issueReporter.js
src/vs/code/electron-sandbox/issue/issueReporter.js
+20
-10
src/vs/code/electron-sandbox/processExplorer/processExplorer.js
.../code/electron-sandbox/processExplorer/processExplorer.js
+20
-10
src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts
...e/electron-sandbox/processExplorer/processExplorerMain.ts
+9
-9
src/vs/platform/issue/common/issue.ts
src/vs/platform/issue/common/issue.ts
+1
-1
src/vs/workbench/contrib/issue/electron-sandbox/issueService.ts
.../workbench/contrib/issue/electron-sandbox/issueService.ts
+2
-2
未找到文件。
src/bootstrap-window.js
浏览文件 @
7c593490
...
...
@@ -107,6 +107,10 @@
'
vs/nls
'
:
nlsConfig
};
// Enable loading of node modules:
// - sandbox: we list paths of webpacked modules to help the loader
// - non-sandbox: we signal that any module that does not begin with
// `vs/` should be loaded using node.js require()
if
(
sandbox
)
{
loaderConfig
.
paths
=
{
'
vscode-textmate
'
:
`../node_modules/vscode-textmate/release/main`
,
...
...
src/vs/code/electron-browser/sharedProcess/sharedProcess.js
浏览文件 @
7c593490
...
...
@@ -6,28 +6,40 @@
//@ts-check
'
use strict
'
;
/**
* @type {{ load: (modules: string[], resultCallback: (result, configuration: object) => any, options?: object) => unknown }}
*/
const
bootstrapWindow
=
(()
=>
{
// @ts-ignore (defined in bootstrap-window.js)
return
window
.
MonacoBootstrapWindow
;
})();
/**
* @type {{ avoidMonkeyPatchFromAppInsights: () => void; }}
*/
const
bootstrap
=
(()
=>
{
// @ts-ignore (defined in bootstrap.js)
return
window
.
MonacoBootstrap
;
})();
// Avoid Monkey Patches from Application Insights
bootstrap
.
avoidMonkeyPatchFromAppInsights
();
bootstrapWindow
.
load
([
'
vs/code/electron-browser/sharedProcess/sharedProcessMain
'
],
function
(
sharedProcess
,
configuration
)
{
sharedProcess
.
startup
({
machineId
:
configuration
.
machineId
,
windowId
:
configuration
.
windowId
(
function
()
{
const
bootstrap
=
bootstrapLib
();
const
bootstrapWindow
=
bootstrapWindowLib
();
// Avoid Monkey Patches from Application Insights
bootstrap
.
avoidMonkeyPatchFromAppInsights
();
// Load shared process into window
bootstrapWindow
.
load
([
'
vs/code/electron-browser/sharedProcess/sharedProcessMain
'
],
function
(
sharedProcess
,
configuration
)
{
sharedProcess
.
startup
({
machineId
:
configuration
.
machineId
,
windowId
:
configuration
.
windowId
});
});
});
//#region Globals
/**
* @returns {{ avoidMonkeyPatchFromAppInsights: () => void; }}
*/
function
bootstrapLib
()
{
// @ts-ignore (defined in bootstrap.js)
return
window
.
MonacoBootstrap
;
}
/**
* @returns {{ load: (modules: string[], resultCallback: (result, configuration: object) => any, options?: object) => unknown }}
*/
function
bootstrapWindowLib
()
{
// @ts-ignore (defined in bootstrap-window.js)
return
window
.
MonacoBootstrapWindow
;
}
//#endregion
}());
src/vs/code/electron-sandbox/issue/issueReporter.js
浏览文件 @
7c593490
...
...
@@ -6,14 +6,24 @@
//@ts-check
'
use strict
'
;
/**
* @type {{ load: (modules: string[], resultCallback: (result, configuration: object) => any, options: object) => unknown }}
*/
const
bootstrapWindow
=
(()
=>
{
// @ts-ignore (defined in bootstrap-window.js)
return
window
.
MonacoBootstrapWindow
;
})();
(
function
()
{
const
bootstrapWindow
=
bootstrapWindowLib
();
bootstrapWindow
.
load
([
'
vs/code/electron-sandbox/issue/issueReporterMain
'
],
function
(
issueReporter
,
configuration
)
{
issueReporter
.
startup
(
configuration
);
},
{
forceEnableDeveloperKeybindings
:
true
,
disallowReloadKeybinding
:
true
});
// Load issue reporter into window
bootstrapWindow
.
load
([
'
vs/code/electron-sandbox/issue/issueReporterMain
'
],
function
(
issueReporter
,
configuration
)
{
issueReporter
.
startup
(
configuration
);
},
{
forceEnableDeveloperKeybindings
:
true
,
disallowReloadKeybinding
:
true
});
//#region Globals
/**
* @returns {{ load: (modules: string[], resultCallback: (result, configuration: object) => any, options?: object) => unknown }}
*/
function
bootstrapWindowLib
()
{
// @ts-ignore (defined in bootstrap-window.js)
return
window
.
MonacoBootstrapWindow
;
}
//#endregion
}());
src/vs/code/electron-sandbox/processExplorer/processExplorer.js
浏览文件 @
7c593490
...
...
@@ -6,14 +6,24 @@
//@ts-check
'
use strict
'
;
/**
* @type {{ load: (modules: string[], resultCallback: (result, configuration: object) => any, options: object) => unknown }}
*/
const
bootstrapWindow
=
(()
=>
{
// @ts-ignore (defined in bootstrap-window.js)
return
window
.
MonacoBootstrapWindow
;
})();
(
function
()
{
const
bootstrapWindow
=
bootstrapWindowLib
();
bootstrapWindow
.
load
([
'
vs/code/electron-sandbox/processExplorer/processExplorerMain
'
],
function
(
processExplorer
,
configuration
)
{
processExplorer
.
startup
(
configuration
.
windowId
,
configuration
.
data
);
},
{
forceEnableDeveloperKeybindings
:
true
});
// Load process explorer into window
bootstrapWindow
.
load
([
'
vs/code/electron-sandbox/processExplorer/processExplorerMain
'
],
function
(
processExplorer
,
configuration
)
{
processExplorer
.
startup
(
configuration
.
windowId
,
configuration
.
data
);
},
{
forceEnableDeveloperKeybindings
:
true
});
//#region Globals
/**
* @returns {{ load: (modules: string[], resultCallback: (result, configuration: object) => any, options?: object) => unknown }}
*/
function
bootstrapWindowLib
()
{
// @ts-ignore (defined in bootstrap-window.js)
return
window
.
MonacoBootstrapWindow
;
}
//#endregion
}());
src/vs/code/electron-sandbox/processExplorer/processExplorerMain.ts
浏览文件 @
7c593490
...
...
@@ -425,6 +425,15 @@ export function startup(windowId: number, data: ProcessExplorerData): void {
document
.
onkeydown
=
(
e
:
KeyboardEvent
)
=>
{
const
cmdOrCtrlKey
=
data
.
platform
===
'
darwin
'
?
e
.
metaKey
:
e
.
ctrlKey
;
// Cmd/Ctrl + w closes issue window
if
(
cmdOrCtrlKey
&&
e
.
keyCode
===
87
)
{
e
.
stopPropagation
();
e
.
preventDefault
();
processExplorer
.
dispose
();
ipcRenderer
.
send
(
'
vscode:closeProcessExplorer
'
);
}
// Cmd/Ctrl + zooms in
if
(
cmdOrCtrlKey
&&
e
.
keyCode
===
187
)
{
zoomIn
();
...
...
@@ -435,13 +444,4 @@ export function startup(windowId: number, data: ProcessExplorerData): void {
zoomOut
();
}
};
// Cmd/Ctrl + w closes process explorer
window
.
addEventListener
(
'
keydown
'
,
e
=>
{
const
cmdOrCtrlKey
=
data
.
platform
===
'
darwin
'
?
e
.
metaKey
:
e
.
ctrlKey
;
if
(
cmdOrCtrlKey
&&
e
.
keyCode
===
87
)
{
processExplorer
.
dispose
();
ipcRenderer
.
send
(
'
vscode:closeProcessExplorer
'
);
}
});
}
src/vs/platform/issue/common/issue.ts
浏览文件 @
7c593490
...
...
@@ -77,7 +77,7 @@ export interface ProcessExplorerStyles extends WindowStyles {
export
interface
ProcessExplorerData
extends
WindowData
{
pid
:
number
;
styles
:
ProcessExplorerStyles
;
platform
:
string
;
platform
:
'
win32
'
|
'
darwin
'
|
'
linux
'
;
applicationName
:
string
;
}
...
...
src/vs/workbench/contrib/issue/electron-sandbox/issueService.ts
浏览文件 @
7c593490
...
...
@@ -14,7 +14,7 @@ import { getZoomLevel } from 'vs/base/browser/browser';
import
{
IWorkbenchIssueService
}
from
'
vs/workbench/contrib/issue/electron-sandbox/issue
'
;
import
{
INativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-sandbox/environmentService
'
;
import
{
ExtensionType
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
p
latform
,
PlatformToString
}
from
'
vs/base/common/platform
'
;
import
{
p
rocess
}
from
'
vs/base/parts/sandbox/electron-sandbox/globals
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
export
class
WorkbenchIssueService
implements
IWorkbenchIssueService
{
...
...
@@ -70,7 +70,7 @@ export class WorkbenchIssueService implements IWorkbenchIssueService {
hoverForeground
:
getColor
(
theme
,
listHoverForeground
),
highlightForeground
:
getColor
(
theme
,
listHighlightForeground
),
},
platform
:
PlatformToString
(
platform
)
,
platform
:
process
.
platform
,
applicationName
:
this
.
productService
.
applicationName
};
return
this
.
issueService
.
openProcessExplorer
(
data
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录