Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
myhjmzy
code-server
提交
e22791ec
C
code-server
项目概览
myhjmzy
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e22791ec
编写于
7月 12, 2019
作者:
A
Asher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix interactive playground
上级
286f9a89
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
13 deletion
+25
-13
scripts/vscode.patch
scripts/vscode.patch
+4
-3
src/channel.ts
src/channel.ts
+20
-9
src/server.ts
src/server.ts
+1
-1
未找到文件。
scripts/vscode.patch
浏览文件 @
e22791ec
...
...
@@ -202,19 +202,20 @@ index e09049c5b9..d93ffa527a 100644
\
No newline at end of file
+}
diff --git a/src/vs/workbench/browser/web.main.ts b/src/vs/workbench/browser/web.main.ts
index 1986fb6642..
7c66b644f2
100644
index 1986fb6642..
afbe385af6
100644
--- a/src/vs/workbench/browser/web.main.ts
+++ b/src/vs/workbench/browser/web.main.ts
@@ -115,6 +115,
8
@@
class CodeRendererMain extends Disposable {
@@ -115,6 +115,
9
@@
class CodeRendererMain extends Disposable {
const remoteFileSystemProvider = this._register(new RemoteExtensionsFileSystemProvider(channel, remoteAgentService.getEnvironment()));
fileService.registerProvider(Schemas.vscodeRemote, remoteFileSystemProvider);
+ fileService.registerProvider(Schemas.http, remoteFileSystemProvider);
+ fileService.registerProvider(Schemas.https, remoteFileSystemProvider);
+ fileService.registerProvider(Schemas.file, remoteFileSystemProvider);
}
const payload = await this.resolveWorkspaceInitializationPayload();
@@ -170,4 +17
2
,4 @@
export function main(domElement: HTMLElement, options: IWorkbenchConstructionOpt
@@ -170,4 +17
3
,4 @@
export function main(domElement: HTMLElement, options: IWorkbenchConstructionOpt
const renderer = new CodeRendererMain(domElement, options);
return renderer.open();
...
...
src/channel.ts
浏览文件 @
e22791ec
...
...
@@ -49,7 +49,10 @@ export class FileProviderChannel implements IServerChannel, IDisposable {
private
readonly
provider
:
DiskFileSystemProvider
;
private
readonly
watchers
=
new
Map
<
string
,
Watcher
>
();
public
constructor
(
private
readonly
logService
:
ILogService
)
{
public
constructor
(
private
readonly
environmentService
:
IEnvironmentService
,
private
readonly
logService
:
ILogService
,
)
{
this
.
provider
=
new
DiskFileSystemProvider
(
this
.
logService
);
}
...
...
@@ -113,11 +116,11 @@ export class FileProviderChannel implements IServerChannel, IDisposable {
}
private
async
stat
(
resource
:
UriComponents
):
Promise
<
IStat
>
{
return
this
.
provider
.
stat
(
URI
.
fro
m
(
resource
));
return
this
.
provider
.
stat
(
this
.
transfor
m
(
resource
));
}
private
async
open
(
resource
:
UriComponents
,
opts
:
FileOpenOptions
):
Promise
<
number
>
{
return
this
.
provider
.
open
(
URI
.
fro
m
(
resource
),
opts
);
return
this
.
provider
.
open
(
this
.
transfor
m
(
resource
),
opts
);
}
private
async
close
(
fd
:
number
):
Promise
<
void
>
{
...
...
@@ -135,32 +138,40 @@ export class FileProviderChannel implements IServerChannel, IDisposable {
}
private
async
delete
(
resource
:
UriComponents
,
opts
:
FileDeleteOptions
):
Promise
<
void
>
{
return
this
.
provider
.
delete
(
URI
.
fro
m
(
resource
),
opts
);
return
this
.
provider
.
delete
(
this
.
transfor
m
(
resource
),
opts
);
}
private
async
mkdir
(
resource
:
UriComponents
):
Promise
<
void
>
{
return
this
.
provider
.
mkdir
(
URI
.
fro
m
(
resource
));
return
this
.
provider
.
mkdir
(
this
.
transfor
m
(
resource
));
}
private
async
readdir
(
resource
:
UriComponents
):
Promise
<
[
string
,
FileType
][]
>
{
return
this
.
provider
.
readdir
(
URI
.
fro
m
(
resource
));
return
this
.
provider
.
readdir
(
this
.
transfor
m
(
resource
));
}
private
async
rename
(
resource
:
UriComponents
,
target
:
UriComponents
,
opts
:
FileOverwriteOptions
):
Promise
<
void
>
{
return
this
.
provider
.
rename
(
URI
.
fro
m
(
resource
),
URI
.
from
(
target
),
opts
);
return
this
.
provider
.
rename
(
this
.
transfor
m
(
resource
),
URI
.
from
(
target
),
opts
);
}
private
copy
(
resource
:
UriComponents
,
target
:
UriComponents
,
opts
:
FileOverwriteOptions
):
Promise
<
void
>
{
return
this
.
provider
.
copy
(
URI
.
fro
m
(
resource
),
URI
.
from
(
target
),
opts
);
return
this
.
provider
.
copy
(
this
.
transfor
m
(
resource
),
URI
.
from
(
target
),
opts
);
}
private
async
watch
(
session
:
string
,
req
:
number
,
resource
:
UriComponents
,
opts
:
IWatchOptions
):
Promise
<
void
>
{
this
.
watchers
.
get
(
session
)
!
.
_watch
(
req
,
URI
.
fro
m
(
resource
),
opts
);
this
.
watchers
.
get
(
session
)
!
.
_watch
(
req
,
this
.
transfor
m
(
resource
),
opts
);
}
private
async
unwatch
(
session
:
string
,
req
:
number
):
Promise
<
void
>
{
this
.
watchers
.
get
(
session
)
!
.
unwatch
(
req
);
}
private
transform
(
resource
:
UriComponents
):
URI
{
// HACK: for now assume /out is relative to the build.
if
(
resource
.
path
.
indexOf
(
"
/out
"
)
===
0
)
{
resource
.
path
=
this
.
environmentService
.
appRoot
+
resource
.
path
;
}
return
URI
.
from
(
resource
);
}
}
/**
...
...
src/server.ts
浏览文件 @
e22791ec
...
...
@@ -402,7 +402,7 @@ export class MainServer extends Server {
instantiationService
.
invokeFunction
(()
=>
{
instantiationService
.
createInstance
(
LogsDataCleaner
);
this
.
ipc
.
registerChannel
(
REMOTE_FILE_SYSTEM_CHANNEL_NAME
,
new
FileProviderChannel
(
logService
));
this
.
ipc
.
registerChannel
(
REMOTE_FILE_SYSTEM_CHANNEL_NAME
,
new
FileProviderChannel
(
environmentService
,
logService
));
this
.
ipc
.
registerChannel
(
"
remoteextensionsenvironment
"
,
new
ExtensionEnvironmentChannel
(
environmentService
,
logService
));
const
extensionsService
=
this
.
services
.
get
(
IExtensionManagementService
)
as
IExtensionManagementService
;
const
extensionsChannel
=
new
ExtensionManagementChannel
(
extensionsService
,
(
context
)
=>
getUriTransformer
(
context
.
remoteAuthority
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录