Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c72c6cc3
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c72c6cc3
编写于
8月 28, 2017
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[json] complete colorProvider adoption
上级
07e2faac
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
11 addition
and
14 deletion
+11
-14
extensions/json/client/src/jsonMain.ts
extensions/json/client/src/jsonMain.ts
+6
-7
extensions/json/npm-shrinkwrap.json
extensions/json/npm-shrinkwrap.json
+1
-1
extensions/json/package.json
extensions/json/package.json
+1
-0
extensions/json/server/npm-shrinkwrap.json
extensions/json/server/npm-shrinkwrap.json
+1
-1
extensions/json/server/package.json
extensions/json/server/package.json
+1
-0
extensions/json/server/src/jsonServerMain.ts
extensions/json/server/src/jsonServerMain.ts
+1
-5
未找到文件。
extensions/json/client/src/jsonMain.ts
浏览文件 @
c72c6cc3
...
...
@@ -6,7 +6,7 @@
import
*
as
path
from
'
path
'
;
import
{
workspace
,
languages
,
ExtensionContext
,
extensions
,
Uri
,
Range
,
TextDocument
,
ColorRange
,
Color
}
from
'
vscode
'
;
import
{
workspace
,
languages
,
ExtensionContext
,
extensions
,
Uri
,
TextDocument
,
ColorRange
,
Color
}
from
'
vscode
'
;
import
{
LanguageClient
,
LanguageClientOptions
,
RequestType
,
ServerOptions
,
TransportKind
,
NotificationType
,
DidChangeConfigurationNotification
}
from
'
vscode-languageclient
'
;
import
TelemetryReporter
from
'
vscode-extension-telemetry
'
;
import
{
ConfigurationFeature
}
from
'
vscode-languageclient/lib/proposed
'
;
...
...
@@ -21,10 +21,6 @@ namespace VSCodeContentRequest {
export
const
type
:
RequestType
<
string
,
string
,
any
,
any
>
=
new
RequestType
(
'
vscode/content
'
);
}
namespace
ColorSymbolRequest
{
export
const
type
:
RequestType
<
string
,
Range
[],
any
,
any
>
=
new
RequestType
(
'
json/colorSymbols
'
);
}
export
interface
ISchemaAssociations
{
[
pattern
:
string
]:
string
[];
}
...
...
@@ -83,10 +79,12 @@ export function activate(context: ExtensionContext) {
debug
:
{
module
:
serverModule
,
transport
:
TransportKind
.
ipc
,
options
:
debugOptions
}
};
let
documentSelector
=
[
'
json
'
];
// Options to control the language client
let
clientOptions
:
LanguageClientOptions
=
{
// Register the server for json documents
documentSelector
:
[
'
json
'
]
,
documentSelector
,
synchronize
:
{
// Synchronize the setting section 'json' to the server
configurationSection
:
[
'
json
'
,
'
http
'
],
...
...
@@ -123,7 +121,8 @@ export function activate(context: ExtensionContext) {
client
.
sendNotification
(
SchemaAssociationNotification
.
type
,
getSchemaAssociation
(
context
));
context
.
subscriptions
.
push
(
languages
.
registerColorProvider
(
'
json
'
,
{
// register color provider
context
.
subscriptions
.
push
(
languages
.
registerColorProvider
(
documentSelector
,
{
provideDocumentColors
(
document
:
TextDocument
):
Thenable
<
ColorRange
[]
>
{
let
params
=
client
.
code2ProtocolConverter
.
asDocumentSymbolParams
(
document
);
return
client
.
sendRequest
(
DocumentColorRequest
.
type
,
params
).
then
(
symbols
=>
{
...
...
extensions/json/npm-shrinkwrap.json
浏览文件 @
c72c6cc3
...
...
@@ -24,7 +24,7 @@
},
"vscode-languageserver-protocol"
:
{
"version"
:
"3.1.1"
,
"from"
:
"vscode-languageserver-protocol@>=3.1.
0
<4.0.0"
,
"from"
:
"vscode-languageserver-protocol@>=3.1.
1
<4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.1.1.tgz"
},
"vscode-languageserver-types"
:
{
...
...
extensions/json/package.json
浏览文件 @
c72c6cc3
...
...
@@ -134,6 +134,7 @@
"dependencies"
:
{
"vscode-extension-telemetry"
:
"0.0.8"
,
"vscode-languageclient"
:
"3.4.0-next.17"
,
"vscode-languageserver-protocol"
:
"^3.1.1"
,
"vscode-nls"
:
"2.0.2"
},
"devDependencies"
:
{
...
...
extensions/json/server/npm-shrinkwrap.json
浏览文件 @
c72c6cc3
...
...
@@ -59,7 +59,7 @@
},
"vscode-languageserver-protocol"
:
{
"version"
:
"3.1.1"
,
"from"
:
"vscode-languageserver-protocol@>=3.1.
0
<4.0.0"
,
"from"
:
"vscode-languageserver-protocol@>=3.1.
1
<4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.1.1.tgz"
},
"vscode-languageserver-types"
:
{
...
...
extensions/json/server/package.json
浏览文件 @
c72c6cc3
...
...
@@ -12,6 +12,7 @@
"request-light"
:
"^0.2.1"
,
"vscode-json-languageservice"
:
"^2.0.15"
,
"vscode-languageserver"
:
"3.4.0-next.6"
,
"vscode-languageserver-protocol"
:
"^3.1.1"
,
"vscode-nls"
:
"^2.0.2"
},
"devDependencies"
:
{
...
...
extensions/json/server/src/jsonServerMain.ts
浏览文件 @
c72c6cc3
...
...
@@ -7,7 +7,7 @@
import
{
createConnection
,
IConnection
,
TextDocuments
,
TextDocument
,
InitializeParams
,
InitializeResult
,
NotificationType
,
RequestType
,
DocumentRangeFormattingRequest
,
Disposable
,
Range
,
ServerCapabilities
DocumentRangeFormattingRequest
,
Disposable
,
ServerCapabilities
}
from
'
vscode-languageserver
'
;
import
{
DocumentColorRequest
,
ServerCapabilities
as
CPServerCapabilities
}
from
'
vscode-languageserver-protocol/lib/protocol.colorProvider.proposed
'
;
...
...
@@ -36,10 +36,6 @@ namespace VSCodeContentRequest {
export
const
type
:
RequestType
<
string
,
string
,
any
,
any
>
=
new
RequestType
(
'
vscode/content
'
);
}
namespace
ColorSymbolRequest
{
export
const
type
:
RequestType
<
string
,
Range
[],
any
,
any
>
=
new
RequestType
(
'
json/colorSymbols
'
);
}
// Create a connection for the server
let
connection
:
IConnection
=
createConnection
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录