Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
5baf1662
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,发现更多精彩内容 >>
未验证
提交
5baf1662
编写于
2月 07, 2020
作者:
A
Asher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix VS Code product configuration not loading
上级
25641900
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
30 addition
and
56 deletion
+30
-56
scripts/build.ts
scripts/build.ts
+23
-48
scripts/vscode.patch
scripts/vscode.patch
+6
-7
src/node/vscode/workbench-build.html
src/node/vscode/workbench-build.html
+1
-1
未找到文件。
scripts/build.ts
浏览文件 @
5baf1662
...
@@ -172,21 +172,9 @@ class Builder {
...
@@ -172,21 +172,9 @@ class Builder {
])
])
})
})
await
this
.
copyDependencies
(
"
code-server
"
,
this
.
rootPath
,
this
.
buildPath
)
await
this
.
copyDependencies
(
"
code-server
"
,
this
.
rootPath
,
this
.
buildPath
,
{
await
this
.
task
(
"
writing final code-server package.json
"
,
async
()
=>
{
const
json
=
JSON
.
parse
(
await
fs
.
readFile
(
path
.
join
(
this
.
buildPath
,
"
package.json
"
),
"
utf8
"
))
return
fs
.
writeFile
(
path
.
join
(
this
.
buildPath
,
"
package.json
"
),
JSON
.
stringify
(
{
...
json
,
commit
,
commit
,
},
version
:
process
.
env
.
VERSION
,
null
,
2
)
)
})
})
}
}
...
@@ -214,34 +202,6 @@ class Builder {
...
@@ -214,34 +202,6 @@ class Builder {
})
})
}
}
const
{
productJson
,
packageJson
}
=
await
this
.
task
(
"
generating vs code product configuration
"
,
async
()
=>
{
const
merge
=
async
(
name
:
string
,
json
:
{
[
key
:
string
]:
string
}
=
{}):
Promise
<
{
[
key
:
string
]:
string
}
>
=>
{
return
{
...
JSON
.
parse
(
await
fs
.
readFile
(
path
.
join
(
this
.
vscodeSourcePath
,
`
${
name
}
.json`
),
"
utf8
"
)),
...
json
,
}
}
const
date
=
new
Date
().
toISOString
()
const
[
packageJson
,
productJson
]
=
await
Promise
.
all
([
merge
(
"
package
"
,
{}),
merge
(
"
product
"
,
{
commit
,
date
})])
return
{
productJson
,
packageJson
}
})
await
this
.
task
(
"
inserting vs code product configuration
"
,
async
()
=>
{
const
filePath
=
path
.
join
(
this
.
vscodeSourcePath
,
"
out-build/vs/platform/product/common/product.js
"
)
return
fs
.
writeFile
(
filePath
,
(
await
fs
.
readFile
(
filePath
,
"
utf8
"
)).
replace
(
"
{ /*BUILD->INSERT_PRODUCT_CONFIGURATION*/}
"
,
JSON
.
stringify
({
version
:
packageJson
.
version
,
...
productJson
,
})
)
)
})
const
vscodeBuildPath
=
path
.
join
(
this
.
buildPath
,
"
lib/vscode
"
)
const
vscodeBuildPath
=
path
.
join
(
this
.
buildPath
,
"
lib/vscode
"
)
await
this
.
task
(
"
copying vs code into build directory
"
,
async
()
=>
{
await
this
.
task
(
"
copying vs code into build directory
"
,
async
()
=>
{
await
fs
.
mkdirp
(
vscodeBuildPath
)
await
fs
.
mkdirp
(
vscodeBuildPath
)
...
@@ -254,14 +214,13 @@ class Builder {
...
@@ -254,14 +214,13 @@ class Builder {
])
])
})
})
await
this
.
copyDependencies
(
"
vs code
"
,
this
.
vscodeSourcePath
,
vscodeBuildPath
)
await
this
.
copyDependencies
(
"
vs code
"
,
this
.
vscodeSourcePath
,
vscodeBuildPath
,
{
commit
,
await
this
.
task
(
"
writing final vs code product.json
"
,
()
=>
{
date
:
new
Date
().
toISOString
(),
return
fs
.
writeFile
(
path
.
join
(
vscodeBuildPath
,
"
product.json
"
),
JSON
.
stringify
(
productJson
,
null
,
2
))
})
})
}
}
private
async
copyDependencies
(
name
:
string
,
sourcePath
:
string
,
buildPath
:
string
):
Promise
<
void
>
{
private
async
copyDependencies
(
name
:
string
,
sourcePath
:
string
,
buildPath
:
string
,
merge
:
object
):
Promise
<
void
>
{
await
this
.
task
(
`copying
${
name
}
dependencies`
,
async
()
=>
{
await
this
.
task
(
`copying
${
name
}
dependencies`
,
async
()
=>
{
return
Promise
.
all
(
return
Promise
.
all
(
[
"
node_modules
"
,
"
package.json
"
,
"
yarn.lock
"
].
map
((
fileName
)
=>
{
[
"
node_modules
"
,
"
package.json
"
,
"
yarn.lock
"
].
map
((
fileName
)
=>
{
...
@@ -270,6 +229,22 @@ class Builder {
...
@@ -270,6 +229,22 @@ class Builder {
)
)
})
})
const
fileName
=
name
===
"
code-server
"
?
"
package
"
:
"
product
"
await
this
.
task
(
`writing final
${
name
}
${
fileName
}
.json`
,
async
()
=>
{
const
json
=
JSON
.
parse
(
await
fs
.
readFile
(
path
.
join
(
sourcePath
,
`
${
fileName
}
.json`
),
"
utf8
"
))
return
fs
.
writeFile
(
path
.
join
(
buildPath
,
`
${
fileName
}
.json`
),
JSON
.
stringify
(
{
...
json
,
...
merge
,
},
null
,
2
)
)
})
if
(
process
.
env
.
MINIFY
)
{
if
(
process
.
env
.
MINIFY
)
{
await
this
.
task
(
`restricting
${
name
}
to production dependencies`
,
async
()
=>
{
await
this
.
task
(
`restricting
${
name
}
to production dependencies`
,
async
()
=>
{
return
util
.
promisify
(
cp
.
exec
)(
"
yarn --production --ignore-scripts
"
,
{
cwd
:
buildPath
})
return
util
.
promisify
(
cp
.
exec
)(
"
yarn --production --ignore-scripts
"
,
{
cwd
:
buildPath
})
...
...
scripts/vscode.patch
浏览文件 @
5baf1662
...
@@ -2108,10 +2108,10 @@ index 0000000000..3c74512192
...
@@ -2108,10 +2108,10 @@ index 0000000000..3c74512192
+}
+}
diff --git a/src/vs/server/node/server.ts b/src/vs/server/node/server.ts
diff --git a/src/vs/server/node/server.ts b/src/vs/server/node/server.ts
new file mode 100644
new file mode 100644
index 0000000000..
81d275a80a
index 0000000000..
ac6bbc8e98
--- /dev/null
--- /dev/null
+++ b/src/vs/server/node/server.ts
+++ b/src/vs/server/node/server.ts
@@ -0,0 +1,25
3
@@
@@ -0,0 +1,25
2
@@
+import * as net from 'net';
+import * as net from 'net';
+import * as path from 'path';
+import * as path from 'path';
+import { Emitter } from 'vs/base/common/event';
+import { Emitter } from 'vs/base/common/event';
...
@@ -2161,6 +2161,7 @@ index 0000000000..81d275a80a
...
@@ -2161,6 +2161,7 @@ index 0000000000..81d275a80a
+import { ExtensionEnvironmentChannel, FileProviderChannel, NodeProxyService } from 'vs/server/node/channel';
+import { ExtensionEnvironmentChannel, FileProviderChannel, NodeProxyService } from 'vs/server/node/channel';
+import { Connection, ExtensionHostConnection, ManagementConnection } from 'vs/server/node/connection';
+import { Connection, ExtensionHostConnection, ManagementConnection } from 'vs/server/node/connection';
+import { TelemetryClient } from 'vs/server/node/insights';
+import { TelemetryClient } from 'vs/server/node/insights';
+import { logger } from 'vs/server/node/logger';
+import { getLocaleFromConfig, getNlsConfiguration } from 'vs/server/node/nls';
+import { getLocaleFromConfig, getNlsConfiguration } from 'vs/server/node/nls';
+import { Protocol } from 'vs/server/node/protocol';
+import { Protocol } from 'vs/server/node/protocol';
+import { getUriTransformer } from 'vs/server/node/util';
+import { getUriTransformer } from 'vs/server/node/util';
...
@@ -2193,11 +2194,9 @@ index 0000000000..81d275a80a
...
@@ -2193,11 +2194,9 @@ index 0000000000..81d275a80a
+ logLevel: getLogLevel(environment),
+ logLevel: getLogLevel(environment),
+ },
+ },
+ remoteUserDataUri: transformer.transformOutgoing(URI.file(environment.userDataPath)),
+ remoteUserDataUri: transformer.transformOutgoing(URI.file(environment.userDataPath)),
+ productConfiguration: {
+ productConfiguration: product,
+ extensionsGallery: product.extensionsGallery,
+ },
+ nlsConfiguration: await getNlsConfiguration(environment.args.locale || await getLocaleFromConfig(environment.userDataPath), environment.userDataPath),
+ nlsConfiguration: await getNlsConfiguration(environment.args.locale || await getLocaleFromConfig(environment.userDataPath), environment.userDataPath),
+ commit: product.commit || '',
+ commit: product.commit || '
development
',
+ };
+ };
+ }
+ }
+
+
...
@@ -2222,7 +2221,7 @@ index 0000000000..81d275a80a
...
@@ -2222,7 +2221,7 @@ index 0000000000..81d275a80a
+
+
+ private async connect(message: ConnectionTypeRequest, protocol: Protocol): Promise<void> {
+ private async connect(message: ConnectionTypeRequest, protocol: Protocol): Promise<void> {
+ if (product.commit && message.commit !== product.commit) {
+ if (product.commit && message.commit !== product.commit) {
+
throw new Error
(`Version mismatch (${message.commit} instead of ${product.commit})`);
+
logger.warn
(`Version mismatch (${message.commit} instead of ${product.commit})`);
+ }
+ }
+
+
+ switch (message.desiredConnectionType) {
+ switch (message.desiredConnectionType) {
...
...
src/node/vscode/workbench-build.html
浏览文件 @
5baf1662
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<!-- Workbench Icon/Manifest/CSS -->
<!-- Workbench Icon/Manifest/CSS -->
<link
rel=
"icon"
href=
"../static-{{COMMIT}}/src/browser/media/favicon.ico"
type=
"image/x-icon"
/>
<link
rel=
"icon"
href=
"../static-{{COMMIT}}/src/browser/media/favicon.ico"
type=
"image/x-icon"
/>
<link
rel=
"manifest"
href=
"../static-{{COMMIT}}/src/browser/media/manifest.json"
crossorigin=
"use-credentials"
>
<link
rel=
"manifest"
href=
"../static-{{COMMIT}}/src/browser/media/manifest.json"
crossorigin=
"use-credentials"
>
<link
data-name=
"vs/workbench/workbench.web.api"
rel=
"stylesheet"
href=
".
.
/static-{{COMMIT}}/out/vs/workbench/workbench.web.api.css"
>
<link
data-name=
"vs/workbench/workbench.web.api"
rel=
"stylesheet"
href=
"./static-{{COMMIT}}/out/vs/workbench/workbench.web.api.css"
>
<link
rel=
"apple-touch-icon"
href=
"../static-{{COMMIT}}/src/browser/media/code-server.png"
/>
<link
rel=
"apple-touch-icon"
href=
"../static-{{COMMIT}}/src/browser/media/code-server.png"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录