Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
cc785ad4
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,发现更多精彩内容 >>
提交
cc785ad4
编写于
11月 09, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More native promise adoption
上级
87f7ce05
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
13 addition
and
20 deletion
+13
-20
src/vs/platform/remote/node/remoteAuthorityResolverChannel.ts
...vs/platform/remote/node/remoteAuthorityResolverChannel.ts
+1
-2
src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts
...bench/services/keybinding/test/keyboardMapperTestUtils.ts
+2
-3
src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts
...h/services/keybinding/test/macLinuxKeyboardMapper.test.ts
+1
-2
src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts
...ch/services/keybinding/test/windowsKeyboardMapper.test.ts
+1
-2
src/vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts
...ervices/remote/electron-browser/remoteAgentServiceImpl.ts
+4
-5
src/vs/workbench/services/remote/node/remoteAgentEnvironmentChannel.ts
...nch/services/remote/node/remoteAgentEnvironmentChannel.ts
+3
-4
src/vs/workbench/services/remote/node/remoteAgentService.ts
src/vs/workbench/services/remote/node/remoteAgentService.ts
+1
-2
未找到文件。
src/vs/platform/remote/node/remoteAuthorityResolverChannel.ts
浏览文件 @
cc785ad4
...
...
@@ -7,7 +7,6 @@ import { IChannel } from 'vs/base/parts/ipc/node/ipc';
import
{
Event
,
buffer
}
from
'
vs/base/common/event
'
;
import
{
ResolvedAuthority
,
IResolvingProgressEvent
,
IRemoteAuthorityResolverService
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
export
interface
IRemoteAuthorityResolverChannel
extends
IChannel
{
listen
(
event
:
'
onResolvingProgress
'
):
Event
<
IResolvingProgressEvent
>
;
...
...
@@ -72,7 +71,7 @@ export class RemoteAuthorityResolverChannelClient implements IRemoteAuthorityRes
}
else
{
const
[
host
,
strPort
]
=
authority
.
split
(
'
:
'
);
const
port
=
parseInt
(
strPort
,
10
);
return
TPromise
.
as
({
authority
,
host
,
port
});
return
Promise
.
resolve
({
authority
,
host
,
port
});
}
}
...
...
src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts
浏览文件 @
cc785ad4
...
...
@@ -8,7 +8,6 @@ import * as path from 'path';
import
{
getPathFromAmdModule
}
from
'
vs/base/common/amd
'
;
import
{
Keybinding
,
ResolvedKeybinding
,
SimpleKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
ScanCodeBinding
}
from
'
vs/base/common/scanCode
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
readFile
,
writeFile
}
from
'
vs/base/node/pfs
'
;
import
{
IKeyboardEvent
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IKeyboardMapper
}
from
'
vs/workbench/services/keybinding/common/keyboardMapper
'
;
...
...
@@ -50,7 +49,7 @@ export function assertResolveUserBinding(mapper: IKeyboardMapper, firstPart: Sim
assert
.
deepEqual
(
actual
,
expected
);
}
export
function
readRawMapping
<
T
>
(
file
:
string
):
T
Promise
<
T
>
{
export
function
readRawMapping
<
T
>
(
file
:
string
):
Promise
<
T
>
{
return
readFile
(
getPathFromAmdModule
(
require
,
`vs/workbench/services/keybinding/test/
${
file
}
.js`
)).
then
((
buff
)
=>
{
let
contents
=
buff
.
toString
();
let
func
=
new
Function
(
'
define
'
,
contents
);
...
...
@@ -62,7 +61,7 @@ export function readRawMapping<T>(file: string): TPromise<T> {
});
}
export
function
assertMapping
(
writeFileIfDifferent
:
boolean
,
mapper
:
IKeyboardMapper
,
file
:
string
):
T
Promise
<
void
>
{
export
function
assertMapping
(
writeFileIfDifferent
:
boolean
,
mapper
:
IKeyboardMapper
,
file
:
string
):
Promise
<
void
>
{
const
filePath
=
path
.
normalize
(
getPathFromAmdModule
(
require
,
`vs/workbench/services/keybinding/test/
${
file
}
`
));
return
readFile
(
filePath
).
then
((
buff
)
=>
{
...
...
src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts
浏览文件 @
cc785ad4
...
...
@@ -8,14 +8,13 @@ import { KeyChord, KeyCode, KeyMod, SimpleKeybinding, createKeybinding } from 'v
import
{
UserSettingsLabelProvider
}
from
'
vs/base/common/keybindingLabels
'
;
import
{
OperatingSystem
}
from
'
vs/base/common/platform
'
;
import
{
ScanCode
,
ScanCodeBinding
,
ScanCodeUtils
}
from
'
vs/base/common/scanCode
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
USLayoutResolvedKeybinding
}
from
'
vs/platform/keybinding/common/usLayoutResolvedKeybinding
'
;
import
{
IMacLinuxKeyboardMapping
,
MacLinuxKeyboardMapper
}
from
'
vs/workbench/services/keybinding/common/macLinuxKeyboardMapper
'
;
import
{
IResolvedKeybinding
,
assertMapping
,
assertResolveKeybinding
,
assertResolveKeyboardEvent
,
assertResolveUserBinding
,
readRawMapping
}
from
'
vs/workbench/services/keybinding/test/keyboardMapperTestUtils
'
;
const
WRITE_FILE_IF_DIFFERENT
=
false
;
async
function
createKeyboardMapper
(
isUSStandard
:
boolean
,
file
:
string
,
OS
:
OperatingSystem
):
T
Promise
<
MacLinuxKeyboardMapper
>
{
async
function
createKeyboardMapper
(
isUSStandard
:
boolean
,
file
:
string
,
OS
:
OperatingSystem
):
Promise
<
MacLinuxKeyboardMapper
>
{
const
rawMappings
=
await
readRawMapping
<
IMacLinuxKeyboardMapping
>
(
file
);
return
new
MacLinuxKeyboardMapper
(
isUSStandard
,
rawMappings
,
OS
);
}
...
...
src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts
浏览文件 @
cc785ad4
...
...
@@ -6,13 +6,12 @@
import
{
KeyChord
,
KeyCode
,
KeyMod
,
SimpleKeybinding
,
createKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
OperatingSystem
}
from
'
vs/base/common/platform
'
;
import
{
ScanCode
,
ScanCodeBinding
}
from
'
vs/base/common/scanCode
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IWindowsKeyboardMapping
,
WindowsKeyboardMapper
}
from
'
vs/workbench/services/keybinding/common/windowsKeyboardMapper
'
;
import
{
IResolvedKeybinding
,
assertMapping
,
assertResolveKeybinding
,
assertResolveKeyboardEvent
,
assertResolveUserBinding
,
readRawMapping
}
from
'
vs/workbench/services/keybinding/test/keyboardMapperTestUtils
'
;
const
WRITE_FILE_IF_DIFFERENT
=
false
;
async
function
createKeyboardMapper
(
isUSStandard
:
boolean
,
file
:
string
):
T
Promise
<
WindowsKeyboardMapper
>
{
async
function
createKeyboardMapper
(
isUSStandard
:
boolean
,
file
:
string
):
Promise
<
WindowsKeyboardMapper
>
{
const
rawMappings
=
await
readRawMapping
<
IWindowsKeyboardMapping
>
(
file
);
return
new
WindowsKeyboardMapper
(
isUSStandard
,
rawMappings
);
}
...
...
src/vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts
浏览文件 @
cc785ad4
...
...
@@ -5,7 +5,6 @@
import
{
localize
}
from
'
vs/nls
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IChannel
,
getDelayedChannel
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
Client
}
from
'
vs/base/parts/ipc/node/ipc.net
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
...
...
@@ -41,8 +40,8 @@ export class RemoteAgentService implements IRemoteAgentService {
class
RemoteAgentConnection
extends
Disposable
implements
IRemoteAgentConnection
{
readonly
remoteAuthority
:
string
;
private
_connection
:
T
Promis
e
<
Client
>
|
null
;
private
_environment
:
T
Promis
e
<
IRemoteAgentEnvironment
|
null
>
|
null
;
private
_connection
:
T
henabl
e
<
Client
>
|
null
;
private
_environment
:
T
henabl
e
<
IRemoteAgentEnvironment
|
null
>
|
null
;
constructor
(
remoteAuthority
:
string
,
...
...
@@ -56,7 +55,7 @@ class RemoteAgentConnection extends Disposable implements IRemoteAgentConnection
this
.
_environment
=
null
;
}
getEnvironment
():
T
Promis
e
<
IRemoteAgentEnvironment
|
null
>
{
getEnvironment
():
T
henabl
e
<
IRemoteAgentEnvironment
|
null
>
{
if
(
!
this
.
_environment
)
{
const
client
=
new
RemoteExtensionEnvironmentChannelClient
(
this
.
getChannel
(
'
remoteextensionsenvironment
'
));
...
...
@@ -75,7 +74,7 @@ class RemoteAgentConnection extends Disposable implements IRemoteAgentConnection
this
.
_getOrCreateConnection
().
then
(
client
=>
client
.
registerChannel
(
channelName
,
channel
));
}
private
_getOrCreateConnection
():
T
Promis
e
<
Client
>
{
private
_getOrCreateConnection
():
T
henabl
e
<
Client
>
{
if
(
!
this
.
_connection
)
{
this
.
_connection
=
this
.
_remoteAuthorityResolverService
.
resolveAuthority
(
this
.
remoteAuthority
).
then
((
resolvedAuthority
)
=>
{
return
connectRemoteAgentManagement
(
resolvedAuthority
.
host
,
resolvedAuthority
.
port
,
`renderer`
);
...
...
src/vs/workbench/services/remote/node/remoteAgentEnvironmentChannel.ts
浏览文件 @
cc785ad4
...
...
@@ -5,7 +5,6 @@
import
{
OperatingSystem
}
from
'
vs/base/common/platform
'
;
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IChannel
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
IExtensionDescription
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IRemoteAgentEnvironment
}
from
'
vs/workbench/services/remote/node/remoteAgentService
'
;
...
...
@@ -22,15 +21,15 @@ export interface IRemoteAgentEnvironmentDTO {
}
export
interface
IRemoteAgentEnvironmentChannel
extends
IChannel
{
call
(
command
:
'
getEnvironmentData
'
,
args
:
[
string
,
string
]):
T
Promise
<
IRemoteAgentEnvironmentDTO
>
;
call
(
command
:
string
,
arg
?:
any
):
T
Promise
<
any
>
;
call
(
command
:
'
getEnvironmentData
'
,
args
:
[
string
,
string
]):
Promise
<
IRemoteAgentEnvironmentDTO
>
;
call
(
command
:
string
,
arg
?:
any
):
Promise
<
any
>
;
}
export
class
RemoteExtensionEnvironmentChannelClient
{
constructor
(
private
channel
:
IRemoteAgentEnvironmentChannel
)
{
}
getEnvironmentData
(
remoteAuthority
:
string
,
extensionDevelopmentPath
?:
URI
):
T
Promise
<
IRemoteAgentEnvironment
>
{
getEnvironmentData
(
remoteAuthority
:
string
,
extensionDevelopmentPath
?:
URI
):
Promise
<
IRemoteAgentEnvironment
>
{
return
this
.
channel
.
call
(
'
getEnvironmentData
'
,
[
remoteAuthority
,
extensionDevelopmentPath
])
.
then
((
data
:
IRemoteAgentEnvironmentDTO
):
IRemoteAgentEnvironment
=>
{
return
{
...
...
src/vs/workbench/services/remote/node/remoteAgentService.ts
浏览文件 @
cc785ad4
...
...
@@ -5,7 +5,6 @@
import
{
OperatingSystem
}
from
'
vs/base/common/platform
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IChannel
}
from
'
vs/base/parts/ipc/node/ipc
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IExtensionDescription
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
...
...
@@ -34,7 +33,7 @@ export interface IRemoteAgentService {
export
interface
IRemoteAgentConnection
{
readonly
remoteAuthority
:
string
;
getEnvironment
():
T
Promis
e
<
IRemoteAgentEnvironment
|
null
>
;
getEnvironment
():
T
henabl
e
<
IRemoteAgentEnvironment
|
null
>
;
getChannel
<
T
extends
IChannel
>
(
channelName
:
string
):
T
;
registerChannel
<
T
extends
IChannel
>
(
channelName
:
string
,
channel
:
T
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录