Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
2a4e5b02
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,发现更多精彩内容 >>
提交
2a4e5b02
编写于
9月 14, 2016
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[html] add razor
上级
21c9ad57
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
1327 addition
and
744 deletion
+1327
-744
extensions/html/client/src/htmlMain.ts
extensions/html/client/src/htmlMain.ts
+1
-1
extensions/html/package.json
extensions/html/package.json
+17
-1
extensions/html/server/src/service/parser/razorTags.ts
extensions/html/server/src/service/parser/razorTags.ts
+39
-0
extensions/html/server/src/service/services/htmlCompletion.ts
...nsions/html/server/src/service/services/htmlCompletion.ts
+3
-1
extensions/razor/OSSREADME.json
extensions/razor/OSSREADME.json
+7
-0
extensions/razor/language-configuration.json
extensions/razor/language-configuration.json
+24
-0
extensions/razor/package.json
extensions/razor/package.json
+24
-0
extensions/razor/syntaxes/cshtml.json
extensions/razor/syntaxes/cshtml.json
+153
-0
extensions/razor/test/colorize-fixtures/test.cshtml
extensions/razor/test/colorize-fixtures/test.cshtml
+0
-0
extensions/razor/test/colorize-results/test_cshtml.json
extensions/razor/test/colorize-results/test_cshtml.json
+1058
-728
src/vs/editor/editor.main.ts
src/vs/editor/editor.main.ts
+1
-1
src/vs/languages/languages.main.ts
src/vs/languages/languages.main.ts
+0
-9
src/vs/workbench/workbench.main.ts
src/vs/workbench/workbench.main.ts
+0
-3
未找到文件。
extensions/html/client/src/htmlMain.ts
浏览文件 @
2a4e5b02
...
...
@@ -30,7 +30,7 @@ export function activate(context: ExtensionContext) {
// Options to control the language client
let
clientOptions
:
LanguageClientOptions
=
{
// Register the server for json documents
documentSelector
:
[
'
html
'
,
'
handlebars
'
],
documentSelector
:
[
'
html
'
,
'
handlebars
'
,
'
razor
'
],
synchronize
:
{
// Synchronize the setting section 'html' to the server
configurationSection
:
[
'
html
'
],
...
...
extensions/html/package.json
浏览文件 @
2a4e5b02
...
...
@@ -7,7 +7,8 @@
},
"activationEvents"
:
[
"onLanguage:html"
,
"onLanguage:handlebars"
"onLanguage:handlebars"
,
"onLanguage:razor"
],
"main"
:
"./client/out/htmlMain"
,
"scripts"
:
{
...
...
@@ -83,6 +84,21 @@
],
"default"
:
"head, body, /html"
,
"description"
:
"List of tags, comma separated, that should have an extra newline before them. 'null' defaults to
\"
head, body, /html
\"
."
},
"html.suggest.angular1"
:
{
"type"
:
"boolean"
,
"default"
:
true
,
"description"
:
"Configures if the built-in HTML language support suggests Angular V1 tags and properties."
},
"html.suggest.ionic"
:
{
"type"
:
"boolean"
,
"default"
:
true
,
"description"
:
"Configures if the built-in HTML language support suggests Ionic tags, properties and values."
},
"html.suggest.html5"
:
{
"type"
:
"boolean"
,
"default"
:
true
,
"description"
:
"Configures if the built-in HTML language support suggests HTML5 tags, properties and values."
}
}
}
...
...
extensions/html/server/src/service/parser/razorTags.ts
0 → 100644
浏览文件 @
2a4e5b02
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
IHTMLTagProvider
}
from
'
./htmlTags
'
;
export
function
getRazorTagProvider
()
:
IHTMLTagProvider
{
var
customTags
:
{
[
tag
:
string
]:
string
[]}
=
{
a
:
[
'
asp-action
'
,
'
asp-controller
'
,
'
asp-fragment
'
,
'
asp-host
'
,
'
asp-protocol
'
,
'
asp-route
'
],
div
:
[
'
asp-validation-summary
'
],
form
:
[
'
asp-action
'
,
'
asp-controller
'
,
'
asp-anti-forgery
'
],
input
:
[
'
asp-for
'
,
'
asp-format
'
],
label
:
[
'
asp-for
'
],
select
:
[
'
asp-for
'
,
'
asp-items
'
],
span
:
[
'
asp-validation-for
'
]
};
return
{
getId
:
()
=>
'
razor
'
,
isApplicable
:
(
languageId
)
=>
languageId
===
'
razor
'
,
collectTags
:
(
collector
:
(
tag
:
string
)
=>
void
)
=>
{
// no extra tags
},
collectAttributes
:
(
tag
:
string
,
collector
:
(
attribute
:
string
,
type
:
string
)
=>
void
)
=>
{
if
(
tag
)
{
var
attributes
=
customTags
[
tag
];
if
(
attributes
)
{
attributes
.
forEach
(
a
=>
collector
(
a
,
null
));
}
}
},
collectValues
:
(
tag
:
string
,
attribute
:
string
,
collector
:
(
value
:
string
)
=>
void
)
=>
{
// no values
}
};
}
extensions/html/server/src/service/services/htmlCompletion.ts
浏览文件 @
2a4e5b02
...
...
@@ -8,12 +8,14 @@ import { TextDocument, Position, CompletionList, CompletionItemKind, Range } fro
import
{
HTMLDocument
}
from
'
../parser/htmlParser
'
;
import
{
TokenType
,
createScanner
,
ScannerState
}
from
'
../parser/htmlScanner
'
;
import
{
getHTML5TagProvider
,
getAngularTagProvider
,
getIonicTagProvider
}
from
'
../parser/htmlTags
'
;
import
{
getRazorTagProvider
}
from
'
../parser/razorTags
'
;
import
{
CompletionConfiguration
}
from
'
../htmlLanguageService
'
;
let
allTagProviders
=
[
getHTML5TagProvider
(),
getAngularTagProvider
(),
getIonicTagProvider
()
getIonicTagProvider
(),
getRazorTagProvider
()
];
export
function
doComplete
(
document
:
TextDocument
,
position
:
Position
,
doc
:
HTMLDocument
,
settings
?:
CompletionConfiguration
):
CompletionList
{
...
...
extensions/razor/OSSREADME.json
0 → 100644
浏览文件 @
2a4e5b02
//
ATTENTION
-
THIS
DIRECTORY
CONTAINS
THIRD
PARTY
OPEN
SOURCE
MATERIALS:
[{
"name"
:
"demyte/language-cshtml"
,
"version"
:
"0.0.0"
,
"license"
:
"MIT"
,
"repositoryURL"
:
"https://github.com/demyte/language-cshtml"
}]
extensions/razor/language-configuration.json
0 → 100644
浏览文件 @
2a4e5b02
{
"comments"
:
{
"blockComment"
:
[
"<!--"
,
"-->"
]
},
"brackets"
:
[
[
"<!--"
,
"-->"
],
[
"<"
,
">"
],
[
"{"
,
"}"
],
[
"("
,
")"
]
],
"autoClosingPairs"
:
[
{
"open"
:
"{"
,
"close"
:
"}"
},
{
"open"
:
"["
,
"close"
:
"]"
},
{
"open"
:
"("
,
"close"
:
")"
},
{
"open"
:
"'"
,
"close"
:
"'"
},
{
"open"
:
"
\"
"
,
"close"
:
"
\"
"
},
{
"open"
:
"<"
,
"close"
:
">"
}
],
"surroundingPairs"
:
[
{
"open"
:
"'"
,
"close"
:
"'"
},
{
"open"
:
"
\"
"
,
"close"
:
"
\"
"
},
{
"open"
:
"<"
,
"close"
:
">"
}
]
}
\ No newline at end of file
extensions/razor/package.json
0 → 100644
浏览文件 @
2a4e5b02
{
"name"
:
"razor"
,
"version"
:
"0.1.0"
,
"publisher"
:
"vscode"
,
"engines"
:
{
"vscode"
:
"0.10.x"
},
"scripts"
:
{
"update-grammar"
:
"node ../../build/npm/update-grammar.js demyte/language-cshtml grammars/cshtml.cson ./syntaxes/cshtml.json"
},
"contributes"
:
{
"languages"
:
[{
"id"
:
"razor"
,
"extensions"
:
[
".cshtml"
],
"aliases"
:
[
"Razor"
,
"razor"
],
"mimetypes"
:
[
"text/x-cshtml"
]
}],
"grammars"
:
[{
"language"
:
"razor"
,
"scopeName"
:
"text.html.cshtml"
,
"path"
:
"./syntaxes/cshtml.json"
}]
}
}
extensions/razor/syntaxes/cshtml.json
0 → 100644
浏览文件 @
2a4e5b02
{
"name"
:
"ASP.NET Razor"
,
"scopeName"
:
"text.html.cshtml"
,
"fileTypes"
:
[
"cshtml"
,
"gohtml"
],
"patterns"
:
[
{
"name"
:
"section.embedded.source.cshtml"
,
"begin"
:
"(@?([a-zA-Z0-9]+)?)(
\\
s[a-zA-Z0-9]+)?(
\n
|
\r
)?(
\\
{)"
,
"beginCaptures"
:
{
"0"
:
{
"name"
:
"punctuation.section.embedded.begin.cshtml"
},
"1"
:
{
"name"
:
"keyword.control.cshtml"
}
},
"patterns"
:
[
{
"name"
:
"section.embedded.source.cshtml"
,
"begin"
:
"(@?([a-zA-Z0-9]+)?)(
\\
s[a-zA-Z0-9]+)?(
\n
|
\r
)?(
\\
{)"
,
"beginCaptures"
:
{
"0"
:
{
"name"
:
"punctuation.section.embedded.begin.cshtml"
},
"1"
:
{
"name"
:
"keyword.control.cshtml"
}
},
"patterns"
:
[
{
"name"
:
"string.quoted.single.cshtml"
,
"match"
:
"'"
},
{
"include"
:
"#embedded-code"
},
{
"include"
:
"#comments"
},
{
"include"
:
"source.cs"
},
{
"include"
:
"text.html.basic"
}
],
"end"
:
"
\\
}"
,
"endCaptures"
:
{
"0"
:
{
"name"
:
"punctuation.section.embedded.begin.cshtml"
}
}
},
{
"name"
:
"string.quoted.single.cshtml"
,
"match"
:
"'"
},
{
"include"
:
"#embedded-code"
},
{
"include"
:
"#comments"
},
{
"include"
:
"text.html.basic"
}
],
"end"
:
"
\\
}"
,
"endCaptures"
:
{
"0"
:
{
"name"
:
"punctuation.section.embedded.begin.cshtml"
}
},
"comments"
:
"Simple multi-line code section"
},
{
"begin"
:
"(@[a-zA-Z0-9]+)(
\\
s?)"
,
"captures"
:
{
"0"
:
{
"name"
:
"section.embedded.begin.cshtml"
},
"1"
:
{
"name"
:
"keyword.control.cshtml"
}
},
"patterns"
:
[
{
"match"
:
"(([a-zA-Z0-9]+)(
\\
.)?)+?"
,
"captures"
:
{
"2"
:
{
"name"
:
"entity.name.tag.source.cshtml"
},
"3"
:
{
"name"
:
"punctuation.separator.namespace.source.cshtml"
}
}
},
{
"include"
:
"#embedded-code"
},
{
"include"
:
"#comments"
},
{
"include"
:
"source.cs"
},
{
"include"
:
"text.html.basic"
}
],
"end"
:
"(
\\
n|
\\
s)"
,
"comments"
:
"Covers single line Razor tags"
},
{
"include"
:
"#comments"
},
{
"include"
:
"text.html.basic"
}
],
"repository"
:
{
"embedded-code"
:
{
"match"
:
"(@?[a-zA-Z0-9]+)(
\\
.([a-zA-Z0-9]+))?"
,
"captures"
:
{
"1"
:
{
"name"
:
"keyword.control.cshtml"
},
"3"
:
{
"name"
:
"entity.name.tag.source.cshtml"
}
},
"patterns"
:
[
{
"include"
:
"#comments"
}
]
},
"comments"
:
{
"begin"
:
"@
\\
*"
,
"captures"
:
{
"0"
:
{
"name"
:
"punctuation.definition.comment.source.cshtml"
}
},
"end"
:
"
\\
*@"
,
"name"
:
"comment.block.cshtml"
}
},
"version"
:
"https://github.com/demyte/language-cshtml/commit/a49735dc7aef56ae772a3bcfd8e42c89895dcff4"
}
\ No newline at end of file
extensions/
vscode-colorize-tests
/test/colorize-fixtures/test.cshtml
→
extensions/
razor
/test/colorize-fixtures/test.cshtml
浏览文件 @
2a4e5b02
文件已移动
extensions/
vscode-colorize-tests
/test/colorize-results/test_cshtml.json
→
extensions/
razor
/test/colorize-results/test_cshtml.json
浏览文件 @
2a4e5b02
此差异已折叠。
点击以展开。
src/vs/editor/editor.main.ts
浏览文件 @
2a4e5b02
...
...
@@ -9,10 +9,10 @@ import 'vs/editor/browser/editor.all';
import
'
vs/editor/contrib/quickOpen/browser/quickOutline
'
;
import
'
vs/editor/contrib/quickOpen/browser/gotoLine
'
;
import
'
vs/editor/contrib/quickOpen/browser/quickCommand
'
;
import
'
vs/languages/languages.main
'
;
import
'
vs/languages/php/common/php.contribution
'
;
import
'
vs/languages/html/common/html.contribution
'
;
import
'
vs/languages/handlebars/common/handlebars.contribution
'
;
import
'
vs/languages/razor/common/razor.contribution
'
;
import
{
createMonacoBaseAPI
}
from
'
vs/editor/common/standalone/standaloneBase
'
;
import
{
createMonacoEditorAPI
}
from
'
vs/editor/browser/standalone/standaloneEditor
'
;
...
...
src/vs/languages/languages.main.ts
已删除
100644 → 0
浏览文件 @
21c9ad57
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
'
vs/languages/razor/common/razor.contribution
'
;
src/vs/workbench/workbench.main.ts
浏览文件 @
2a4e5b02
...
...
@@ -16,9 +16,6 @@ import 'vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard
import
'
vs/editor/contrib/suggest/electron-browser/snippetCompletion
'
;
import
'
vs/editor/browser/editor.all
'
;
// Languages
import
'
vs/languages/languages.main
'
;
// Menus/Actions
import
'
vs/platform/actions/browser/menusExtensionPoint
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录