Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9030f132
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,体验更适合开发者的 AI 搜索 >>
提交
9030f132
编写于
2月 08, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use extracted markdown grammar
Fixes #43141
上级
e10ce07e
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
2280 addition
and
5062 deletion
+2280
-5062
extensions/markdown/package.json
extensions/markdown/package.json
+2
-4
extensions/markdown/syntaxes/gulpfile.js
extensions/markdown/syntaxes/gulpfile.js
+0
-164
extensions/markdown/syntaxes/markdown.tmLanguage
extensions/markdown/syntaxes/markdown.tmLanguage
+0
-3702
extensions/markdown/syntaxes/markdown.tmLanguage.base
extensions/markdown/syntaxes/markdown.tmLanguage.base
+0
-1192
extensions/markdown/syntaxes/markdown.tmLanguage.json
extensions/markdown/syntaxes/markdown.tmLanguage.json
+2278
-0
未找到文件。
extensions/markdown/package.json
浏览文件 @
9030f132
...
...
@@ -41,7 +41,7 @@
{
"language"
:
"markdown"
,
"scopeName"
:
"text.html.markdown"
,
"path"
:
"./syntaxes/markdown.tmLanguage"
,
"path"
:
"./syntaxes/markdown.tmLanguage
.json
"
,
"embeddedLanguages"
:
{
"meta.embedded.block.html"
:
"html"
,
"source.js"
:
"javascript"
,
...
...
@@ -322,7 +322,7 @@
},
"scripts"
:
{
"vscode:prepublish"
:
"node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:markdown ./tsconfig.json"
,
"update-grammar"
:
"node ../../
node_modules/gulp/bin/gulp.js --gulpfile ./syntaxes/gulpfile.js
"
"update-grammar"
:
"node ../../
build/npm/update-grammar.js microsoft/vscode-markdown-tm-grammar syntaxes/markdown.tmLanguage ./syntaxes/markdown.tmLanguage.json
"
},
"dependencies"
:
{
"highlight.js"
:
"9.5.0"
,
...
...
@@ -335,8 +335,6 @@
"@types/highlight.js"
:
"9.1.10"
,
"@types/markdown-it"
:
"0.0.2"
,
"@types/node"
:
"7.0.43"
,
"gulp-rename"
:
"^1.2.2"
,
"gulp-replace"
:
"^0.5.4"
,
"vscode"
:
"^1.1.10"
}
}
\ No newline at end of file
extensions/markdown/syntaxes/gulpfile.js
已删除
100644 → 0
浏览文件 @
e10ce07e
// @ts-check
var
gulp
=
require
(
'
gulp
'
);
var
util
=
require
(
"
gulp-util
"
);
var
replace
=
require
(
'
gulp-replace
'
);
var
rename
=
require
(
'
gulp-rename
'
);
const
languages
=
[
{
name
:
'
css
'
,
language
:
'
css
'
,
identifiers
:
[
'
css
'
,
'
css.erb
'
],
source
:
'
source.css
'
},
{
name
:
'
basic
'
,
language
:
'
html
'
,
identifiers
:
[
'
html
'
,
'
htm
'
,
'
shtml
'
,
'
xhtml
'
,
'
inc
'
,
'
tmpl
'
,
'
tpl
'
],
source
:
'
text.html.basic
'
},
{
name
:
'
ini
'
,
language
:
'
ini
'
,
identifiers
:
[
'
ini
'
,
'
conf
'
],
source
:
'
source.ini
'
},
{
name
:
'
java
'
,
language
:
'
java
'
,
identifiers
:
[
'
java
'
,
'
bsh
'
],
source
:
'
source.java
'
},
{
name
:
'
lua
'
,
language
:
'
lua
'
,
identifiers
:
[
'
lua
'
],
source
:
'
source.lua
'
},
{
name
:
'
makefile
'
,
language
:
'
makefile
'
,
identifiers
:
[
'
Makefile
'
,
'
makefile
'
,
'
GNUmakefile
'
,
'
OCamlMakefile
'
],
source
:
'
source.makefile
'
},
{
name
:
'
perl
'
,
language
:
'
perl
'
,
identifiers
:
[
'
perl
'
,
'
pl
'
,
'
pm
'
,
'
pod
'
,
'
t
'
,
'
PL
'
,
'
psgi
'
,
'
vcl
'
],
source
:
'
source.perl
'
},
{
name
:
'
r
'
,
language
:
'
r
'
,
identifiers
:
[
'
R
'
,
'
r
'
,
'
s
'
,
'
S
'
,
'
Rprofile
'
],
source
:
'
source.r
'
},
{
name
:
'
ruby
'
,
language
:
'
ruby
'
,
identifiers
:
[
'
ruby
'
,
'
rb
'
,
'
rbx
'
,
'
rjs
'
,
'
Rakefile
'
,
'
rake
'
,
'
cgi
'
,
'
fcgi
'
,
'
gemspec
'
,
'
irbrc
'
,
'
Capfile
'
,
'
ru
'
,
'
prawn
'
,
'
Cheffile
'
,
'
Gemfile
'
,
'
Guardfile
'
,
'
Hobofile
'
,
'
Vagrantfile
'
,
'
Appraisals
'
,
'
Rantfile
'
,
'
Berksfile
'
,
'
Berksfile.lock
'
,
'
Thorfile
'
,
'
Puppetfile
'
],
source
:
'
source.ruby
'
},
// Left to its own devices, the PHP grammar will match HTML as a combination of operators
// and constants. Therefore, HTML must take precedence over PHP in order to get proper
// syntax highlighting.
{
name
:
'
php
'
,
language
:
'
php
'
,
identifiers
:
[
'
php
'
,
'
php3
'
,
'
php4
'
,
'
php5
'
,
'
phpt
'
,
'
phtml
'
,
'
aw
'
,
'
ctp
'
],
source
:
[
'
text.html.basic
'
,
'
text.html.php#language
'
]
},
{
name
:
'
sql
'
,
language
:
'
sql
'
,
identifiers
:
[
'
sql
'
,
'
ddl
'
,
'
dml
'
],
source
:
'
source.sql
'
},
{
name
:
'
vs_net
'
,
language
:
'
vs_net
'
,
identifiers
:
[
'
vb
'
],
source
:
'
source.asp.vb.net
'
},
{
name
:
'
xml
'
,
language
:
'
xml
'
,
identifiers
:
[
'
xml
'
,
'
xsd
'
,
'
tld
'
,
'
jsp
'
,
'
pt
'
,
'
cpt
'
,
'
dtml
'
,
'
rss
'
,
'
opml
'
],
source
:
'
text.xml
'
},
{
name
:
'
xsl
'
,
language
:
'
xsl
'
,
identifiers
:
[
'
xsl
'
,
'
xslt
'
],
source
:
'
text.xml.xsl
'
},
{
name
:
'
yaml
'
,
language
:
'
yaml
'
,
identifiers
:
[
'
yaml
'
,
'
yml
'
],
source
:
'
source.yaml
'
},
{
name
:
'
dosbatch
'
,
language
:
'
dosbatch
'
,
identifiers
:
[
'
bat
'
,
'
batch
'
],
source
:
'
source.dosbatch
'
},
{
name
:
'
clojure
'
,
language
:
'
clojure
'
,
identifiers
:
[
'
clj
'
,
'
cljs
'
,
'
clojure
'
],
source
:
'
source.clojure
'
},
{
name
:
'
coffee
'
,
language
:
'
coffee
'
,
identifiers
:
[
'
coffee
'
,
'
Cakefile
'
,
'
coffee.erb
'
],
source
:
'
source.coffee
'
},
{
name
:
'
c
'
,
language
:
'
c
'
,
identifiers
:
[
'
c
'
,
'
h
'
],
source
:
'
source.c
'
},
{
name
:
'
cpp
'
,
language
:
'
cpp
'
,
identifiers
:
[
'
cpp
'
,
'
c
\\
+
\\
+
'
,
'
cxx
'
],
source
:
'
source.cpp
'
},
{
name
:
'
diff
'
,
language
:
'
diff
'
,
identifiers
:
[
'
patch
'
,
'
diff
'
,
'
rej
'
],
source
:
'
source.diff
'
},
{
name
:
'
dockerfile
'
,
language
:
'
dockerfile
'
,
identifiers
:
[
'
dockerfile
'
,
'
Dockerfile
'
],
source
:
'
source.dockerfile
'
},
{
name
:
'
git_commit
'
,
identifiers
:
[
'
COMMIT_EDITMSG
'
,
'
MERGE_MSG
'
],
source
:
'
text.git-commit
'
},
{
name
:
'
git_rebase
'
,
identifiers
:
[
'
git-rebase-todo
'
],
source
:
'
text.git-rebase
'
},
{
name
:
'
go
'
,
language
:
'
go
'
,
identifiers
:
[
'
go
'
,
'
golang
'
],
source
:
'
source.go
'
},
{
name
:
'
groovy
'
,
language
:
'
groovy
'
,
identifiers
:
[
'
groovy
'
,
'
gvy
'
],
source
:
'
source.groovy
'
},
{
name
:
'
jade
'
,
language
:
'
jade
'
,
identifiers
:
[
'
jade
'
,
'
pug
'
],
source
:
'
text.jade
'
},
{
name
:
'
js
'
,
language
:
'
javascript
'
,
identifiers
:
[
'
js
'
,
'
jsx
'
,
'
javascript
'
,
'
es6
'
,
'
mjs
'
],
source
:
'
source.js
'
},
{
name
:
'
js_regexp
'
,
identifiers
:
[
'
regexp
'
],
source
:
'
source.js.regexp
'
},
{
name
:
'
json
'
,
language
:
'
json
'
,
identifiers
:
[
'
json
'
,
'
sublime-settings
'
,
'
sublime-menu
'
,
'
sublime-keymap
'
,
'
sublime-mousemap
'
,
'
sublime-theme
'
,
'
sublime-build
'
,
'
sublime-project
'
,
'
sublime-completions
'
],
source
:
'
source.json
'
},
{
name
:
'
less
'
,
language
:
'
less
'
,
identifiers
:
[
'
less
'
],
source
:
'
source.css.less
'
},
{
name
:
'
objc
'
,
language
:
'
objc
'
,
identifiers
:
[
'
objectivec
'
,
'
objective-c
'
,
'
mm
'
,
'
objc
'
,
'
obj-c
'
,
'
m
'
,
'
h
'
],
source
:
'
source.objc
'
},
{
name
:
'
scss
'
,
language
:
'
scss
'
,
identifiers
:
[
'
scss
'
],
source
:
'
source.css.scss
'
},
{
name
:
'
perl6
'
,
language
:
'
perl6
'
,
identifiers
:
[
'
perl6
'
,
'
p6
'
,
'
pl6
'
,
'
pm6
'
,
'
nqp
'
],
source
:
'
source.perl.6
'
},
{
name
:
'
powershell
'
,
language
:
'
powershell
'
,
identifiers
:
[
'
powershell
'
,
'
ps1
'
,
'
psm1
'
,
'
psd1
'
],
source
:
'
source.powershell
'
},
{
name
:
'
python
'
,
language
:
'
python
'
,
identifiers
:
[
'
python
'
,
'
py
'
,
'
py3
'
,
'
rpy
'
,
'
pyw
'
,
'
cpy
'
,
'
SConstruct
'
,
'
Sconstruct
'
,
'
sconstruct
'
,
'
SConscript
'
,
'
gyp
'
,
'
gypi
'
],
source
:
'
source.python
'
},
{
name
:
'
regexp_python
'
,
identifiers
:
[
'
re
'
],
source
:
'
source.regexp.python
'
},
{
name
:
'
rust
'
,
language
:
'
rust
'
,
identifiers
:
[
'
rust
'
,
'
rs
'
],
source
:
'
source.rust
'
},
{
name
:
'
scala
'
,
language
:
'
scala
'
,
identifiers
:
[
'
scala
'
,
'
sbt
'
],
source
:
'
source.scala
'
},
{
name
:
'
shell
'
,
language
:
'
shellscript
'
,
identifiers
:
[
'
shell
'
,
'
sh
'
,
'
bash
'
,
'
zsh
'
,
'
bashrc
'
,
'
bash_profile
'
,
'
bash_login
'
,
'
profile
'
,
'
bash_logout
'
,
'
.textmate_init
'
],
source
:
'
source.shell
'
},
{
name
:
'
ts
'
,
language
:
'
typescript
'
,
identifiers
:
[
'
typescript
'
,
'
ts
'
],
source
:
'
source.ts
'
},
{
name
:
'
tsx
'
,
language
:
'
typescriptreact
'
,
identifiers
:
[
'
tsx
'
],
source
:
'
source.tsx
'
},
{
name
:
'
csharp
'
,
language
:
'
csharp
'
,
identifiers
:
[
'
cs
'
,
'
csharp
'
,
'
c#
'
],
source
:
'
source.cs
'
},
{
name
:
'
fsharp
'
,
language
:
'
fsharp
'
,
identifiers
:
[
'
fs
'
,
'
fsharp
'
,
'
f#
'
],
source
:
'
source.fsharp
'
},
];
const
fencedCodeBlockDefinition
=
(
name
,
identifiers
,
sourceScope
,
language
)
=>
{
if
(
!
Array
.
isArray
(
sourceScope
))
{
sourceScope
=
[
sourceScope
];
}
language
=
language
||
name
const
scopes
=
sourceScope
.
map
(
scope
=>
`<dict>
<key>include</key>
<string>
${
scope
}
</string>
</dict>`
).
join
(
'
\n
'
);
return
`<key>fenced_code_block_
${
name
}
</key>
<dict>
<key>begin</key>
<string>(^|\\G)(\\s*)(
\`
{3,}|~{3,})\\s*(?i:(
${
identifiers
.
join
(
'
|
'
)}
)(\\s+[^
\`
~]*)?$)</string>
<key>name</key>
<string>markup.fenced_code.block.markdown</string>
<key>end</key>
<string>(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$</string>
<key>beginCaptures</key>
<dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.markdown</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>fenced_code.block.language</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>fenced_code.block.language.attributes</string>
</dict>
</dict>
<key>endCaptures</key>
<dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.markdown</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(^|\\G)(\\s*)(.*)</string>
<key>while</key>
<string>(^|\\G)(?!\\s*([
\`
~]{3,})\\s*$)</string>
<key>contentName</key>
<string>meta.embedded.block.
${
language
}
</string>
<key>patterns</key>
<array>
${
indent
(
4
,
scopes
)}
</array>
</dict>
</array>
</dict>`
;
};
const
indent
=
(
count
,
text
)
=>
{
const
indent
=
new
Array
(
count
+
1
).
join
(
'
\t
'
);
return
text
.
replace
(
/^/gm
,
indent
);
};
const
fencedCodeBlockInclude
=
(
name
)
=>
`<dict>
<key>include</key>
<string>#fenced_code_block_
${
name
}
</string>
</dict>`
;
const
fencedCodeBlockDefinitions
=
()
=>
languages
.
map
(
language
=>
fencedCodeBlockDefinition
(
language
.
name
,
language
.
identifiers
,
language
.
source
,
language
.
language
))
.
join
(
'
\n
'
);
const
fencedCodeBlockIncludes
=
()
=>
languages
.
map
(
language
=>
fencedCodeBlockInclude
(
language
.
name
))
.
join
(
'
\n
'
);
gulp
.
task
(
'
default
'
,
function
()
{
gulp
.
src
([
'
markdown.tmLanguage.base
'
])
.
pipe
(
replace
(
'
{{languageIncludes}}
'
,
indent
(
4
,
fencedCodeBlockIncludes
())))
.
pipe
(
replace
(
'
{{languageDefinitions}}
'
,
indent
(
4
,
fencedCodeBlockDefinitions
())))
.
pipe
(
rename
(
'
markdown.tmLanguage
'
))
.
pipe
(
gulp
.
dest
(
'
.
'
));
});
gulp
.
task
(
'
embedded
'
,
function
()
{
const
out
=
{}
for
(
const
lang
of
languages
.
filter
(
x
=>
x
.
language
))
{
out
[
'
meta.embedded.block.
'
+
lang
.
language
]
=
lang
.
language
;
}
util
.
log
(
JSON
.
stringify
(
out
,
undefined
,
4
));
});
extensions/markdown/syntaxes/markdown.tmLanguage
已删除
100644 → 0
浏览文件 @
e10ce07e
此差异已折叠。
点击以展开。
extensions/markdown/syntaxes/markdown.tmLanguage.base
已删除
100644 → 0
浏览文件 @
e10ce07e
此差异已折叠。
点击以展开。
extensions/markdown/syntaxes/markdown.tmLanguage.json
0 → 100644
浏览文件 @
9030f132
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录