|
4 | 4 | "If you want to provide a fix or improvement, please create a pull request against the original repository.", |
5 | 5 | "Once accepted there, we are happy to receive an update request." |
6 | 6 | ], |
7 | | - "version": "https://github.com/ionide/ionide-fsgrammar/commit/e15bff40cf4bc42c82bcbdb2a836e4b944b3ef3e", |
| 7 | + "version": "https://github.com/ionide/ionide-fsgrammar/commit/bd8d1225f93894a50bc8da6f5a76409b024d3d22", |
8 | 8 | "name": "fsharp", |
9 | 9 | "scopeName": "source.fsharp", |
10 | 10 | "patterns": [ |
|
41 | 41 | { |
42 | 42 | "include": "#anonymous_functions" |
43 | 43 | }, |
| 44 | + { |
| 45 | + "include": "#du_declaration" |
| 46 | + }, |
44 | 47 | { |
45 | 48 | "include": "#keywords" |
46 | 49 | }, |
|
95 | 98 | }, |
96 | 99 | "comments": { |
97 | 100 | "patterns": [ |
| 101 | + { |
| 102 | + "name": "comment.block.markdown.fsharp", |
| 103 | + "begin": "^\\s*(\\(\\*\\*(?!\\)))(?!\\*\\))$", |
| 104 | + "while": "^(?!\\s*\\*\\)$)", |
| 105 | + "beginCaptures": { |
| 106 | + "1": { |
| 107 | + "name": "comment.block.fsharp" |
| 108 | + } |
| 109 | + }, |
| 110 | + "endCaptures": { |
| 111 | + "1": { |
| 112 | + "name": "comment.block.fsharp" |
| 113 | + } |
| 114 | + }, |
| 115 | + "patterns": [ |
| 116 | + { |
| 117 | + "include": "text.html.markdown" |
| 118 | + } |
| 119 | + ] |
| 120 | + }, |
| 121 | + { |
| 122 | + "name": "comment.block.markdown.fsharp.end", |
| 123 | + "match": "^(\\s*\\*\\)$)", |
| 124 | + "captures": { |
| 125 | + "1": { |
| 126 | + "name": "comment.block.fsharp" |
| 127 | + } |
| 128 | + } |
| 129 | + }, |
98 | 130 | { |
99 | 131 | "name": "comment.block.fsharp", |
100 | 132 | "begin": "(\\(\\*(?!\\)))", |
|
110 | 142 | } |
111 | 143 | } |
112 | 144 | }, |
| 145 | + { |
| 146 | + "name": "comment.line.markdown.fsharp", |
| 147 | + "begin": "///", |
| 148 | + "while": "///", |
| 149 | + "patterns": [ |
| 150 | + { |
| 151 | + "include": "text.html.markdown" |
| 152 | + } |
| 153 | + ] |
| 154 | + }, |
113 | 155 | { |
114 | 156 | "name": "comment.line.double-slash.fsharp", |
115 | 157 | "match": "//.*$" |
|
140 | 182 | "patterns": [ |
141 | 183 | { |
142 | 184 | "name": "binding.fsharp", |
143 | | - "begin": "\\b(val mutable|val|let mutable|let inline|let|member|static member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\([^-]*\\)|\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]|(?<=,)\\s)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]|(?<=,)\\s)*)", |
144 | | - "end": "((``.*``)|(with)|=|$)", |
| 185 | + "begin": "\\b(val mutable|val|let mutable|let inline|let|member|static member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]|(?<=,)\\s)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]|(?<=,)\\s)*)?", |
| 186 | + "end": "((``.*``)|(with)\\b|=|$)", |
145 | 187 | "beginCaptures": { |
146 | 188 | "1": { |
147 | 189 | "name": "keyword.other.binding.fsharp" |
|
173 | 215 | "patterns": [ |
174 | 216 | { |
175 | 217 | "include": "#variables" |
| 218 | + }, |
| 219 | + { |
| 220 | + "include": "#member_declaration" |
| 221 | + }, |
| 222 | + { |
| 223 | + "match": "(:)(\\s*([?[:alpha:]0-9'<>^._ ]+))*", |
| 224 | + "captures": { |
| 225 | + "1": { |
| 226 | + "name": "keyword.other.fsharp" |
| 227 | + }, |
| 228 | + "2": { |
| 229 | + "name": "entity.name.type.fsharp" |
| 230 | + } |
| 231 | + } |
| 232 | + } |
| 233 | + ] |
| 234 | + } |
| 235 | + ] |
| 236 | + }, |
| 237 | + "du_declaration": { |
| 238 | + "patterns": [ |
| 239 | + { |
| 240 | + "name": "du_declaration.fsharp", |
| 241 | + "begin": "\\b(of)\\b", |
| 242 | + "end": "$|(\\|)", |
| 243 | + "beginCaptures": { |
| 244 | + "1": { |
| 245 | + "name": "keyword.other.fsharp" |
| 246 | + } |
| 247 | + }, |
| 248 | + "endCaptures": { |
| 249 | + "1": { |
| 250 | + "name": "keyword.other.fsharp" |
| 251 | + } |
| 252 | + }, |
| 253 | + "patterns": [ |
| 254 | + { |
| 255 | + "match": "([[:alpha:]0-9'`<>^._]+)\\s*(:)\\s*([[:alpha:]0-9'`<>^._]+)", |
| 256 | + "captures": { |
| 257 | + "1": { |
| 258 | + "name": "variable.parameter.fsharp" |
| 259 | + }, |
| 260 | + "2": { |
| 261 | + "name": "keyword.other.fsharp" |
| 262 | + }, |
| 263 | + "3": { |
| 264 | + "name": "entity.name.type.fsharp" |
| 265 | + } |
| 266 | + } |
| 267 | + }, |
| 268 | + { |
| 269 | + "match": "([[:alpha:]0-9'`<>^._]+)", |
| 270 | + "captures": { |
| 271 | + "1": { |
| 272 | + "name": "entity.name.type.fsharp" |
| 273 | + } |
| 274 | + } |
| 275 | + }, |
| 276 | + { |
| 277 | + "begin": "\\(", |
| 278 | + "end": "\\)", |
| 279 | + "match": "([[:alpha:]0-9'`<>^._]+)", |
| 280 | + "captures": { |
| 281 | + "1": { |
| 282 | + "name": "entity.name.type.fsharp" |
| 283 | + } |
| 284 | + } |
| 285 | + }, |
| 286 | + { |
| 287 | + "include": "#keywords" |
176 | 288 | } |
177 | 289 | ] |
178 | 290 | } |
|
182 | 294 | "patterns": [ |
183 | 295 | { |
184 | 296 | "name": "keyword.other.fsharp", |
185 | | - "match": "\\b(function|yield!|yield|class|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" |
| 297 | + "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" |
186 | 298 | }, |
187 | 299 | { |
188 | 300 | "name": "meta.preprocessor.fsharp", |
|
391 | 503 | } |
392 | 504 | ] |
393 | 505 | }, |
| 506 | + "member_declaration": { |
| 507 | + "patterns": [ |
| 508 | + { |
| 509 | + "begin": "\\(", |
| 510 | + "end": "\\)", |
| 511 | + "patterns": [ |
| 512 | + { |
| 513 | + "match": "\\?{0,1}([[:alpha:]0-9'`<>^._]+)\\s*(:{0,1})(\\s*([?[:alpha:]0-9'<>^._ ]+)){0,1}", |
| 514 | + "captures": { |
| 515 | + "1": { |
| 516 | + "name": "variable.parameter.fsharp" |
| 517 | + }, |
| 518 | + "2": { |
| 519 | + "name": "keyword.other.fsharp" |
| 520 | + }, |
| 521 | + "3": { |
| 522 | + "name": "entity.name.type.fsharp" |
| 523 | + } |
| 524 | + } |
| 525 | + } |
| 526 | + ] |
| 527 | + } |
| 528 | + ] |
| 529 | + }, |
394 | 530 | "double_tick": { |
395 | 531 | "patterns": [ |
396 | 532 | { |
|
414 | 550 | "patterns": [ |
415 | 551 | { |
416 | 552 | "name": "record.fsharp", |
417 | | - "match": "(type)[\\s]+(private|internal|public)?[\\s]*([[:alpha:]0-9'<>^:,._]+)[\\s]*(\\([[:alpha:]0-9'<>^:,._ ]+\\))?[\\s]*((with)|(as [[:alpha:]0-9']+)|(=)|(\\(\\)))", |
418 | | - "captures": { |
| 553 | + "begin": "(type)[\\s]+(private|internal|public)?[\\s]*([[:alpha:]0-9'<>^:,._]+)[\\s]?(private|internal|public)?[\\s]*", |
| 554 | + "end": "[\\s]*((with)|((as) ([[:alpha:]0-9']+))|(=)|[\\n=]|(\\(\\)))", |
| 555 | + "beginCaptures": { |
419 | 556 | "1": { |
420 | 557 | "name": "keyword.other.fsharp" |
421 | 558 | }, |
|
426 | 563 | "name": "entity.name.type.fsharp" |
427 | 564 | }, |
428 | 565 | "4": { |
429 | | - "name": "entity.name.type.fsharp" |
| 566 | + "name": "keyword.other.fsharp" |
| 567 | + } |
| 568 | + }, |
| 569 | + "endCaptures": { |
| 570 | + "2": { |
| 571 | + "name": "keyword.other.fsharp" |
430 | 572 | }, |
431 | | - "6": { |
| 573 | + "3": { |
432 | 574 | "name": "keyword.other.fsharp" |
433 | 575 | }, |
434 | | - "7": { |
| 576 | + "4": { |
435 | 577 | "name": "keyword.other.fsharp" |
436 | 578 | }, |
437 | | - "8": { |
| 579 | + "5": { |
| 580 | + "name": "variable.parameter.fsharp" |
| 581 | + }, |
| 582 | + "6": { |
438 | 583 | "name": "keyword.other.fsharp" |
439 | 584 | }, |
440 | | - "9": { |
| 585 | + "7": { |
441 | 586 | "name": "constant.language.unit.fsharp" |
442 | 587 | } |
443 | | - } |
| 588 | + }, |
| 589 | + "patterns": [ |
| 590 | + { |
| 591 | + "include": "#member_declaration" |
| 592 | + } |
| 593 | + ] |
444 | 594 | } |
445 | 595 | ] |
446 | 596 | }, |
447 | 597 | "cexprs": { |
448 | 598 | "patterns": [ |
449 | 599 | { |
450 | 600 | "name": "cexpr.fsharp", |
451 | | - "match": "\\b([[:alpha:]]*\\s+\\{)", |
| 601 | + "match": "\\b(async|seq|promise|task|maybe|asyncMaybe|controller|scope|application|pipeline)\\s*\\{", |
452 | 602 | "captures": { |
453 | | - "1": { |
| 603 | + "0": { |
454 | 604 | "name": "keyword.other.fsharp" |
455 | 605 | } |
456 | 606 | } |
|
0 commit comments