Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
55307c2a
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,发现更多精彩内容 >>
提交
55307c2a
编写于
12月 09, 2019
作者:
J
Jackson Kearl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add syntax highlighting to Search Results.
Closes #86241.
上级
889ce81f
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
3100 addition
and
101 deletion
+3100
-101
extensions/search-result/package.json
extensions/search-result/package.json
+1
-0
extensions/search-result/syntaxes/generateTMLanguage.js
extensions/search-result/syntaxes/generateTMLanguage.js
+163
-0
extensions/search-result/syntaxes/searchResult.tmLanguage.json
...sions/search-result/syntaxes/searchResult.tmLanguage.json
+2936
-101
未找到文件。
extensions/search-result/package.json
浏览文件 @
55307c2a
...
...
@@ -16,6 +16,7 @@
"*"
],
"scripts"
:
{
"update-grammar"
:
"node ./syntaxes/generateTMLanguage.js"
,
"vscode:prepublish"
:
"node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:search-result ./tsconfig.json"
},
"contributes"
:
{
...
...
extensions/search-result/syntaxes/generateTMLanguage.js
0 → 100644
浏览文件 @
55307c2a
// @ts-check
const
languages
=
[
[
'
bat
'
,
'
source.batchfile
'
],
[
'
c
'
,
'
source.c
'
],
[
'
clj
'
,
'
source.clojure
'
],
[
'
coffee
'
,
'
source.coffee
'
],
[
'
cpp
'
,
'
source.cpp
'
],
[
'
cs
'
,
'
source.cs
'
],
[
'
css
'
,
'
source.css
'
],
[
'
dart
'
,
'
source.dart
'
],
[
'
diff
'
,
'
source.diff
'
],
[
'
dockerfile
'
,
'
source.dockerfile
'
],
[
'
fs
'
,
'
source.fsharp
'
],
[
'
go
'
,
'
source.go
'
],
[
'
groovy
'
,
'
source.groovy
'
],
[
'
h
'
,
'
source.objc
'
],
[
'
hpp
'
,
'
source.objcpp
'
],
[
'
html
'
,
'
source.html
'
],
[
'
java
'
,
'
source.java
'
],
[
'
js
'
,
'
source.js
'
],
[
'
json
'
,
'
source.json.comments
'
],
[
'
jsx
'
,
'
source.js.jsx
'
],
[
'
less
'
,
'
source.css.less
'
],
[
'
lua
'
,
'
source.lua
'
],
[
'
m
'
,
'
source.objc
'
],
[
'
make
'
,
'
source.makefile
'
],
[
'
mm
'
,
'
source.objcpp
'
],
[
'
p6
'
,
'
source.perl.6
'
],
[
'
perl
'
,
'
source.perl
'
],
[
'
php
'
,
'
source.php
'
],
[
'
pl
'
,
'
source.perl
'
],
[
'
ps1
'
,
'
source.powershell
'
],
[
'
py
'
,
'
source.python
'
],
[
'
r
'
,
'
source.r
'
],
[
'
rb
'
,
'
source.ruby
'
],
[
'
rs
'
,
'
source.rust
'
],
[
'
scala
'
,
'
source.scala
'
],
[
'
scss
'
,
'
source.css.scss
'
],
[
'
sh
'
,
'
source.shell
'
],
[
'
sql
'
,
'
source.sql
'
],
[
'
swift
'
,
'
source.swift
'
],
[
'
ts
'
,
'
source.ts
'
],
[
'
tsx
'
,
'
source.tsx
'
],
[
'
yaml
'
,
'
source.yaml
'
],
];
const
repository
=
{};
languages
.
forEach
(([
ext
,
scope
])
=>
repository
[
ext
]
=
{
begin
:
`^(?!\\s)(.*?)([^\\\\\\/\\n]*.
${
ext
}
)(:)$`
,
end
:
"
^(?!
\\
s)
"
,
name
:
`searchResult.block.
${
ext
}
`
,
beginCaptures
:
{
"
0
"
:
{
name
:
"
string path.searchResult
"
},
"
1
"
:
{
name
:
"
dirname.path.searchResult
"
},
"
2
"
:
{
name
:
"
basename.path.searchResult
"
},
"
3
"
:
{
name
:
"
endingColon.path.searchResult
"
}
},
patterns
:
[
{
begin
:
"
^ (
\\
d+)( )
"
,
while
:
"
^ (
\\
d+)(:| )
"
,
beginCaptures
:
{
"
1
"
:
{
name
:
"
constant.numeric lineNumber.searchResult resultPrefix.searchResult
"
},
"
2
"
:
{
name
:
"
resultPrefixSeparator.searchResult resultPrefix.searchResult
"
}
},
whileCaptures
:
{
"
1
"
:
{
name
:
"
constant.numeric lineNumber.searchResult resultPrefix.searchResult
"
},
"
2
"
:
{
name
:
"
resultPrefixSeparator.searchResult resultPrefix.searchResult
"
}
},
name
:
`searchResult.resultLine.
${
ext
}
searchResult.multiline`
,
patterns
:
[
{
include
:
scope
}
]
},
{
match
:
"
^ (
\\
d+)(:)(.*)
"
,
name
:
`searchResult.resultLine.
${
ext
}
searchResult.singleline`
,
captures
:
{
"
1
"
:
{
name
:
"
constant.numeric lineNumber.searchResult resultPrefix.searchResult
"
},
"
2
"
:
{
name
:
"
resultPrefixSeparator.searchResult resultPrefix.searchResult
"
},
"
3
"
:
{
patterns
:
[
{
include
:
scope
}
]
}
}
}
]
});
const
header
=
{
"
match
"
:
"
^# (Query|Flags|Including|Excluding|ContextLines): .*$
"
,
"
name
"
:
"
comment
"
};
const
plainText
=
[{
match
:
"
^(?!
\\
s)(.*?)([^
\\\\\\
/
\\
n]*)(:)$
"
,
name
:
"
string path.searchResult
"
,
captures
:
{
"
1
"
:
{
name
:
"
dirname.path.searchResult
"
},
"
2
"
:
{
name
:
"
basename.path.searchResult
"
},
"
3
"
:
{
name
:
"
endingColon.path.searchResult
"
}
}
},
{
match
:
"
^ (
\\
d+)(:| )
"
,
captures
:
{
"
1
"
:
{
name
:
"
constant.numeric lineNumber.searchResult resultPrefix.searchResult
"
},
"
2
"
:
{
name
:
"
resultPrefixSeparator.searchResult resultPrefix.searchResult
"
}
}
}];
const
tmLanguage
=
{
"
information_for_contributors
"
:
"
This file is generated from ./generateTMLanguage.js.
"
,
name
:
"
Search Results
"
,
scopeName
:
"
text.searchResult
"
,
patterns
:
[
header
,
...
languages
.
map
(([
ext
])
=>
({
include
:
`#
${
ext
}
`
})),
...
plainText
],
repository
};
require
(
'
fs
'
)
.
writeFileSync
(
'
./searchResult.tmLanguage.json
'
,
JSON
.
stringify
(
tmLanguage
,
null
,
2
));
extensions/search-result/syntaxes/searchResult.tmLanguage.json
浏览文件 @
55307c2a
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录