Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
849d9417
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
849d9417
编写于
3月 05, 2019
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[json] fetch http and https schemas on the ext host
上级
c6315a3d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
97 addition
and
9 deletion
+97
-9
extensions/json-language-features/client/src/jsonMain.ts
extensions/json-language-features/client/src/jsonMain.ts
+19
-5
extensions/json-language-features/extension.webpack.config.js
...nsions/json-language-features/extension.webpack.config.js
+6
-1
extensions/json-language-features/package.json
extensions/json-language-features/package.json
+2
-1
extensions/json-language-features/server/extension.webpack.config.js
...json-language-features/server/extension.webpack.config.js
+2
-2
extensions/json-language-features/yarn.lock
extensions/json-language-features/yarn.lock
+68
-0
未找到文件。
extensions/json-language-features/client/src/jsonMain.ts
浏览文件 @
849d9417
...
...
@@ -6,6 +6,8 @@
import
*
as
path
from
'
path
'
;
import
*
as
fs
from
'
fs
'
;
import
*
as
nls
from
'
vscode-nls
'
;
import
{
xhr
,
XHRResponse
,
getErrorStatusDescription
}
from
'
request-light
'
;
const
localize
=
nls
.
loadMessageBundle
();
import
{
workspace
,
window
,
languages
,
commands
,
ExtensionContext
,
extensions
,
Uri
,
LanguageConfiguration
,
Diagnostic
,
StatusBarAlignment
,
TextEditor
,
TextDocument
,
Position
,
SelectionRange
}
from
'
vscode
'
;
...
...
@@ -93,6 +95,9 @@ export function activate(context: ExtensionContext) {
let
clientOptions
:
LanguageClientOptions
=
{
// Register the server for json documents
documentSelector
,
initializationOptions
:
{
handledSchemaProtocols
:
[
'
file
'
]
// language server only loads file-URI. Fetching schemas with other protocols ('http'...) are made on the client.
},
synchronize
:
{
// Synchronize the setting section 'json' to the server
configurationSection
:
[
'
json
'
,
'
http
'
],
...
...
@@ -138,11 +143,20 @@ export function activate(context: ExtensionContext) {
// handle content request
client
.
onRequest
(
VSCodeContentRequest
.
type
,
(
uriPath
:
string
)
=>
{
let
uri
=
Uri
.
parse
(
uriPath
);
return
workspace
.
openTextDocument
(
uri
).
then
(
doc
=>
{
return
doc
.
getText
();
},
error
=>
{
return
Promise
.
reject
(
error
);
});
if
(
uri
.
scheme
!==
'
http
'
&&
uri
.
scheme
!==
'
https
'
)
{
return
workspace
.
openTextDocument
(
uri
).
then
(
doc
=>
{
return
doc
.
getText
();
},
error
=>
{
return
Promise
.
reject
(
error
);
});
}
else
{
const
headers
=
{
'
Accept-Encoding
'
:
'
gzip, deflate
'
};
return
xhr
({
url
:
uriPath
,
followRedirects
:
5
,
headers
}).
then
(
response
=>
{
return
response
.
responseText
;
},
(
error
:
XHRResponse
)
=>
{
return
Promise
.
reject
(
error
.
responseText
||
getErrorStatusDescription
(
error
.
status
)
||
error
.
toString
());
});
}
});
let
handleContentChange
=
(
uri
:
Uri
)
=>
{
...
...
extensions/json-language-features/extension.webpack.config.js
浏览文件 @
849d9417
...
...
@@ -9,6 +9,7 @@
const
withDefaults
=
require
(
'
../shared.webpack.config
'
);
const
path
=
require
(
'
path
'
);
var
webpack
=
require
(
'
webpack
'
);
module
.
exports
=
withDefaults
({
context
:
path
.
join
(
__dirname
,
'
client
'
),
...
...
@@ -18,5 +19,9 @@ module.exports = withDefaults({
output
:
{
filename
:
'
jsonMain.js
'
,
path
:
path
.
join
(
__dirname
,
'
client
'
,
'
dist
'
)
}
},
plugins
:
[
new
webpack
.
IgnorePlugin
(
/vertx/
)
// request-light dependendeny
]
});
extensions/json-language-features/package.json
浏览文件 @
849d9417
...
...
@@ -103,7 +103,8 @@
"dependencies"
:
{
"vscode-extension-telemetry"
:
"0.1.1"
,
"vscode-languageclient"
:
"^5.2.1"
,
"vscode-nls"
:
"^4.0.0"
"vscode-nls"
:
"^4.0.0"
,
"request-light"
:
"^0.2.4"
},
"devDependencies"
:
{
"@types/node"
:
"^10.12.21"
...
...
extensions/json-language-features/server/extension.webpack.config.js
浏览文件 @
849d9417
...
...
@@ -21,6 +21,6 @@ module.exports = withDefaults({
path
:
path
.
join
(
__dirname
,
'
dist
'
)
},
plugins
:
[
new
webpack
.
IgnorePlugin
(
/vertx/
)
]
,
new
webpack
.
IgnorePlugin
(
/vertx/
)
// request-light dependendeny
]
});
extensions/json-language-features/yarn.lock
浏览文件 @
849d9417
...
...
@@ -7,6 +7,13 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
agent-base@4, agent-base@^4.1.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==
dependencies:
es6-promisify "^5.0.0"
applicationinsights@1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.8.tgz#db6e3d983cf9f9405fe1ee5ba30ac6e1914537b5"
...
...
@@ -16,6 +23,20 @@ applicationinsights@1.0.8:
diagnostic-channel-publishers "0.2.1"
zone.js "0.7.6"
debug@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
dependencies:
ms "2.0.0"
debug@^3.1.0:
version "3.2.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
dependencies:
ms "^2.1.1"
diagnostic-channel-publishers@0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
...
...
@@ -28,6 +49,53 @@ diagnostic-channel@0.2.0:
dependencies:
semver "^5.3.0"
es6-promise@^4.0.3:
version "4.2.6"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f"
integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==
es6-promisify@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=
dependencies:
es6-promise "^4.0.3"
http-proxy-agent@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405"
integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==
dependencies:
agent-base "4"
debug "3.1.0"
https-proxy-agent@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0"
integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==
dependencies:
agent-base "^4.1.0"
debug "^3.1.0"
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
ms@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
request-light@^0.2.4:
version "0.2.4"
resolved "https://registry.yarnpkg.com/request-light/-/request-light-0.2.4.tgz#3cea29c126682e6bcadf7915353322eeba01a755"
integrity sha512-pM9Fq5jRnSb+82V7M97rp8FE9/YNeP2L9eckB4Szd7lyeclSIx02aIpPO/6e4m6Dy31+FBN/zkFMTd2HkNO3ow==
dependencies:
http-proxy-agent "^2.1.0"
https-proxy-agent "^2.2.1"
vscode-nls "^4.0.0"
semver@^5.3.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录