Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
a20fa4a9
C
code-server
项目概览
gzupanda
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
未验证
提交
a20fa4a9
编写于
7月 08, 2019
作者:
A
Asher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implement extensions channel
上级
f51751ad
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
20 deletion
+51
-20
README.md
README.md
+1
-0
channel.ts
channel.ts
+6
-1
scripts/tasks.bash
scripts/tasks.bash
+2
-2
server.ts
server.ts
+42
-17
未找到文件。
README.md
浏览文件 @
a20fa4a9
...
@@ -55,6 +55,7 @@ How to [secure your setup](/doc/security/ssl.md).
...
@@ -55,6 +55,7 @@ How to [secure your setup](/doc/security/ssl.md).
export OUT=/path/to/some/directory`
. Otherwise it will build in this
export OUT=/path/to/some/directory`
. Otherwise it will build in this
directory which will cause issues because then
`yarn watch`
will try to
directory which will cause issues because then
`yarn watch`
will try to
compile the build directory as well.
compile the build directory as well.
-
For now
`@coder/nbin`
is a global dependency.
-
Run
`yarn build ${vscodeVersion} ${target} ${arch}`
in this directory (for example:
-
Run
`yarn build ${vscodeVersion} ${target} ${arch}`
in this directory (for example:
`yarn build 1.35.0 linux x64`
).
`yarn build 1.35.0 linux x64`
).
...
...
channel.ts
浏览文件 @
a20fa4a9
...
@@ -44,7 +44,7 @@ class Watcher extends DiskFileSystemProvider {
...
@@ -44,7 +44,7 @@ class Watcher extends DiskFileSystemProvider {
/**
/**
* See: src/vs/platform/remote/common/remoteAgentFileSystemChannel.ts.
* See: src/vs/platform/remote/common/remoteAgentFileSystemChannel.ts.
*/
*/
export
class
FileProviderChannel
implements
IServerChannel
{
export
class
FileProviderChannel
implements
IServerChannel
,
IDisposable
{
private
readonly
provider
:
DiskFileSystemProvider
;
private
readonly
provider
:
DiskFileSystemProvider
;
private
readonly
watchers
=
new
Map
<
string
,
Watcher
>
();
private
readonly
watchers
=
new
Map
<
string
,
Watcher
>
();
...
@@ -106,6 +106,11 @@ export class FileProviderChannel implements IServerChannel {
...
@@ -106,6 +106,11 @@ export class FileProviderChannel implements IServerChannel {
throw
new
Error
(
`Invalid call "
${
command
}
"`
);
throw
new
Error
(
`Invalid call "
${
command
}
"`
);
}
}
public
dispose
():
void
{
this
.
watchers
.
forEach
((
w
)
=>
w
.
dispose
());
this
.
watchers
.
clear
();
}
private
async
stat
(
resource
:
UriComponents
):
Promise
<
IStat
>
{
private
async
stat
(
resource
:
UriComponents
):
Promise
<
IStat
>
{
return
this
.
provider
.
stat
(
URI
.
from
(
resource
));
return
this
.
provider
.
stat
(
URI
.
from
(
resource
));
}
}
...
...
scripts/tasks.bash
浏览文件 @
a20fa4a9
...
@@ -200,11 +200,11 @@ function package-task() {
...
@@ -200,11 +200,11 @@ function package-task() {
cd
"
${
releasePath
}
"
cd
"
${
releasePath
}
"
if
[[
"
${
target
}
"
==
"linux"
]]
;
then
if
[[
"
${
target
}
"
==
"linux"
]]
;
then
tar
-czf
"
${
archiveName
}
.tar.gz"
"
${
archiveName
}
"
tar
-czf
"
${
archiveName
}
.tar.gz"
"
${
archiveName
}
"
log
"Archive:
${
archivePath
}
.tar.gz"
else
else
zip
-r
"
${
archiveName
}
.zip"
"
${
archiveName
}
"
zip
-r
"
${
archiveName
}
.zip"
"
${
archiveName
}
"
log
"Archive:
${
archivePath
}
.zip"
fi
fi
log
"Archive:
${
archivePath
}
"
}
}
# Package built code into a binary.
# Package built code into a binary.
...
...
server.ts
浏览文件 @
a20fa4a9
...
@@ -10,12 +10,25 @@ import { sanitizeFilePath } from "vs/base/common/extpath";
...
@@ -10,12 +10,25 @@ import { sanitizeFilePath } from "vs/base/common/extpath";
import
{
getMediaMime
}
from
"
vs/base/common/mime
"
;
import
{
getMediaMime
}
from
"
vs/base/common/mime
"
;
import
{
extname
}
from
"
vs/base/common/path
"
;
import
{
extname
}
from
"
vs/base/common/path
"
;
import
{
UriComponents
,
URI
}
from
"
vs/base/common/uri
"
;
import
{
UriComponents
,
URI
}
from
"
vs/base/common/uri
"
;
import
{
IPCServer
,
ClientConnectionEvent
}
from
"
vs/base/parts/ipc/common/ipc
"
;
import
{
IPCServer
,
ClientConnectionEvent
,
StaticRouter
}
from
"
vs/base/parts/ipc/common/ipc
"
;
import
{
LogsDataCleaner
}
from
"
vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner
"
;
import
{
LogsDataCleaner
}
from
"
vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner
"
;
import
{
IConfigurationService
}
from
"
vs/platform/configuration/common/configuration
"
;
import
{
ConfigurationService
}
from
"
vs/platform/configuration/node/configurationService
"
;
import
{
IDialogService
}
from
"
vs/platform/dialogs/common/dialogs
"
;
import
{
DialogChannelClient
}
from
"
vs/platform/dialogs/node/dialogIpc
"
;
import
{
IDownloadService
}
from
"
vs/platform/download/common/download
"
;
import
{
DownloadServiceChannelClient
}
from
"
vs/platform/download/node/downloadIpc
"
;
import
{
IEnvironmentService
,
ParsedArgs
}
from
"
vs/platform/environment/common/environment
"
;
import
{
IEnvironmentService
,
ParsedArgs
}
from
"
vs/platform/environment/common/environment
"
;
import
{
EnvironmentService
}
from
"
vs/platform/environment/node/environmentService
"
;
import
{
EnvironmentService
}
from
"
vs/platform/environment/node/environmentService
"
;
import
{
IExtensionManagementService
,
IExtensionGalleryService
}
from
"
vs/platform/extensionManagement/common/extensionManagement
"
;
import
{
ExtensionGalleryService
}
from
"
vs/platform/extensionManagement/node/extensionGalleryService
"
;
import
{
ExtensionManagementChannel
}
from
"
vs/platform/extensionManagement/node/extensionManagementIpc
"
;
import
{
ExtensionManagementService
}
from
"
vs/platform/extensionManagement/node/extensionManagementService
"
;
import
{
SyncDescriptor
}
from
"
vs/platform/instantiation/common/descriptors
"
;
import
{
InstantiationService
}
from
"
vs/platform/instantiation/common/instantiationService
"
;
import
{
InstantiationService
}
from
"
vs/platform/instantiation/common/instantiationService
"
;
import
{
ServiceCollection
}
from
"
vs/platform/instantiation/common/serviceCollection
"
;
import
{
ServiceCollection
}
from
"
vs/platform/instantiation/common/serviceCollection
"
;
import
{
ILocalizationsService
}
from
"
vs/platform/localizations/common/localizations
"
;
import
{
LocalizationsService
}
from
"
vs/platform/localizations/node/localizations
"
;
import
{
getLogLevel
,
ILogService
}
from
"
vs/platform/log/common/log
"
;
import
{
getLogLevel
,
ILogService
}
from
"
vs/platform/log/common/log
"
;
import
{
LogLevelSetterChannel
}
from
"
vs/platform/log/common/logIpc
"
;
import
{
LogLevelSetterChannel
}
from
"
vs/platform/log/common/logIpc
"
;
import
{
SpdLogService
}
from
"
vs/platform/log/node/spdlogService
"
;
import
{
SpdLogService
}
from
"
vs/platform/log/node/spdlogService
"
;
...
@@ -23,7 +36,12 @@ import { IProductConfiguration } from "vs/platform/product/common/product";
...
@@ -23,7 +36,12 @@ import { IProductConfiguration } from "vs/platform/product/common/product";
import
product
from
"
vs/platform/product/node/product
"
;
import
product
from
"
vs/platform/product/node/product
"
;
import
{
ConnectionType
,
ConnectionTypeRequest
}
from
"
vs/platform/remote/common/remoteAgentConnection
"
;
import
{
ConnectionType
,
ConnectionTypeRequest
}
from
"
vs/platform/remote/common/remoteAgentConnection
"
;
import
{
REMOTE_FILE_SYSTEM_CHANNEL_NAME
}
from
"
vs/platform/remote/common/remoteAgentFileSystemChannel
"
;
import
{
REMOTE_FILE_SYSTEM_CHANNEL_NAME
}
from
"
vs/platform/remote/common/remoteAgentFileSystemChannel
"
;
import
{
IRequestService
}
from
"
vs/platform/request/node/request
"
;
import
{
RequestService
}
from
"
vs/platform/request/node/requestService
"
;
import
{
ITelemetryService
}
from
"
vs/platform/telemetry/common/telemetry
"
;
import
{
NullTelemetryService
}
from
"
vs/platform/telemetry/common/telemetryUtils
"
;
import
{
RemoteExtensionLogFileName
}
from
"
vs/workbench/services/remote/common/remoteAgentService
"
;
import
{
RemoteExtensionLogFileName
}
from
"
vs/workbench/services/remote/common/remoteAgentService
"
;
// import { TelemetryService } from "vs/workbench/services/telemetry/electron-browser/telemetryService";
import
{
IWorkbenchConstructionOptions
}
from
"
vs/workbench/workbench.web.api
"
;
import
{
IWorkbenchConstructionOptions
}
from
"
vs/workbench/workbench.web.api
"
;
import
{
Connection
,
ManagementConnection
,
ExtensionHostConnection
}
from
"
vs/server/connection
"
;
import
{
Connection
,
ManagementConnection
,
ExtensionHostConnection
}
from
"
vs/server/connection
"
;
...
@@ -141,28 +159,35 @@ export class MainServer extends Server {
...
@@ -141,28 +159,35 @@ export class MainServer extends Server {
});
});
const
environmentService
=
new
EnvironmentService
(
args
,
process
.
execPath
);
const
environmentService
=
new
EnvironmentService
(
args
,
process
.
execPath
);
this
.
services
.
set
(
IEnvironmentService
,
environmentService
);
const
logService
=
new
SpdLogService
(
RemoteExtensionLogFileName
,
environmentService
.
logsPath
,
getLogLevel
(
environmentService
));
this
.
ipc
.
registerChannel
(
"
loglevel
"
,
new
LogLevelSetterChannel
(
logService
));
const
logService
=
new
SpdLogService
(
const
router
=
new
StaticRouter
((
context
:
any
)
=>
{
RemoteExtensionLogFileName
,
console
.
log
(
"
static router
"
,
context
);
environmentService
.
logsPath
,
return
context
.
clientId
===
"
renderer
"
;
getLogLevel
(
environmentService
),
});
);
this
.
services
.
set
(
ILogService
,
logService
);
this
.
ipc
.
registerChannel
(
"
loglevel
"
,
new
LogLevelSetterChannel
(
logService
));
this
.
services
.
set
(
ILogService
,
logService
);
this
.
services
.
set
(
IEnvironmentService
,
environmentService
);
this
.
services
.
set
(
IConfigurationService
,
new
SyncDescriptor
(
ConfigurationService
,
[
environmentService
.
machineSettingsResource
]));
this
.
services
.
set
(
IRequestService
,
new
SyncDescriptor
(
RequestService
));
this
.
services
.
set
(
IExtensionGalleryService
,
new
SyncDescriptor
(
ExtensionGalleryService
));
this
.
services
.
set
(
ITelemetryService
,
NullTelemetryService
);
// TODO: telemetry
this
.
services
.
set
(
IDialogService
,
new
DialogChannelClient
(
this
.
ipc
.
getChannel
(
"
dialog
"
,
router
)));
this
.
services
.
set
(
IDownloadService
,
new
DownloadServiceChannelClient
(
this
.
ipc
.
getChannel
(
"
download
"
,
router
),
()
=>
getUriTransformer
(
"
renderer
"
)));
this
.
services
.
set
(
IExtensionManagementService
,
new
SyncDescriptor
(
ExtensionManagementService
));
const
instantiationService
=
new
InstantiationService
(
this
.
services
);
const
instantiationService
=
new
InstantiationService
(
this
.
services
);
this
.
services
.
set
(
ILocalizationsService
,
instantiationService
.
createInstance
(
LocalizationsService
));
instantiationService
.
invokeFunction
(()
=>
{
instantiationService
.
invokeFunction
(()
=>
{
instantiationService
.
createInstance
(
LogsDataCleaner
);
instantiationService
.
createInstance
(
LogsDataCleaner
);
this
.
ipc
.
registerChannel
(
this
.
ipc
.
registerChannel
(
REMOTE_FILE_SYSTEM_CHANNEL_NAME
,
new
FileProviderChannel
(
logService
));
REMOTE_FILE_SYSTEM_CHANNEL_NAME
,
this
.
ipc
.
registerChannel
(
"
remoteextensionsenvironment
"
,
new
ExtensionEnvironmentChannel
(
environmentService
,
logService
));
new
FileProviderChannel
(
logService
),
const
extensionsService
=
this
.
services
.
get
(
IExtensionManagementService
)
as
IExtensionManagementService
;
);
const
extensionsChannel
=
new
ExtensionManagementChannel
(
extensionsService
,
(
context
)
=>
getUriTransformer
(
context
.
remoteAuthority
));
this
.
ipc
.
registerChannel
(
this
.
ipc
.
registerChannel
(
"
extensions
"
,
extensionsChannel
);
"
remoteextensionsenvironment
"
,
new
ExtensionEnvironmentChannel
(
environmentService
,
logService
),
);
});
});
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录