Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c4aa0108
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c4aa0108
编写于
9月 18, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sandbox - expose `vscode-windows-registry` from native host service
上级
e85114b2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
18 deletion
+27
-18
src/vs/platform/native/common/native.ts
src/vs/platform/native/common/native.ts
+3
-0
src/vs/platform/native/electron-main/nativeHostMainService.ts
...vs/platform/native/electron-main/nativeHostMainService.ts
+15
-0
src/vs/workbench/contrib/tags/electron-browser/workspaceTags.ts
.../workbench/contrib/tags/electron-browser/workspaceTags.ts
+4
-8
src/vs/workbench/services/accessibility/electron-sandbox/accessibilityService.ts
...es/accessibility/electron-sandbox/accessibilityService.ts
+4
-10
src/vs/workbench/test/electron-browser/workbenchTestServices.ts
.../workbench/test/electron-browser/workbenchTestServices.ts
+1
-0
未找到文件。
src/vs/platform/native/common/native.ts
浏览文件 @
c4aa0108
...
...
@@ -135,4 +135,7 @@ export interface ICommonNativeHostService {
// Connectivity
resolveProxy
(
url
:
string
):
Promise
<
string
|
undefined
>
;
// Registry (windows only)
windowsGetStringRegKey
(
hive
:
'
HKEY_CURRENT_USER
'
|
'
HKEY_LOCAL_MACHINE
'
|
'
HKEY_CLASSES_ROOT
'
|
'
HKEY_USERS
'
|
'
HKEY_CURRENT_CONFIG
'
,
path
:
string
,
name
:
string
):
Promise
<
string
|
undefined
>
;
}
src/vs/platform/native/electron-main/nativeHostMainService.ts
浏览文件 @
c4aa0108
...
...
@@ -527,6 +527,21 @@ export class NativeHostMainService implements INativeHostMainService {
//#endregion
//#region Registry (windows)
async
windowsGetStringRegKey
(
windowId
:
number
|
undefined
,
hive
:
'
HKEY_CURRENT_USER
'
|
'
HKEY_LOCAL_MACHINE
'
|
'
HKEY_CLASSES_ROOT
'
|
'
HKEY_USERS
'
|
'
HKEY_CURRENT_CONFIG
'
,
path
:
string
,
name
:
string
):
Promise
<
string
|
undefined
>
{
if
(
!
isWindows
)
{
return
undefined
;
}
const
Registry
=
await
import
(
'
vscode-windows-registry
'
);
try
{
return
Registry
.
GetStringRegKey
(
hive
,
path
,
name
);
}
catch
{
return
undefined
;
}
}
private
windowById
(
windowId
:
number
|
undefined
):
ICodeWindow
|
undefined
{
if
(
typeof
windowId
!==
'
number
'
)
{
return
undefined
;
...
...
src/vs/workbench/contrib/tags/electron-browser/workspaceTags.ts
浏览文件 @
c4aa0108
...
...
@@ -17,6 +17,7 @@ import { IRequestService } from 'vs/platform/request/common/request';
import
{
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
getRemotes
,
AllowedSecondLevelDomains
,
getDomainsOfRemotes
}
from
'
vs/platform/extensionManagement/common/configRemotes
'
;
import
{
IDiagnosticsService
}
from
'
vs/platform/diagnostics/node/diagnosticsService
'
;
import
{
INativeHostService
}
from
'
vs/platform/native/electron-sandbox/native
'
;
export
function
getHashedRemotesFromConfig
(
text
:
string
,
stripEndingDotGit
:
boolean
=
false
):
string
[]
{
return
getRemotes
(
text
,
stripEndingDotGit
).
map
(
r
=>
{
...
...
@@ -33,7 +34,8 @@ export class WorkspaceTags implements IWorkbenchContribution {
@
IRequestService
private
readonly
requestService
:
IRequestService
,
@
ITextFileService
private
readonly
textFileService
:
ITextFileService
,
@
IWorkspaceTagsService
private
readonly
workspaceTagsService
:
IWorkspaceTagsService
,
@
IDiagnosticsService
private
readonly
diagnosticsService
:
IDiagnosticsService
@
IDiagnosticsService
private
readonly
diagnosticsService
:
IDiagnosticsService
,
@
INativeHostService
private
readonly
nativeHostService
:
INativeHostService
)
{
if
(
this
.
telemetryService
.
isOptedIn
)
{
this
.
report
();
...
...
@@ -61,13 +63,7 @@ export class WorkspaceTags implements IWorkbenchContribution {
return
;
}
const
Registry
=
await
import
(
'
vscode-windows-registry
'
);
let
value
;
try
{
value
=
Registry
.
GetStringRegKey
(
'
HKEY_LOCAL_MACHINE
'
,
'
SOFTWARE
\\
Microsoft
\\
Windows NT
\\
CurrentVersion
'
,
'
EditionID
'
);
}
catch
{
}
let
value
=
await
this
.
nativeHostService
.
windowsGetStringRegKey
(
'
HKEY_LOCAL_MACHINE
'
,
'
SOFTWARE
\\
Microsoft
\\
Windows NT
\\
CurrentVersion
'
,
'
EditionID
'
);
if
(
value
===
undefined
)
{
value
=
'
Unknown
'
;
}
...
...
src/vs/workbench/services/accessibility/electron-sandbox/accessibilityService.ts
浏览文件 @
c4aa0108
...
...
@@ -15,6 +15,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
IJSONEditingService
}
from
'
vs/workbench/services/configuration/common/jsonEditing
'
;
import
{
IWorkbenchContribution
,
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
INativeHostService
}
from
'
vs/platform/native/electron-sandbox/native
'
;
interface
AccessibilityMetrics
{
enabled
:
boolean
;
...
...
@@ -33,7 +34,8 @@ export class NativeAccessibilityService extends AccessibilityService implements
@
INativeWorkbenchEnvironmentService
environmentService
:
INativeWorkbenchEnvironmentService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IConfigurationService
configurationService
:
IConfigurationService
,
@
ITelemetryService
private
readonly
_telemetryService
:
ITelemetryService
@
ITelemetryService
private
readonly
_telemetryService
:
ITelemetryService
,
@
INativeHostService
private
readonly
nativeHostService
:
INativeHostService
)
{
super
(
contextKeyService
,
configurationService
);
this
.
setAccessibilitySupport
(
environmentService
.
configuration
.
accessibilitySupport
?
AccessibilitySupport
.
Enabled
:
AccessibilitySupport
.
Disabled
);
...
...
@@ -44,15 +46,7 @@ export class NativeAccessibilityService extends AccessibilityService implements
return
false
;
}
const
Registry
=
await
import
(
'
vscode-windows-registry
'
);
let
value
:
string
|
undefined
=
undefined
;
try
{
value
=
Registry
.
GetStringRegKey
(
'
HKEY_CURRENT_USER
'
,
'
Control Panel
\\
Accessibility
\\
Keyboard Preference
'
,
'
On
'
);
}
catch
{
return
false
;
}
const
value
=
await
this
.
nativeHostService
.
windowsGetStringRegKey
(
'
HKEY_CURRENT_USER
'
,
'
Control Panel
\\
Accessibility
\\
Keyboard Preference
'
,
'
On
'
);
return
value
===
'
1
'
;
}
...
...
src/vs/workbench/test/electron-browser/workbenchTestServices.ts
浏览文件 @
c4aa0108
...
...
@@ -230,6 +230,7 @@ export class TestNativeHostService implements INativeHostService {
async
readClipboardBuffer
(
format
:
string
):
Promise
<
Uint8Array
>
{
return
Uint8Array
.
from
([]);
}
async
hasClipboard
(
format
:
string
,
type
?:
'
selection
'
|
'
clipboard
'
|
undefined
):
Promise
<
boolean
>
{
return
false
;
}
async
sendInputEvent
(
event
:
MouseInputEvent
):
Promise
<
void
>
{
}
async
windowsGetStringRegKey
(
hive
:
'
HKEY_CURRENT_USER
'
|
'
HKEY_LOCAL_MACHINE
'
|
'
HKEY_CLASSES_ROOT
'
|
'
HKEY_USERS
'
|
'
HKEY_CURRENT_CONFIG
'
,
path
:
string
,
name
:
string
):
Promise
<
string
|
undefined
>
{
return
undefined
;
}
}
export
function
workbenchInstantiationService
():
ITestInstantiationService
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录