Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Comparing grammar for: https://github.com/ionide/ionide-vscode-fsharp/issues/1073
建立於
7 年前
差異永不過期
清除
匯出
分享
解釋
0 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
733 行
全部複製
0 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
733 行
全部複製
{
{
"name": "fsharp",
"name": "fsharp",
"scopeName": "source.fsharp",
"scopeName": "source.fsharp",
"fileTypes": [
"fileTypes": [
"fs"
"fs"
],
],
"foldingStartMarker": "",
"foldingStartMarker": "",
"foldingStopMarker": "",
"foldingStopMarker": "",
"patterns": [
"patterns": [
{
{
"include": "#compiler_directives"
"include": "#compiler_directives"
},
},
{
{
"include": "#comments"
"include": "#comments"
},
},
{
{
"include": "#constants"
"include": "#constants"
},
},
{
{
"include": "#strings"
"include": "#strings"
},
},
{
{
"include": "#chars"
"include": "#chars"
},
},
{
{
"include": "#double_tick"
"include": "#double_tick"
},
},
{
{
"include": "#definition"
"include": "#definition"
},
},
{
{
"include": "#abstract_definition"
"include": "#abstract_definition"
},
},
{
{
"include": "#attributes"
"include": "#attributes"
},
},
{
{
"include": "#modules"
"include": "#modules"
},
},
{
{
"include": "#anonymous_functions"
"include": "#anonymous_functions"
},
},
{
{
"include": "#du_declaration"
"include": "#du_declaration"
},
},
{
{
"include": "#record_declaration"
"include": "#record_declaration"
},
},
{
{
"include": "#records"
"include": "#records"
},
},
{
{
"include": "#strp_inlined"
"include": "#strp_inlined"
},
},
{
{
"include": "#keywords"
"include": "#keywords"
},
},
{
{
"include": "#cexprs"
"include": "#cexprs"
},
},
{
{
"include": "#text"
"include": "#text"
}
}
],
],
"repository": {
"repository": {
"strp_inlined_body": {
"strp_inlined_body": {
"patterns": [
"patterns": [
{
{
"include": "#comments"
"include": "#comments"
},
},
{
{
"include": "#anonymous_functions"
"include": "#anonymous_functions"
},
},
{
{
"match": "(\\^[[:alpha:]0-9'._]+)",
"match": "(\\^[[:alpha:]0-9'._]+)",
"captures": {
"captures": {
"1": {
"1": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"name": "keyword.fsharp",
"name": "keyword.fsharp",
"match": "\\b(and|when|or)\\b"
"match": "\\b(and|when|or)\\b"
},
},
{
{
"begin": "(\\()",
"begin": "(\\()",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"end": "(\\))",
"end": "(\\))",
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"include": "#strp_inlined_body"
"include": "#strp_inlined_body"
}
}
]
]
},
},
{
{
"match": "(static member|member)\\s*([[:alpha:]0-9'`<>^._]+|``[[:alpha:]0-9' <>^._]+``)\\s*(:)",
"match": "(static member|member)\\s*([[:alpha:]0-9'`<>^._]+|``[[:alpha:]0-9' <>^._]+``)\\s*(:)",
"captures": {
"captures": {
"1": {
"1": {
"name": "keyword.fsharp"
"name": "keyword.fsharp"
},
},
"2": {
"2": {
"name": "variable.fsharp"
"name": "variable.fsharp"
},
},
"3": {
"3": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
}
}
},
},
{
{
"include": "#compiler_directives"
"include": "#compiler_directives"
},
},
{
{
"include": "#constants"
"include": "#constants"
},
},
{
{
"include": "#strings"
"include": "#strings"
},
},
{
{
"include": "#chars"
"include": "#chars"
},
},
{
{
"include": "#double_tick"
"include": "#double_tick"
},
},
{
{
"include": "#keywords"
"include": "#keywords"
},
},
{
{
"include": "#text"
"include": "#text"
},
},
{
{
"include": "#definition"
"include": "#definition"
},
},
{
{
"include": "#attributes"
"include": "#attributes"
},
},
{
{
"include": "#keywords"
"include": "#keywords"
},
},
{
{
"include": "#cexprs"
"include": "#cexprs"
},
},
{
{
"include": "#text"
"include": "#text"
}
}
]
]
},
},
"strp_inlined": {
"strp_inlined": {
"patterns": [
"patterns": [
{
{
"begin": "(\\()",
"begin": "(\\()",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"end": "(\\))",
"end": "(\\))",
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"include": "#strp_inlined_body"
"include": "#strp_inlined_body"
}
}
]
]
}
}
]
]
},
},
"generic_declaration": {
"generic_declaration": {
"patterns": [
"patterns": [
{
{
"comments": "SRTP syntax support",
"comments": "SRTP syntax support",
"begin": "(:)\\s*(\\()\\s*(static member|member)",
"begin": "(:)\\s*(\\()\\s*(static member|member)",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"2": {
"2": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"3": {
"3": {
"name": "keyword.fsharp"
"name": "keyword.fsharp"
}
}
},
},
"end": "(\\))",
"end": "(\\))",
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"begin": "(\\()",
"begin": "(\\()",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"end": "(\\))",
"end": "(\\))",
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"include": "#member_declaration"
"include": "#member_declaration"
}
}
]
]
},
},
{
{
"match": "(('|\\^)[[:alpha:]0-9'._]+)",
"match": "(('|\\^)[[:alpha:]0-9'._]+)",
"captures": {
"captures": {
"1": {
"1": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"include": "#variables"
"include": "#variables"
},
},
{
{
"include": "#keywords"
"include": "#keywords"
}
}
]
]
},
},
{
{
"name": "keyword.fsharp",
"name": "keyword.fsharp",
"match": "\\b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|use|use\\!|struct|while|mutable)(?!')\\b"
"match": "\\b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|use|use\\!|struct|while|mutable)(?!')\\b"
},
},
{
{
"name": "keyword.fsharp",
"name": "keyword.fsharp",
"match": ":"
"match": ":"
},
},
{
{
"include": "#constants"
"include": "#constants"
},
},
{
{
"match": "(('|\\^)[[:alpha:]0-9'._]+)",
"match": "(('|\\^)[[:alpha:]0-9'._]+)",
"captures": {
"captures": {
"1": {
"1": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"begin": "(<)",
"begin": "(<)",
"end": "(>)",
"end": "(>)",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"match": "(('|\\^)[[:alpha:]0-9'._]+)",
"match": "(('|\\^)[[:alpha:]0-9'._]+)",
"captures": {
"captures": {
"1": {
"1": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"include": "#tuple_signature"
"include": "#tuple_signature"
},
},
{
{
"include": "#generic_declaration"
"include": "#generic_declaration"
}
}
]
]
},
},
{
{
"match": "(?!when|and|or\\b)\\b([\\w0-9'`^._]+)",
"match": "(?!when|and|or\\b)\\b([\\w0-9'`^._]+)",
"comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted",
"comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted",
"captures": {
"captures": {
"1": {
"1": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"match": "(\\|)",
"match": "(\\|)",
"comments": "Prevent captures of `|>` as a keyword when defining custom operator like `<|>`",
"comments": "Prevent captures of `|>` as a keyword when defining custom operator like `<|>`",
"captures": {
"captures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
}
}
},
},
{
{
"include": "#keywords"
"include": "#keywords"
}
}
]
]
},
},
"record_signature": {
"record_signature": {
"patterns": [
"patterns": [
{
{
"match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)",
"match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)",
"captures": {
"captures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"2": {
"2": {
"name": "variable.parameter.fsharp"
"name": "variable.parameter.fsharp"
}
}
}
}
},
},
{
{
"begin": "({)",
"begin": "({)",
"end": "(})",
"end": "(})",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)",
"match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)",
"captures": {
"captures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"2": {
"2": {
"name": "variable.parameter.fsharp"
"name": "variable.parameter.fsharp"
}
}
}
}
},
},
{
{
"include": "#record_signature"
"include": "#record_signature"
}
}
]
]
},
},
{
{
"include": "#keywords"
"include": "#keywords"
}
}
]
]
},
},
"tuple_signature": {
"tuple_signature": {
"patterns": [
"patterns": [
{
{
"match": "(([?[:alpha:]0-9'`^._ ]+))+",
"match": "(([?[:alpha:]0-9'`^._ ]+))+",
"captures": {
"captures": {
"1": {
"1": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"begin": "(\\()",
"begin": "(\\()",
"end": "(\\))",
"end": "(\\))",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"match": "(([?[:alpha:]0-9'`^._ ]+))+",
"match": "(([?[:alpha:]0-9'`^._ ]+))+",
"captures": {
"captures": {
"1": {
"1": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"include": "#tuple_signature"
"include": "#tuple_signature"
}
}
]
]
},
},
{
{
"include": "#keywords"
"include": "#keywords"
}
}
]
]
},
},
"anonymous_functions": {
"anonymous_functions": {
"patterns": [
"patterns": [
{
{
"name": "function.anonymous",
"name": "function.anonymous",
"begin": "\\b(fun)\\b",
"begin": "\\b(fun)\\b",
"end": "(->)",
"end": "(->)",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.fsharp"
"name": "keyword.fsharp"
}
}
},
},
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.fsharp"
"name": "keyword.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"include": "#comments"
"include": "#comments"
},
},
{
{
"begin": "(\\()",
"begin": "(\\()",
"end": "\\s*(?=(->))",
"end": "\\s*(?=(->))",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"include": "#member_declaration"
"include": "#member_declaration"
}
}
]
]
},
},
{
{
"include": "#variables"
"include": "#variables"
}
}
]
]
}
}
]
]
},
},
"attributes": {
"attributes": {
"patterns": [
"patterns": [
{
{
"name": "support.function.attribute.fsharp",
"name": "support.function.attribute.fsharp",
"begin": "\\[\\<",
"begin": "\\[\\<",
"end": "\\>\\]|\\]",
"end": "\\>\\]|\\]",
"patterns": [
"patterns": [
{
{
"include": "$self"
"include": "$self"
}
}
]
]
}
}
]
]
},
},
"comments": {
"comments": {
"patterns": [
"patterns": [
{
{
"name": "comment.block.markdown.fsharp",
"name": "comment.block.markdown.fsharp",
"begin": "^\\s*(\\(\\*\\*(?!\\)))(?!\\*\\))$",
"begin": "^\\s*(\\(\\*\\*(?!\\)))(?!\\*\\))$",
"while": "^(?!\\s*\\*\\)$)",
"while": "^(?!\\s*\\*\\)$)",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "comment.block.fsharp"
"name": "comment.block.fsharp"
}
}
},
},
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "comment.block.fsharp"
"name": "comment.block.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"include": "text.html.markdown"
"include": "text.html.markdown"
}
}
]
]
},
},
{
{
"name": "comment.block.markdown.fsharp.end",
"name": "comment.block.markdown.fsharp.end",
"match": "^(\\s*\\*\\)$)",
"match": "^(\\s*\\*\\)$)",
"captures": {
"captures": {
"1": {
"1": {
"name": "comment.block.fsharp"
"name": "comment.block.fsharp"
}
}
}
}
},
},
{
{
"name": "comment.block.fsharp",
"name": "comment.block.fsharp",
"begin": "(\\(\\*(?!\\)))",
"begin": "(\\(\\*(?!\\)))",
"end": "(\\*\\))",
"end": "(\\*\\))",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "comment.block.fsharp"
"name": "comment.block.fsharp"
}
}
},
},
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "comment.block.fsharp"
"name": "comment.block.fsharp"
}
}
}
}
},
},
{
{
"name": "comment.line.markdown.fsharp",
"name": "comment.line.markdown.fsharp",
"begin": "///",
"begin": "///",
"while": "///",
"while": "///",
"patterns": [
"patterns": [
{
{
"include": "text.html.markdown"
"include": "text.html.markdown"
}
}
]
]
},
},
{
{
"name": "comment.line.double-slash.fsharp",
"name": "comment.line.double-slash.fsharp",
"match": "//.*$"
"match": "//.*$"
}
}
]
]
},
},
"constants": {
"constants": {
"patterns": [
"patterns": [
{
{
"name": "constant.language.unit.fsharp",
"name": "constant.language.unit.fsharp",
"match": "\\(\\)"
"match": "\\(\\)"
},
},
{
{
"name": "constant.numeric.floating-point.fsharp",
"name": "constant.numeric.floating-point.fsharp",
"match": "\\b-?[0-9][0-9_]*((\\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))"
"match": "\\b-?[0-9][0-9_]*((\\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))"
},
},
{
{
"name": "constant.numeric.integer.nativeint.fsharp",
"name": "constant.numeric.integer.nativeint.fsharp",
"match": "\\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))"
"match": "\\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))"
},
},
{
{
"name": "constant.others.fsharp",
"name": "constant.others.fsharp",
"match": "\\b(true|false|null|unit)\\b"
"match": "\\b(true|false|null|unit)\\b"
}
}
]
]
},
},
"abstract_definition": {
"abstract_definition": {
"name": "abstract.definition.fsharp",
"name": "abstract.definition.fsharp",
"begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(:)",
"begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(:)",
"end": "\\s*(with)\\b|=|$",
"end": "\\s*(with)\\b|=|$",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.fsharp"
"name": "keyword.fsharp"
},
},
"2": {
"2": {
"name": "keyword.fsharp"
"name": "keyword.fsharp"
},
},
"3": {
"3": {
"name": "support.function.attribute.fsharp"
"name": "support.function.attribute.fsharp"
},
},
"5": {
"5": {
"name": "keyword.fsharp"
"name": "keyword.fsharp"
}
}
},
},
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.fsharp"
"name": "keyword.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"include": "#comments"
"include": "#comments"
},
},
{
{
"include": "#common_declaration"
"include": "#common_declaration"
},
},
{
{
"match": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)(\\s*([[:alpha:]0-9'`^._ ]+)){0,1}",
"match": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)(\\s*([[:alpha:]0-9'`^._ ]+)){0,1}",
"captures": {
"captures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"2": {
"2": {
"name": "variable.parameter.fsharp"
"name": "variable.parameter.fsharp"
},
},
"3": {
"3": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"4": {
"4": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"match": "(?!with|get|set\\b)\\b([\\w0-9'`^._]+)",
"match": "(?!with|get|set\\b)\\b([\\w0-9'`^._]+)",
"comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted",
"comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted",
"captures": {
"captures": {
"1": {
"1": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"include": "#keywords"
"include": "#keywords"
}
}
]
]
},
},
"common_binding_definition": {
"common_binding_definition": {
"patterns": [
"patterns": [
{
{
"include": "#comments"
"include": "#comments"
},
},
{
{
"include": "#attributes"
"include": "#attributes"
},
},
{
{
"comments": "SRTP syntax support",
"comments": "SRTP syntax support",
"begin": "(:)\\s*(\\()\\s*(static member|member)",
"begin": "(:)\\s*(\\()\\s*(static member|member)",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"2": {
"2": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"3": {
"3": {
"name": "keyword.fsharp"
"name": "keyword.fsharp"
}
}
},
},
"end": "(\\))\\s*((?=,)|(?=\\=))",
"end": "(\\))\\s*((?=,)|(?=\\=))",
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"match": "(\\^[[:alpha:]0-9'._]+)",
"match": "(\\^[[:alpha:]0-9'._]+)",
"captures": {
"captures": {
"1": {
"1": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"include": "#variables"
"include": "#variables"
},
},
{
{
"include": "#keywords"
"include": "#keywords"
}
}
]
]
},
},
{
{
"begin": "(:)\\s*(\\()",
"begin": "(:)\\s*(\\()",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"2": {
"2": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"end": "(\\)\\s*(([?[:alpha:]0-9'`^._ ]*)))",
"end": "(\\)\\s*(([?[:alpha:]0-9'`^._ ]*)))",
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"2": {
"2": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"include": "#tuple_signature"
"include": "#tuple_signature"
}
}
]
]
},
},
{
{
"begin": "(:)\\s*(\\^[[:alpha:]0-9'._]+)\\s*(when)",
"begin": "(:)\\s*(\\^[[:alpha:]0-9'._]+)\\s*(when)",
"beginCaptures": {
"beginCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"2": {
"2": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
},
},
"3": {
"3": {
"name": "keyword.fsharp"
"name": "keyword.fsharp"
}
}
},
},
"end": "(?=:)",
"end": "(?=:)",
"endCaptures": {
"endCaptures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
}
}
},
},
"patterns": [
"patterns": [
{
{
"name": "keyword.fsharp",
"name": "keyword.fsharp",
"match": "\\b(and|when|or)\\b"
"match": "\\b(and|when|or)\\b"
},
},
{
{
"comment": "Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition",
"comment": "Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition",
"match": "([[:alpha:]0-9'^._]+)",
"match": "([[:alpha:]0-9'^._]+)",
"captures": {
"captures": {
"1": {
"1": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"name": "keyword.symbol.fsharp",
"name": "keyword.symbol.fsharp",
"match": "(\\(|\\))"
"match": "(\\(|\\))"
}
}
]
]
},
},
{
{
"match": "(:)\\s*([?[:alpha:]0-9'`^._ ]+)",
"match": "(:)\\s*([?[:alpha:]0-9'`^._ ]+)",
"captures": {
"captures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"2": {
"2": {
"name": "entity.name.type.fsharp"
"name": "entity.name.type.fsharp"
}
}
}
}
},
},
{
{
"match": "(->)\\s*(\\()?\\s*([?[:alpha:]0-9'`^._ ]+)*",
"match": "(->)\\s*(\\()?\\s*([?[:alpha:]0-9'`^._ ]+)*",
"captures": {
"captures": {
"1": {
"1": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"2": {
"2": {
"name": "keyword.symbol.fsharp"
"name": "keyword.symbol.fsharp"
},
},
"3": {
"3": {
已保存差異
原始文本
開啟檔案
{ "name": "fsharp", "scopeName": "source.fsharp", "fileTypes": [ "fs" ], "foldingStartMarker": "", "foldingStopMarker": "", "patterns": [ { "include": "#compiler_directives" }, { "include": "#comments" }, { "include": "#constants" }, { "include": "#strings" }, { "include": "#chars" }, { "include": "#double_tick" }, { "include": "#definition" }, { "include": "#abstract_definition" }, { "include": "#attributes" }, { "include": "#modules" }, { "include": "#anonymous_functions" }, { "include": "#du_declaration" }, { "include": "#record_declaration" }, { "include": "#records" }, { "include": "#strp_inlined" }, { "include": "#keywords" }, { "include": "#cexprs" }, { "include": "#text" } ], "repository": { "strp_inlined_body": { "patterns": [ { "include": "#comments" }, { "include": "#anonymous_functions" }, { "match": "(\\^[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "name": "keyword.fsharp", "match": "\\b(and|when|or)\\b" }, { "begin": "(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#strp_inlined_body" } ] }, { "match": "(static member|member)\\s*([[:alpha:]0-9'`<>^._]+|``[[:alpha:]0-9' <>^._]+``)\\s*(:)", "captures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "variable.fsharp" }, "3": { "name": "keyword.symbol.fsharp" } } }, { "include": "#compiler_directives" }, { "include": "#constants" }, { "include": "#strings" }, { "include": "#chars" }, { "include": "#double_tick" }, { "include": "#keywords" }, { "include": "#text" }, { "include": "#definition" }, { "include": "#attributes" }, { "include": "#keywords" }, { "include": "#cexprs" }, { "include": "#text" } ] }, "strp_inlined": { "patterns": [ { "begin": "(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#strp_inlined_body" } ] } ] }, "generic_declaration": { "patterns": [ { "comments": "SRTP syntax support", "begin": "(:)\\s*(\\()\\s*(static member|member)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" }, "3": { "name": "keyword.fsharp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "begin": "(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#member_declaration" } ] }, { "match": "(('|\\^)[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#variables" }, { "include": "#keywords" } ] }, { "name": "keyword.fsharp", "match": "\\b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|use|use\\!|struct|while|mutable)(?!')\\b" }, { "name": "keyword.fsharp", "match": ":" }, { "include": "#constants" }, { "match": "(('|\\^)[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "begin": "(<)", "end": "(>)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "(('|\\^)[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#tuple_signature" }, { "include": "#generic_declaration" } ] }, { "match": "(?!when|and|or\\b)\\b([\\w0-9'`^._]+)", "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "match": "(\\|)", "comments": "Prevent captures of `|>` as a keyword when defining custom operator like `<|>`", "captures": { "1": { "name": "keyword.symbol.fsharp" } } }, { "include": "#keywords" } ] }, "record_signature": { "patterns": [ { "match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" } } }, { "begin": "({)", "end": "(})", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" } } }, { "include": "#record_signature" } ] }, { "include": "#keywords" } ] }, "tuple_signature": { "patterns": [ { "match": "(([?[:alpha:]0-9'`^._ ]+))+", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "begin": "(\\()", "end": "(\\))", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "(([?[:alpha:]0-9'`^._ ]+))+", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#tuple_signature" } ] }, { "include": "#keywords" } ] }, "anonymous_functions": { "patterns": [ { "name": "function.anonymous", "begin": "\\b(fun)\\b", "end": "(->)", "beginCaptures": { "1": { "name": "keyword.fsharp" } }, "endCaptures": { "1": { "name": "keyword.fsharp" } }, "patterns": [ { "include": "#comments" }, { "begin": "(\\()", "end": "\\s*(?=(->))", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#member_declaration" } ] }, { "include": "#variables" } ] } ] }, "attributes": { "patterns": [ { "name": "support.function.attribute.fsharp", "begin": "\\[\\<", "end": "\\>\\]|\\]", "patterns": [ { "include": "$self" } ] } ] }, "comments": { "patterns": [ { "name": "comment.block.markdown.fsharp", "begin": "^\\s*(\\(\\*\\*(?!\\)))(?!\\*\\))$", "while": "^(?!\\s*\\*\\)$)", "beginCaptures": { "1": { "name": "comment.block.fsharp" } }, "endCaptures": { "1": { "name": "comment.block.fsharp" } }, "patterns": [ { "include": "text.html.markdown" } ] }, { "name": "comment.block.markdown.fsharp.end", "match": "^(\\s*\\*\\)$)", "captures": { "1": { "name": "comment.block.fsharp" } } }, { "name": "comment.block.fsharp", "begin": "(\\(\\*(?!\\)))", "end": "(\\*\\))", "beginCaptures": { "1": { "name": "comment.block.fsharp" } }, "endCaptures": { "1": { "name": "comment.block.fsharp" } } }, { "name": "comment.line.markdown.fsharp", "begin": "///", "while": "///", "patterns": [ { "include": "text.html.markdown" } ] }, { "name": "comment.line.double-slash.fsharp", "match": "//.*$" } ] }, "constants": { "patterns": [ { "name": "constant.language.unit.fsharp", "match": "\\(\\)" }, { "name": "constant.numeric.floating-point.fsharp", "match": "\\b-?[0-9][0-9_]*((\\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))" }, { "name": "constant.numeric.integer.nativeint.fsharp", "match": "\\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))" }, { "name": "constant.others.fsharp", "match": "\\b(true|false|null|unit)\\b" } ] }, "abstract_definition": { "name": "abstract.definition.fsharp", "begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(:)", "end": "\\s*(with)\\b|=|$", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" }, "3": { "name": "support.function.attribute.fsharp" }, "5": { "name": "keyword.fsharp" } }, "endCaptures": { "1": { "name": "keyword.fsharp" } }, "patterns": [ { "include": "#comments" }, { "include": "#common_declaration" }, { "match": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)(\\s*([[:alpha:]0-9'`^._ ]+)){0,1}", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" }, "3": { "name": "keyword.symbol.fsharp" }, "4": { "name": "entity.name.type.fsharp" } } }, { "match": "(?!with|get|set\\b)\\b([\\w0-9'`^._]+)", "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] }, "common_binding_definition": { "patterns": [ { "include": "#comments" }, { "include": "#attributes" }, { "comments": "SRTP syntax support", "begin": "(:)\\s*(\\()\\s*(static member|member)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" }, "3": { "name": "keyword.fsharp" } }, "end": "(\\))\\s*((?=,)|(?=\\=))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "(\\^[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#variables" }, { "include": "#keywords" } ] }, { "begin": "(:)\\s*(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" } }, "end": "(\\)\\s*(([?[:alpha:]0-9'`^._ ]*)))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" } }, "patterns": [ { "include": "#tuple_signature" } ] }, { "begin": "(:)\\s*(\\^[[:alpha:]0-9'._]+)\\s*(when)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" }, "3": { "name": "keyword.fsharp" } }, "end": "(?=:)", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "name": "keyword.fsharp", "match": "\\b(and|when|or)\\b" }, { "comment": "Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition", "match": "([[:alpha:]0-9'^._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "name": "keyword.symbol.fsharp", "match": "(\\(|\\))" } ] }, { "match": "(:)\\s*([?[:alpha:]0-9'`^._ ]+)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" } } }, { "match": "(->)\\s*(\\()?\\s*([?[:alpha:]0-9'`^._ ]+)*", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" }, "3": { "name": "entity.name.type.fsharp" } } }, { "begin": "(\\*)\\s*(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" } }, "end": "(\\)\\s*(([?[:alpha:]0-9'`^._ ]+))+)", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" } }, "patterns": [ { "include": "#tuple_signature" } ] }, { "match": "(\\*)(\\s*([?[:alpha:]0-9'`^._ ]+))*", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" } } }, { "begin": "(<(?![[:space:]]*\\)))", "beginComment": "The group (?![[:space:]]*\\) is for protection against overload operator. static member (<)", "end": "((?<!:)>)", "endComment": "The group (?<!:) prevent us from stopping on :> when using SRTP synthax", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#generic_declaration" } ] }, { "begin": "({)", "end": "(})", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#record_signature" } ] }, { "include": "#definition" }, { "include": "#variables" }, { "include": "#keywords" } ] }, "definition": { "patterns": [ { "name": "binding.fsharp", "begin": "\\b(let mutable|let inline|let|member val|static member inline|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?", "end": "\\s*(with\\b|=|\\n+=|(?<=\\=))", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" }, "3": { "name": "support.function.attribute.fsharp" }, "4": { "name": "keyword.fsharp" }, "5": { "name": "variable.fsharp" } }, "endCaptures": { "1": { "name": "keyword.fsharp" } }, "patterns": [ { "include": "#common_binding_definition" } ] }, { "name": "binding.fsharp", "begin": "\\b(static val mutable|val mutable|val)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?", "end": "\\n$", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" }, "3": { "name": "support.function.attribute.fsharp" }, "4": { "name": "keyword.fsharp" }, "5": { "name": "variable.fsharp" } }, "patterns": [ { "include": "#common_binding_definition" } ] } ] }, "du_declaration": { "patterns": [ { "name": "du_declaration.fsharp", "begin": "\\b(of)\\b", "end": "$|(\\|)", "beginCaptures": { "1": { "name": "keyword.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#comments" }, { "match": "([[:alpha:]0-9'`<>^._]+|``[[:alpha:]0-9' <>^._]+``)\\s*(:)\\s*([[:alpha:]0-9'`<>^._]+|``[[:alpha:]0-9' <>^._]+``)", "captures": { "1": { "name": "variable.parameter.fsharp" }, "2": { "name": "keyword.symbol.fsharp" }, "3": { "name": "entity.name.type.fsharp" } } }, { "match": "([[:alpha:]0-9'`^._]+)|``([[:alpha:]0-9'^._ ]+)``", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] } ] }, "keywords": { "patterns": [ { "name": "keyword.fsharp", "match": "\\b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|or|use|use\\!|struct|while|mutable)(?!')\\b" }, { "name": "keyword.symbol.fsharp", "match": "(&&&|\\|\\|\\||\\^\\^\\^|~~~|<<<|>>>|\\|>|\\->|\\<\\-|:>|:\\?>|:|\\[|\\]|\\;|<>|=|@|\\|\\||&&|{|}|\\||_|\\.\\.|\\,|\\+|\\-|\\*|\\/|\\^|\\!|\\>|\\>\\=|\\>\\>|\\<|\\<\\=|\\(|\\)|\\<\\<)" } ] }, "modules": { "patterns": [ { "name": "entity.name.section.fsharp", "begin": "\\b(namespace|module)\\s*(public|internal|private)?\\s+([[:alpha:]][[:alpha:]0-9'_. ]*)", "end": "(\\s?=|\\s|$)", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" }, "3": { "name": "entity.name.section.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "name": "entity.name.section.fsharp", "match": "(\\.)([A-Z][[:alpha:]0-9'_]*)", "captures": { "1": { "name": "punctuation.separator.namespace-reference.fsharp" }, "2": { "name": "entity.name.section.fsharp" } } } ] }, { "name": "namespace.open.fsharp", "begin": "\\b(open)\\s+([[:alpha:]][[:alpha:]0-9'_]*)(?=(\\.[A-Z][[:alpha:]0-9_]*)*)", "end": "(\\s|$)", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "entity.name.section.fsharp" } }, "patterns": [ { "name": "entity.name.section.fsharp", "match": "(\\.)([[:alpha:]][[:alpha:]0-9'_]*)", "captures": { "1": { "name": "punctuation.separator.namespace-reference.fsharp" }, "2": { "name": "entity.name.section.fsharp" } } } ] }, { "name": "namespace.alias.fsharp", "begin": "^\\s*(module)\\s+([A-Z][[:alpha:]0-9'_]*)\\s*(=)\\s*([A-Z][[:alpha:]0-9'_]*)", "end": "(\\s|$)", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "entity.name.type.namespace.fsharp" }, "3": { "name": "punctuation.separator.namespace-definition.fsharp" }, "4": { "name": "entity.name.section.fsharp" } }, "patterns": [ { "name": "entity.name.section.fsharp", "match": "(\\.)([A-Z][[:alpha:]0-9'_]*)", "captures": { "1": { "name": "punctuation.separator.namespace-reference.fsharp" }, "2": { "name": "entity.name.section.fsharp" } } } ] } ] }, "strings": { "patterns": [ { "name": "string.quoted.literal.fsharp", "begin": "(?=[^\\\\])(@\")", "end": "(\")(?!\")", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.fsharp" } }, "endCaptures": { "1": { "name": "punctuation.definition.string.end.fsharp" } }, "patterns": [ { "name": "constant.character.string.escape.fsharp", "match": "\"(\")" } ] }, { "name": "string.quoted.triple.fsharp", "begin": "(?=[^\\\\])(\"\"\")", "end": "(\"\"\")", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.fsharp" } }, "endCaptures": { "1": { "name": "punctuation.definition.string.end.fsharp" } }, "patterns": [ { "include": "#string_formatter" } ] }, { "name": "string.quoted.double.fsharp", "begin": "(?=[^\\\\])(\")", "end": "(\")", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.fsharp" } }, "endCaptures": { "1": { "name": "punctuation.definition.string.end.fsharp" } }, "patterns": [ { "name": "punctuation.separator.string.ignore-eol.fsharp", "match": "\\\\$[ \\t]*" }, { "name": "constant.character.string.escape.fsharp", "match": "\\\\([\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})" }, { "name": "invalid.illeagal.character.string.fsharp", "match": "\\\\(?![\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})." }, { "include": "#string_formatter" } ] } ] }, "string_formatter": { "patterns": [ { "name": "entity.name.type.format.specifier.fsharp", "match": "(%0?-?(\\d+)?((a|t)|(\\.\\d+)?(f|F|e|E|g|G|M)|(b|c|s|d|i|x|X|o|u)|(s|b|O)|(\\+?A)))", "captures": { "1": { "name": "keyword.format.specifier.fsharp" } } } ] }, "variables": { "patterns": [ { "name": "constant.language.unit.fsharp", "match": "\\(\\)" }, { "match": "(\\?{0,1})(``[[:alpha:]0-9'`^:,._ ]+``|[[:alpha:]0-9'`<>^._ ]\\w*)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" } } } ] }, "common_declaration": { "patterns": [ { "begin": "\\s*(->)\\s*([[:alpha:]0-9'`^._ ]+)(<)", "end": "(>)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" }, "3": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "([[:alpha:]0-9'`^._ ]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] }, { "match": "\\s*(->)\\s*(?!with|get|set\\b)\\b([\\w0-9'`^._]+)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" } } }, { "begin": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)(\\s*([?[:alpha:]0-9'`^._ ]+)(<))", "end": "(>)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" }, "3": { "name": "keyword.symbol.fsharp" }, "4": { "name": "keyword.symbol.fsharp" }, "5": { "name": "entity.name.type.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "([[:alpha:]0-9'`^._ ]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] } ] }, "member_declaration": { "patterns": [ { "include": "#comments" }, { "include": "#common_declaration" }, { "comments": "SRTP syntax support", "begin": "(:)\\s*(\\()\\s*(static member|member)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" }, "3": { "name": "keyword.fsharp" } }, "end": "(\\))\\s*((?=,)|(?=\\=))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "begin": "(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#member_declaration" } ] }, { "match": "(\\^[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#variables" }, { "include": "#keywords" } ] }, { "match": "(\\^[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "name": "keyword.fsharp", "match": "\\b(and|when|or)\\b" }, { "name": "keyword.symbol.fsharp", "match": "(\\(|\\))" }, { "match": "(\\?{0,1})([[:alpha:]0-9'`^._]+|``[[:alpha:]0-9'`^:,._ ]+``)\\s*(:{0,1})(\\s*([?[:alpha:]0-9'`<>._ ]+)){0,1}", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" }, "3": { "name": "keyword.symbol.fsharp" }, "4": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] }, "double_tick": { "patterns": [ { "name": "variable.other.binding.fsharp", "match": "(``)(.*)(``)", "captures": { "1": { "name": "string.quoted.single.fsharp" }, "2": { "name": "variable.other.binding.fsharp" }, "3": { "name": "string.quoted.single.fsharp" } } } ] }, "records": { "patterns": [ { "name": "record.fsharp", "begin": "\\b(type)[\\s]+(private|internal|public)?\\s*", "end": "\\s*((with)|((as)\\s+([[:alpha:]0-9']+))|(=)|[\\n=]|(\\(\\)))", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" } }, "endCaptures": { "2": { "name": "keyword.fsharp" }, "3": { "name": "keyword.fsharp" }, "4": { "name": "keyword.fsharp" }, "5": { "name": "variable.parameter.fsharp" }, "6": { "name": "keyword.symbol.fsharp" }, "7": { "name": "constant.language.unit.fsharp" } }, "patterns": [ { "include": "#comments" }, { "include": "#attributes" }, { "match": "([[:alpha:]0-9'^._]+|``[[:alpha:]0-9'`^:,._ ]+``)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "begin": "(<)", "end": "((?<!:)>)", "beginCaptures": { "1": { "name": "keyword.fsharp" } }, "endCaptures": { "1": { "name": "keyword.fsharp" } }, "patterns": [ { "match": "(('|\\^)``[[:alpha:]0-9`^:,._ ]+``|('|\\^)[[:alpha:]0-9`^:._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "name": "keyword.fsharp", "match": "\\b(interface|with|abstract|and|when|or|not|struct|equality|comparison|unmanaged|delegate|enum)\\b" }, { "begin": "(\\()", "end": "(\\))", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "(static member|member|new)", "captures": { "1": { "name": "keyword.fsharp" } } }, { "include": "#common_binding_definition" } ] }, { "match": "([\\w0-9'`^._]+)", "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] }, { "match": "\\s*(private|internal|public)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.fsharp" } } }, { "begin": "(\\()", "end": "\\s*(?=(=)|[\\n=]|(\\(\\))|(as))", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#member_declaration" } ] }, { "include": "#keywords" } ] } ] }, "record_declaration": { "patterns": [ { "begin": "(\\{)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(?<=\\})", "patterns": [ { "include": "#comments" }, { "begin": "(((mutable)\\s[[:alpha:]]+)|[[:alpha:]0-9'`<>^._]*)\\s*((?<!:):(?!:))\\s*", "beginCaptures": { "3": { "name": "keyword.fsharp" }, "4": { "name": "keyword.symbol.fsharp" } }, "end": "$|(;|\\})", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#comments" }, { "match": "([[:alpha:]0-9'`^_ ]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] }, { "include": "#compiler_directives" }, { "include": "#constants" }, { "include": "#strings" }, { "include": "#chars" }, { "include": "#double_tick" }, { "include": "#definition" }, { "include": "#attributes" }, { "include": "#anonymous_functions" }, { "include": "#keywords" }, { "include": "#cexprs" }, { "include": "#text" } ] } ] }, "cexprs": { "patterns": [ { "name": "cexpr.fsharp", "match": "\\b(async|seq|promise|task|maybe|asyncMaybe|controller|scope|application|pipeline)\\s*\\{", "captures": { "0": { "name": "keyword.fsharp" } } } ] }, "chars": { "patterns": [ { "name": "char.fsharp", "match": "('\\\\?.')", "captures": { "1": { "name": "string.quoted.single.fsharp" } } } ] }, "text": { "patterns": [ { "name": "text.fsharp", "match": "\\\\" } ] }, "compiler_directives": { "patterns": [ { "name": "compiler_directive.fsharp", "match": "\\s?(#if|#elif|#else|#elseif|#endif|#light|#nowarn)", "captures": {} } ] } } }
更改後文本
開啟檔案
{ "name": "fsharp", "scopeName": "source.fsharp", "fileTypes": [ "fs" ], "foldingStartMarker": "", "foldingStopMarker": "", "patterns": [ { "include": "#compiler_directives" }, { "include": "#comments" }, { "include": "#constants" }, { "include": "#strings" }, { "include": "#chars" }, { "include": "#double_tick" }, { "include": "#definition" }, { "include": "#abstract_definition" }, { "include": "#attributes" }, { "include": "#modules" }, { "include": "#anonymous_functions" }, { "include": "#du_declaration" }, { "include": "#record_declaration" }, { "include": "#records" }, { "include": "#strp_inlined" }, { "include": "#keywords" }, { "include": "#cexprs" }, { "include": "#text" } ], "repository": { "strp_inlined_body": { "patterns": [ { "include": "#comments" }, { "include": "#anonymous_functions" }, { "match": "(\\^[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "name": "keyword.fsharp", "match": "\\b(and|when|or)\\b" }, { "begin": "(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#strp_inlined_body" } ] }, { "match": "(static member|member)\\s*([[:alpha:]0-9'`<>^._]+|``[[:alpha:]0-9' <>^._]+``)\\s*(:)", "captures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "variable.fsharp" }, "3": { "name": "keyword.symbol.fsharp" } } }, { "include": "#compiler_directives" }, { "include": "#constants" }, { "include": "#strings" }, { "include": "#chars" }, { "include": "#double_tick" }, { "include": "#keywords" }, { "include": "#text" }, { "include": "#definition" }, { "include": "#attributes" }, { "include": "#keywords" }, { "include": "#cexprs" }, { "include": "#text" } ] }, "strp_inlined": { "patterns": [ { "begin": "(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#strp_inlined_body" } ] } ] }, "generic_declaration": { "patterns": [ { "comments": "SRTP syntax support", "begin": "(:)\\s*(\\()\\s*(static member|member)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" }, "3": { "name": "keyword.fsharp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "begin": "(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#member_declaration" } ] }, { "match": "(('|\\^)[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#variables" }, { "include": "#keywords" } ] }, { "name": "keyword.fsharp", "match": "\\b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|use|use\\!|struct|while|mutable)(?!')\\b" }, { "name": "keyword.fsharp", "match": ":" }, { "include": "#constants" }, { "match": "(('|\\^)[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "begin": "(<)", "end": "(>)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "(('|\\^)[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#tuple_signature" }, { "include": "#generic_declaration" } ] }, { "match": "(?!when|and|or\\b)\\b([\\w0-9'`^._]+)", "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "match": "(\\|)", "comments": "Prevent captures of `|>` as a keyword when defining custom operator like `<|>`", "captures": { "1": { "name": "keyword.symbol.fsharp" } } }, { "include": "#keywords" } ] }, "record_signature": { "patterns": [ { "match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" } } }, { "begin": "({)", "end": "(})", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" } } }, { "include": "#record_signature" } ] }, { "include": "#keywords" } ] }, "tuple_signature": { "patterns": [ { "match": "(([?[:alpha:]0-9'`^._ ]+))+", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "begin": "(\\()", "end": "(\\))", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "(([?[:alpha:]0-9'`^._ ]+))+", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#tuple_signature" } ] }, { "include": "#keywords" } ] }, "anonymous_functions": { "patterns": [ { "name": "function.anonymous", "begin": "\\b(fun)\\b", "end": "(->)", "beginCaptures": { "1": { "name": "keyword.fsharp" } }, "endCaptures": { "1": { "name": "keyword.fsharp" } }, "patterns": [ { "include": "#comments" }, { "begin": "(\\()", "end": "\\s*(?=(->))", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#member_declaration" } ] }, { "include": "#variables" } ] } ] }, "attributes": { "patterns": [ { "name": "support.function.attribute.fsharp", "begin": "\\[\\<", "end": "\\>\\]|\\]", "patterns": [ { "include": "$self" } ] } ] }, "comments": { "patterns": [ { "name": "comment.block.markdown.fsharp", "begin": "^\\s*(\\(\\*\\*(?!\\)))(?!\\*\\))$", "while": "^(?!\\s*\\*\\)$)", "beginCaptures": { "1": { "name": "comment.block.fsharp" } }, "endCaptures": { "1": { "name": "comment.block.fsharp" } }, "patterns": [ { "include": "text.html.markdown" } ] }, { "name": "comment.block.markdown.fsharp.end", "match": "^(\\s*\\*\\)$)", "captures": { "1": { "name": "comment.block.fsharp" } } }, { "name": "comment.block.fsharp", "begin": "(\\(\\*(?!\\)))", "end": "(\\*\\))", "beginCaptures": { "1": { "name": "comment.block.fsharp" } }, "endCaptures": { "1": { "name": "comment.block.fsharp" } } }, { "name": "comment.line.markdown.fsharp", "begin": "///", "while": "///", "patterns": [ { "include": "text.html.markdown" } ] }, { "name": "comment.line.double-slash.fsharp", "match": "//.*$" } ] }, "constants": { "patterns": [ { "name": "constant.language.unit.fsharp", "match": "\\(\\)" }, { "name": "constant.numeric.floating-point.fsharp", "match": "\\b-?[0-9][0-9_]*((\\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))" }, { "name": "constant.numeric.integer.nativeint.fsharp", "match": "\\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))" }, { "name": "constant.others.fsharp", "match": "\\b(true|false|null|unit)\\b" } ] }, "abstract_definition": { "name": "abstract.definition.fsharp", "begin": "\\b(abstract)\\s+(member)?(\\s+\\[\\<.*\\>\\])?\\s*([_[:alpha:]0-9,\\._`\\s]+)(:)", "end": "\\s*(with)\\b|=|$", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" }, "3": { "name": "support.function.attribute.fsharp" }, "5": { "name": "keyword.fsharp" } }, "endCaptures": { "1": { "name": "keyword.fsharp" } }, "patterns": [ { "include": "#comments" }, { "include": "#common_declaration" }, { "match": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)(\\s*([[:alpha:]0-9'`^._ ]+)){0,1}", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" }, "3": { "name": "keyword.symbol.fsharp" }, "4": { "name": "entity.name.type.fsharp" } } }, { "match": "(?!with|get|set\\b)\\b([\\w0-9'`^._]+)", "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] }, "common_binding_definition": { "patterns": [ { "include": "#comments" }, { "include": "#attributes" }, { "comments": "SRTP syntax support", "begin": "(:)\\s*(\\()\\s*(static member|member)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" }, "3": { "name": "keyword.fsharp" } }, "end": "(\\))\\s*((?=,)|(?=\\=))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "(\\^[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#variables" }, { "include": "#keywords" } ] }, { "begin": "(:)\\s*(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" } }, "end": "(\\)\\s*(([?[:alpha:]0-9'`^._ ]*)))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" } }, "patterns": [ { "include": "#tuple_signature" } ] }, { "begin": "(:)\\s*(\\^[[:alpha:]0-9'._]+)\\s*(when)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" }, "3": { "name": "keyword.fsharp" } }, "end": "(?=:)", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "name": "keyword.fsharp", "match": "\\b(and|when|or)\\b" }, { "comment": "Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition", "match": "([[:alpha:]0-9'^._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "name": "keyword.symbol.fsharp", "match": "(\\(|\\))" } ] }, { "match": "(:)\\s*([?[:alpha:]0-9'`^._ ]+)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" } } }, { "match": "(->)\\s*(\\()?\\s*([?[:alpha:]0-9'`^._ ]+)*", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" }, "3": { "name": "entity.name.type.fsharp" } } }, { "begin": "(\\*)\\s*(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" } }, "end": "(\\)\\s*(([?[:alpha:]0-9'`^._ ]+))+)", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" } }, "patterns": [ { "include": "#tuple_signature" } ] }, { "match": "(\\*)(\\s*([?[:alpha:]0-9'`^._ ]+))*", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" } } }, { "begin": "(<(?![[:space:]]*\\)))", "beginComment": "The group (?![[:space:]]*\\) is for protection against overload operator. static member (<)", "end": "((?<!:)>)", "endComment": "The group (?<!:) prevent us from stopping on :> when using SRTP synthax", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#generic_declaration" } ] }, { "begin": "({)", "end": "(})", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#record_signature" } ] }, { "include": "#definition" }, { "include": "#variables" }, { "include": "#keywords" } ] }, "definition": { "patterns": [ { "name": "binding.fsharp", "begin": "\\b(let mutable|static let mutable|let inline|let|member val|static member inline|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?", "end": "\\s*(with\\b|=|\\n+=|(?<=\\=))", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" }, "3": { "name": "support.function.attribute.fsharp" }, "4": { "name": "keyword.fsharp" }, "5": { "name": "variable.fsharp" } }, "endCaptures": { "1": { "name": "keyword.fsharp" } }, "patterns": [ { "include": "#common_binding_definition" } ] }, { "name": "binding.fsharp", "begin": "\\b(static val mutable|val mutable|val)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?", "end": "\\n$", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" }, "3": { "name": "support.function.attribute.fsharp" }, "4": { "name": "keyword.fsharp" }, "5": { "name": "variable.fsharp" } }, "patterns": [ { "include": "#common_binding_definition" } ] } ] }, "du_declaration": { "patterns": [ { "name": "du_declaration.fsharp", "begin": "\\b(of)\\b", "end": "$|(\\|)", "beginCaptures": { "1": { "name": "keyword.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#comments" }, { "match": "([[:alpha:]0-9'`<>^._]+|``[[:alpha:]0-9' <>^._]+``)\\s*(:)\\s*([[:alpha:]0-9'`<>^._]+|``[[:alpha:]0-9' <>^._]+``)", "captures": { "1": { "name": "variable.parameter.fsharp" }, "2": { "name": "keyword.symbol.fsharp" }, "3": { "name": "entity.name.type.fsharp" } } }, { "match": "([[:alpha:]0-9'`^._]+)|``([[:alpha:]0-9'^._ ]+)``", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] } ] }, "keywords": { "patterns": [ { "name": "keyword.fsharp", "match": "\\b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|or|use|use\\!|struct|while|mutable)(?!')\\b" }, { "name": "keyword.symbol.fsharp", "match": "(&&&|\\|\\|\\||\\^\\^\\^|~~~|<<<|>>>|\\|>|\\->|\\<\\-|:>|:\\?>|:|\\[|\\]|\\;|<>|=|@|\\|\\||&&|{|}|\\||_|\\.\\.|\\,|\\+|\\-|\\*|\\/|\\^|\\!|\\>|\\>\\=|\\>\\>|\\<|\\<\\=|\\(|\\)|\\<\\<)" } ] }, "modules": { "patterns": [ { "name": "entity.name.section.fsharp", "begin": "\\b(namespace|module)\\s*(public|internal|private)?\\s+([[:alpha:]][[:alpha:]0-9'_. ]*)", "end": "(\\s?=|\\s|$)", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" }, "3": { "name": "entity.name.section.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "name": "entity.name.section.fsharp", "match": "(\\.)([A-Z][[:alpha:]0-9'_]*)", "captures": { "1": { "name": "punctuation.separator.namespace-reference.fsharp" }, "2": { "name": "entity.name.section.fsharp" } } } ] }, { "name": "namespace.open.fsharp", "begin": "\\b(open)\\s+([[:alpha:]][[:alpha:]0-9'_]*)(?=(\\.[A-Z][[:alpha:]0-9_]*)*)", "end": "(\\s|$)", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "entity.name.section.fsharp" } }, "patterns": [ { "name": "entity.name.section.fsharp", "match": "(\\.)([[:alpha:]][[:alpha:]0-9'_]*)", "captures": { "1": { "name": "punctuation.separator.namespace-reference.fsharp" }, "2": { "name": "entity.name.section.fsharp" } } } ] }, { "name": "namespace.alias.fsharp", "begin": "^\\s*(module)\\s+([A-Z][[:alpha:]0-9'_]*)\\s*(=)\\s*([A-Z][[:alpha:]0-9'_]*)", "end": "(\\s|$)", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "entity.name.type.namespace.fsharp" }, "3": { "name": "punctuation.separator.namespace-definition.fsharp" }, "4": { "name": "entity.name.section.fsharp" } }, "patterns": [ { "name": "entity.name.section.fsharp", "match": "(\\.)([A-Z][[:alpha:]0-9'_]*)", "captures": { "1": { "name": "punctuation.separator.namespace-reference.fsharp" }, "2": { "name": "entity.name.section.fsharp" } } } ] } ] }, "strings": { "patterns": [ { "name": "string.quoted.literal.fsharp", "begin": "(?=[^\\\\])(@\")", "end": "(\")(?!\")", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.fsharp" } }, "endCaptures": { "1": { "name": "punctuation.definition.string.end.fsharp" } }, "patterns": [ { "name": "constant.character.string.escape.fsharp", "match": "\"(\")" } ] }, { "name": "string.quoted.triple.fsharp", "begin": "(?=[^\\\\])(\"\"\")", "end": "(\"\"\")", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.fsharp" } }, "endCaptures": { "1": { "name": "punctuation.definition.string.end.fsharp" } }, "patterns": [ { "include": "#string_formatter" } ] }, { "name": "string.quoted.double.fsharp", "begin": "(?=[^\\\\])(\")", "end": "(\")", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.fsharp" } }, "endCaptures": { "1": { "name": "punctuation.definition.string.end.fsharp" } }, "patterns": [ { "name": "punctuation.separator.string.ignore-eol.fsharp", "match": "\\\\$[ \\t]*" }, { "name": "constant.character.string.escape.fsharp", "match": "\\\\([\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})" }, { "name": "invalid.illeagal.character.string.fsharp", "match": "\\\\(?![\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})." }, { "include": "#string_formatter" } ] } ] }, "string_formatter": { "patterns": [ { "name": "entity.name.type.format.specifier.fsharp", "match": "(%0?-?(\\d+)?((a|t)|(\\.\\d+)?(f|F|e|E|g|G|M)|(b|c|s|d|i|x|X|o|u)|(s|b|O)|(\\+?A)))", "captures": { "1": { "name": "keyword.format.specifier.fsharp" } } } ] }, "variables": { "patterns": [ { "name": "constant.language.unit.fsharp", "match": "\\(\\)" }, { "match": "(\\?{0,1})(``[[:alpha:]0-9'`^:,._ ]+``|[[:alpha:]0-9'`<>^._ ]\\w*)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" } } } ] }, "common_declaration": { "patterns": [ { "begin": "\\s*(->)\\s*([[:alpha:]0-9'`^._ ]+)(<)", "end": "(>)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" }, "3": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "([[:alpha:]0-9'`^._ ]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] }, { "match": "\\s*(->)\\s*(?!with|get|set\\b)\\b([\\w0-9'`^._]+)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "entity.name.type.fsharp" } } }, { "begin": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)(\\s*([?[:alpha:]0-9'`^._ ]+)(<))", "end": "(>)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" }, "3": { "name": "keyword.symbol.fsharp" }, "4": { "name": "keyword.symbol.fsharp" }, "5": { "name": "entity.name.type.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "([[:alpha:]0-9'`^._ ]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] } ] }, "member_declaration": { "patterns": [ { "include": "#comments" }, { "include": "#common_declaration" }, { "comments": "SRTP syntax support", "begin": "(:)\\s*(\\()\\s*(static member|member)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.symbol.fsharp" }, "3": { "name": "keyword.fsharp" } }, "end": "(\\))\\s*((?=,)|(?=\\=))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "begin": "(\\()", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#member_declaration" } ] }, { "match": "(\\^[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#variables" }, { "include": "#keywords" } ] }, { "match": "(\\^[[:alpha:]0-9'._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "name": "keyword.fsharp", "match": "\\b(and|when|or)\\b" }, { "name": "keyword.symbol.fsharp", "match": "(\\(|\\))" }, { "match": "(\\?{0,1})([[:alpha:]0-9'`^._]+|``[[:alpha:]0-9'`^:,._ ]+``)\\s*(:{0,1})(\\s*([?[:alpha:]0-9'`<>._ ]+)){0,1}", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "variable.parameter.fsharp" }, "3": { "name": "keyword.symbol.fsharp" }, "4": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] }, "double_tick": { "patterns": [ { "name": "variable.other.binding.fsharp", "match": "(``)(.*)(``)", "captures": { "1": { "name": "string.quoted.single.fsharp" }, "2": { "name": "variable.other.binding.fsharp" }, "3": { "name": "string.quoted.single.fsharp" } } } ] }, "records": { "patterns": [ { "name": "record.fsharp", "begin": "\\b(type)[\\s]+(private|internal|public)?\\s*", "end": "\\s*((with)|((as)\\s+([[:alpha:]0-9']+))|(=)|[\\n=]|(\\(\\)))", "beginCaptures": { "1": { "name": "keyword.fsharp" }, "2": { "name": "keyword.fsharp" } }, "endCaptures": { "2": { "name": "keyword.fsharp" }, "3": { "name": "keyword.fsharp" }, "4": { "name": "keyword.fsharp" }, "5": { "name": "variable.parameter.fsharp" }, "6": { "name": "keyword.symbol.fsharp" }, "7": { "name": "constant.language.unit.fsharp" } }, "patterns": [ { "include": "#comments" }, { "include": "#attributes" }, { "match": "([[:alpha:]0-9'^._]+|``[[:alpha:]0-9'`^:,._ ]+``)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "begin": "(<)", "end": "((?<!:)>)", "beginCaptures": { "1": { "name": "keyword.fsharp" } }, "endCaptures": { "1": { "name": "keyword.fsharp" } }, "patterns": [ { "match": "(('|\\^)``[[:alpha:]0-9`^:,._ ]+``|('|\\^)[[:alpha:]0-9`^:._]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "name": "keyword.fsharp", "match": "\\b(interface|with|abstract|and|when|or|not|struct|equality|comparison|unmanaged|delegate|enum)\\b" }, { "begin": "(\\()", "end": "(\\))", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "match": "(static member|member|new)", "captures": { "1": { "name": "keyword.fsharp" } } }, { "include": "#common_binding_definition" } ] }, { "match": "([\\w0-9'`^._]+)", "comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] }, { "match": "\\s*(private|internal|public)", "captures": { "1": { "name": "keyword.symbol.fsharp" }, "2": { "name": "keyword.fsharp" } } }, { "begin": "(\\()", "end": "\\s*(?=(=)|[\\n=]|(\\(\\))|(as))", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#member_declaration" } ] }, { "include": "#keywords" } ] } ] }, "record_declaration": { "patterns": [ { "begin": "(\\{)", "beginCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "end": "(?<=\\})", "patterns": [ { "include": "#comments" }, { "begin": "(((mutable)\\s[[:alpha:]]+)|[[:alpha:]0-9'`<>^._]*)\\s*((?<!:):(?!:))\\s*", "beginCaptures": { "3": { "name": "keyword.fsharp" }, "4": { "name": "keyword.symbol.fsharp" } }, "end": "$|(;|\\})", "endCaptures": { "1": { "name": "keyword.symbol.fsharp" } }, "patterns": [ { "include": "#comments" }, { "match": "([[:alpha:]0-9'`^_ ]+)", "captures": { "1": { "name": "entity.name.type.fsharp" } } }, { "include": "#keywords" } ] }, { "include": "#compiler_directives" }, { "include": "#constants" }, { "include": "#strings" }, { "include": "#chars" }, { "include": "#double_tick" }, { "include": "#definition" }, { "include": "#attributes" }, { "include": "#anonymous_functions" }, { "include": "#keywords" }, { "include": "#cexprs" }, { "include": "#text" } ] } ] }, "cexprs": { "patterns": [ { "name": "cexpr.fsharp", "match": "\\b(async|seq|promise|task|maybe|asyncMaybe|controller|scope|application|pipeline)\\s*\\{", "captures": { "0": { "name": "keyword.fsharp" } } } ] }, "chars": { "patterns": [ { "name": "char.fsharp", "match": "('\\\\?.')", "captures": { "1": { "name": "string.quoted.single.fsharp" } } } ] }, "text": { "patterns": [ { "name": "text.fsharp", "match": "\\\\" } ] }, "compiler_directives": { "patterns": [ { "name": "compiler_directive.fsharp", "match": "\\s?(#if|#elif|#else|#elseif|#endif|#light|#nowarn)", "captures": {} } ] } } }
尋找差異