Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
ae020234
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
ae020234
编写于
3月 15, 2021
作者:
J
Joe Previte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(lib/vscode): register LogLevelChannel
上级
050a1bb1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
53 deletion
+28
-53
lib/vscode/src/vs/base/node/languagePacks.js
lib/vscode/src/vs/base/node/languagePacks.js
+0
-44
lib/vscode/src/vs/server/node/channel.ts
lib/vscode/src/vs/server/node/channel.ts
+6
-1
lib/vscode/src/vs/server/node/server.ts
lib/vscode/src/vs/server/node/server.ts
+11
-5
lib/vscode/src/vs/workbench/services/localizations/electron-sandbox/localizationsService.ts
...es/localizations/electron-sandbox/localizationsService.ts
+11
-3
未找到文件。
lib/vscode/src/vs/base/node/languagePacks.js
浏览文件 @
ae020234
...
...
@@ -71,50 +71,6 @@
* @returns {object}
*/
function
getLanguagePackConfigurations
(
userDataPath
)
{
const
configFile
=
path
.
join
(
userDataPath
,
'
languagepacks.json
'
);
try
{
return
nodeRequire
(
configFile
);
}
catch
(
err
)
{
// Do nothing. If we can't read the file we have no
// language pack config.
}
}
function
readFile
(
file
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
readFile
(
file
,
'
utf8
'
,
function
(
err
,
data
)
{
if
(
err
)
{
reject
(
err
);
return
;
}
resolve
(
data
);
});
});
}
/**
* @param {string} file
* @param {string} content
* @returns {Promise<void>}
*/
function
writeFile
(
file
,
content
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
file
,
content
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
{
reject
(
err
);
return
;
}
resolve
();
});
});
}
/**
* @param {string} userDataPath
* @returns {object}
*/
function
getLanguagePackConfigurations
(
userDataPath
)
{
const
configFile
=
path
.
join
(
userDataPath
,
'
languagepacks.json
'
);
try
{
// NOTE@coder: Swapped require with readFile since require is cached and
...
...
lib/vscode/src/vs/server/node/channel.ts
浏览文件 @
ae020234
...
...
@@ -330,6 +330,11 @@ export class ExtensionEnvironmentChannel implements IServerChannel {
}
}
/*
NOTE@coder:
Reference: - ../../workbench/api/common/extHostDebugService.ts
3/16/21 jsjoeio
*/
class
VariableResolverService
extends
AbstractVariableResolverService
{
constructor
(
remoteAuthority
:
string
,
...
...
@@ -355,7 +360,7 @@ class VariableResolverService extends AbstractVariableResolverService {
NOTE@coder: not sure where we could get this from. This is new.
@jsjoeio 3/11/21
*/
return
undefined
;
return
(
args
.
resolverEnv
&&
args
.
resolverEnv
[
'
VSCODE_CWD
'
])
||
env
[
'
VSCODE_CWD
'
]
||
process
.
cwd
()
;
},
getExecPath
:
():
string
|
undefined
=>
{
// Assuming that resolverEnv is just for use in the resolver and not for
...
...
lib/vscode/src/vs/server/node/server.ts
浏览文件 @
ae020234
...
...
@@ -29,7 +29,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
import
{
ILocalizationsService
}
from
'
vs/platform/localizations/common/localizations
'
;
import
{
LocalizationsService
}
from
'
vs/platform/localizations/node/localizations
'
;
import
{
ConsoleLogger
,
getLogLevel
,
ILoggerService
,
ILogService
,
MultiplexLogService
}
from
'
vs/platform/log/common/log
'
;
import
{
Log
ger
Channel
}
from
'
vs/platform/log/common/logIpc
'
;
import
{
Log
Level
Channel
}
from
'
vs/platform/log/common/logIpc
'
;
import
{
LoggerService
}
from
'
vs/platform/log/node/loggerService
'
;
import
{
SpdLogLogger
}
from
'
vs/platform/log/node/spdlogLog
'
;
import
product
from
'
vs/platform/product/common/product
'
;
...
...
@@ -214,7 +214,7 @@ export class Vscode {
private
async
initializeServices
(
args
:
NativeParsedArgs
):
Promise
<
void
>
{
/*
NOTE@coder: this initializeServices is loosely based off this file:
https://github.com/cdr/code-server/blob/main/lib/vscode/src/vs/code
/electron-browser/sharedProcess/sharedProcessMain.ts#L148
Reference: - ../..
/electron-browser/sharedProcess/sharedProcessMain.ts#L148
If upstream changes cause conflicts, look there ^.
3/11/21 @jsjoeio
...
...
@@ -224,7 +224,7 @@ export class Vscode {
fs
.
mkdirSync
(
environmentService
.
globalStorageHome
.
fsPath
,
{
recursive
:
true
});
/*
NOTE@coder: Made these updates on based on this file (and lines):
https://github.com/cdr/code-server/blob/main/lib/vscode/src/vs/code
/electron-browser/sharedProcess/sharedProcessMain.ts#L144-L149
Reference: - ../..
/electron-browser/sharedProcess/sharedProcessMain.ts#L144-L149
More details (from @code-asher):
I think the logLevel channel is only used in the electron version of vscode so we can probably skip it.
...
...
@@ -234,7 +234,7 @@ export class Vscode {
*/
const
logService
=
new
MultiplexLogService
([
new
ConsoleLogger
(
getLogLevel
(
environmentService
)),
new
SpdLogLogger
(
RemoteExtensionLogFileName
,
path
.
join
(
environmentService
.
logsPath
,
'
server.log
'
),
false
,
getLogLevel
(
environmentService
))
new
SpdLogLogger
(
RemoteExtensionLogFileName
,
path
.
join
(
environmentService
.
logsPath
,
`
${
RemoteExtensionLogFileName
}
.log`
),
false
,
getLogLevel
(
environmentService
))
]);
const
fileService
=
new
FileService
(
logService
);
fileService
.
registerProvider
(
Schemas
.
file
,
new
DiskFileSystemProvider
(
logService
));
...
...
@@ -250,7 +250,13 @@ export class Vscode {
...
environmentService
.
extraBuiltinExtensionPaths
,
];
this
.
ipc
.
registerChannel
(
'
logger
'
,
new
LoggerChannel
(
loggerService
));
/*
NOTE@coder: we changed this channel registration from LogLevel to LogLevelChannel
because it changed upstream.
3/15/21 jsjoeio
*/
this
.
ipc
.
registerChannel
(
'
logger
'
,
new
LogLevelChannel
(
logService
));
this
.
ipc
.
registerChannel
(
ExtensionHostDebugBroadcastChannel
.
ChannelName
,
new
ExtensionHostDebugBroadcastChannel
());
this
.
services
.
set
(
ILogService
,
logService
);
...
...
lib/vscode/src/vs/workbench/services/localizations/electron-sandbox/localizationsService.ts
浏览文件 @
ae020234
...
...
@@ -5,8 +5,8 @@
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ILocalizationsService
}
from
'
vs/platform/localizations/common/localizations
'
;
import
{
ISharedProcessService
}
from
'
vs/platform/ipc/electron-sandbox/services
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IRemoteAgentService
}
from
'
../../remote/common/remoteAgentService
'
;
// @ts-ignore: interface is implemented via proxy
export
class
LocalizationsService
implements
ILocalizationsService
{
...
...
@@ -14,9 +14,17 @@ export class LocalizationsService implements ILocalizationsService {
declare
readonly
_serviceBrand
:
undefined
;
constructor
(
@
I
SharedProcessService
sharedProcessService
:
ISharedProcess
Service
,
@
I
RemoteAgentService
remoteAgentService
:
IRemoteAgent
Service
,
)
{
return
ProxyChannel
.
toService
<
ILocalizationsService
>
(
sharedProcessService
.
getChannel
(
'
localizations
'
));
/*
NOTE@coder:
Upstream, they use the ISharedProcessService.
We run this on the browser where there is no shared process so it needs to connect
to the localization channel through the remote agent.
3/16/21 jsjoeio code-asher
*/
return
ProxyChannel
.
toService
<
ILocalizationsService
>
(
remoteAgentService
.
getConnection
()
!
.
getChannel
(
'
localizations
'
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录