├── .gitattributes ├── .gitignore ├── Comment.tmPreferences ├── README.md ├── Require.sublime-snippet ├── ScriptCs.sublime-build ├── ScriptCs.tmLanguage ├── class.sublime-snippet ├── ctor.sublime-snippet ├── cw.sublime-snippet ├── else.sublime-snippet ├── enum.sublime-snippet ├── fn.sublime-snippet ├── foreach.sublime-snippet ├── if.sublime-snippet ├── interface.sublime-snippet ├── license.txt ├── prop.sublime-snippet ├── try.sublime-snippet └── using.sublime-snippet /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[cod] 2 | 3 | # C extensions 4 | *.so 5 | 6 | # Packages 7 | *.egg 8 | *.egg-info 9 | dist 10 | build 11 | eggs 12 | parts 13 | bin 14 | var 15 | sdist 16 | develop-eggs 17 | .installed.cfg 18 | lib 19 | lib64 20 | __pycache__ 21 | 22 | # Installer logs 23 | pip-log.txt 24 | 25 | # Unit test / coverage reports 26 | .coverage 27 | .tox 28 | nosetests.xml 29 | 30 | # Translations 31 | *.mo 32 | 33 | # Mr Developer 34 | .mr.developer.cfg 35 | .project 36 | .pydevproject 37 | 38 | # Sublime Text 39 | *.cache -------------------------------------------------------------------------------- /Comment.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Comment 7 | scope 8 | source.csx 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | // 18 | 19 | 20 | 21 | uuid 22 | 40910C79-E8F5-4930-8493-EC63AC6AAF0F 23 | 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | scriptcs-sublime 2 | ================ 3 | 4 | Sublime Text plug-in for scriptcs. 5 | 6 | ## Installation 7 | The easiest way to install scriptcs-sublime is via the Package Control Plugin. 8 | 9 | You can also install it from source, by simply going to your packages directory and type: ``git clone https://github.com/scriptcs/scriptcs-sublime.git``. 10 | 11 | To update to the latest version, use this command in the ``scriptcs-sublime`` directory: ``git pull origin master``. 12 | 13 | ## Usage 14 | Once installed, Sublime Text should recognize ``.csx`` files, and give you syntax highlighting. It also comes with a build system. To build and run hit CMD + B on Mac, or CTRL + B on Windows. 15 | 16 | ``scriptcs.exe`` must be in your ``PATH`` for the build system to work. 17 | 18 | If your script has any compilation errors you can hit F4 to navigate to the error. 19 | 20 | You can also select a block of code and use the ``Edit - Comment - Toggle Comment`` command. 21 | -------------------------------------------------------------------------------- /Require.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | (); 4 | ]]> 5 | req 6 | source.csx 7 | 8 | -------------------------------------------------------------------------------- /ScriptCs.sublime-build: -------------------------------------------------------------------------------- 1 | { 2 | "cmd": ["scriptcs", "-script", "$file", "-cache", "false"], 3 | "file_regex": "^(.*?)\\(([0-9]+),([0-9]+)\\): ([^\\[]+)", 4 | "selector": "source.csx", 5 | 6 | "windows": { 7 | "shell": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ScriptCs.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | csx 8 | 9 | foldingStartMarker 10 | ^\s*/\*|^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S)) 11 | foldingStopMarker 12 | ^\s*\*/|^\s*\} 13 | keyEquivalent 14 | ^~C 15 | name 16 | ScriptCs 17 | patterns 18 | 19 | 20 | begin 21 | /// 22 | captures 23 | 24 | 0 25 | 26 | name 27 | punctuation.definition.comment.source.cs 28 | 29 | 30 | end 31 | $\n? 32 | name 33 | comment.block.documentation.source.cs 34 | patterns 35 | 36 | 37 | begin 38 | (</?)(?:([-_a-zA-Z0-9]+)((:)))?([-_a-zA-Z0-9:]+) 39 | captures 40 | 41 | 1 42 | 43 | name 44 | punctuation.definition.tag.source.cs 45 | 46 | 2 47 | 48 | name 49 | entity.name.tag.namespace.source.cs 50 | 51 | 3 52 | 53 | name 54 | entity.name.tag.source.cs 55 | 56 | 4 57 | 58 | name 59 | punctuation.separator.namespace.source.cs 60 | 61 | 5 62 | 63 | name 64 | entity.name.tag.localname.source.cs 65 | 66 | 67 | end 68 | (/?>) 69 | name 70 | keyword.other.documentation.source.cs 71 | patterns 72 | 73 | 74 | captures 75 | 76 | 1 77 | 78 | name 79 | entity.other.attribute-name.namespace.source.cs 80 | 81 | 2 82 | 83 | name 84 | entity.other.attribute-name.source.cs 85 | 86 | 3 87 | 88 | name 89 | punctuation.separator.namespace.source.cs 90 | 91 | 4 92 | 93 | name 94 | entity.other.attribute-name.localname.source.cs 95 | 96 | 97 | match 98 | (?:([-_a-zA-Z0-9]+)((:)))?([_a-zA-Z-]+)= 99 | 100 | 101 | include 102 | #doubleQuotedString 103 | 104 | 105 | include 106 | #singleQuotedString 107 | 108 | 109 | 110 | 111 | 112 | 113 | include 114 | #comments 115 | 116 | 117 | begin 118 | (?x)^\s* 119 | ((?:\b(?:new|public|protected|internal|private|abstract|sealed|static)\b\s)*) 120 | (class)\s+ 121 | ([A-Za-z_]\w+)\b 122 | captures 123 | 124 | 1 125 | 126 | name 127 | storage.modifier.source.cs 128 | 129 | 2 130 | 131 | name 132 | storage.type.source.cs 133 | 134 | 3 135 | 136 | name 137 | entity.name.type.class.source.cs 138 | 139 | 140 | end 141 | { 142 | name 143 | meta.definition.class.source.cs 144 | patterns 145 | 146 | 147 | include 148 | #classInheritance 149 | 150 | 151 | 152 | 156 | 238 | 239 | match 240 | \b(true|false|null|this|base)\b 241 | name 242 | constant.language.source.cs 243 | 244 | 245 | match 246 | \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b 247 | name 248 | constant.numeric.source.cs 249 | 250 | 251 | match 252 | \b(if|else|while|for|foreach|do|return|continue|break|switch|case|default|goto|throw|try|catch|finally|lock|yield|var|async|await)\b 253 | name 254 | keyword.control.source.cs 255 | 256 | 257 | match 258 | \b(new|is|checked|unchecked|typeof|sizeof|override|in|out|ref|readonly|params|stackalloc|as)\b 259 | name 260 | keyword.operator.source.cs 261 | 262 | 263 | match 264 | \b(event|delegate|explicit|implicit|in|set|get)\b 265 | name 266 | keyword.other.source.cs 267 | 268 | 269 | match 270 | \b(internal|public|protected|private|static|const|new|sealed|abstract|override|extern|unsafe|readonly|volatile|operator)\b 271 | name 272 | storage.modifier.source.cs 273 | 274 | 275 | include 276 | #doubleQuotedStringLiteral 277 | 278 | 279 | include 280 | #doubleQuotedString 281 | 282 | 283 | include 284 | #singleQuotedString 285 | 286 | 287 | captures 288 | 289 | 1 290 | 291 | name 292 | keyword.other.using.source.cs 293 | 294 | 2 295 | 296 | name 297 | entity.name.type.package.source.cs 298 | 299 | 300 | match 301 | ^\s*(using)\s+([^ ;]*); 302 | name 303 | meta.keyword.using.source.cs 304 | 305 | 306 | include 307 | #builtinTypes 308 | 309 | 310 | captures 311 | 312 | 1 313 | 314 | name 315 | keyword.other.namespace.source.cs 316 | 317 | 2 318 | 319 | name 320 | entity.name.type.namespace.source.cs 321 | 322 | 323 | match 324 | ^\s*(namespace)\s+([^ ]+)(?:\s*{)?$ 325 | name 326 | meta.keyword.namespace.source.cs 327 | 328 | 329 | captures 330 | 331 | 2 332 | 333 | name 334 | keyword.control.import.source.cs 335 | 336 | 337 | match 338 | ^(#)\s*(if|else|elif|endif|define|undef|warning|error|line|region|endregion|load|r)\b 339 | name 340 | meta.preprocessor.source.cs 341 | 342 | 343 | repository 344 | 345 | builtinTypes 346 | 347 | patterns 348 | 349 | 350 | match 351 | \b(bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|object|short|ushort|string|void|class|struct|enum|interface)\b 352 | name 353 | storage.type.source.cs 354 | 355 | 356 | 357 | classInheritance 358 | 359 | patterns 360 | 361 | 362 | begin 363 | : 364 | end 365 | (?={) 366 | patterns 367 | 368 | 369 | captures 370 | 371 | 1 372 | 373 | name 374 | storage.type.source.cs 375 | 376 | 377 | match 378 | \s*,?([A-Za-z_]\w*)\b 379 | 380 | 381 | 382 | 383 | 384 | comments 385 | 386 | patterns 387 | 388 | 389 | begin 390 | /\* 391 | captures 392 | 393 | 0 394 | 395 | name 396 | punctuation.definition.comment.source.cs 397 | 398 | 399 | end 400 | \*/\n? 401 | name 402 | comment.block.source.cs 403 | 404 | 405 | captures 406 | 407 | 1 408 | 409 | name 410 | punctuation.definition.comment.source.cs 411 | 412 | 413 | match 414 | (//).*$\n? 415 | name 416 | comment.line.double-slash.source.cs 417 | 418 | 419 | 420 | doubleQuotedString 421 | 422 | begin 423 | " 424 | beginCaptures 425 | 426 | 0 427 | 428 | name 429 | punctuation.definition.string.begin.source.cs 430 | 431 | 432 | end 433 | " 434 | endCaptures 435 | 436 | 0 437 | 438 | name 439 | punctuation.definition.string.end.source.cs 440 | 441 | 442 | name 443 | string.quoted.double.source.cs 444 | patterns 445 | 446 | 447 | match 448 | \\. 449 | name 450 | constant.character.escape.source.cs 451 | 452 | 453 | 454 | doubleQuotedStringLiteral 455 | 456 | captures 457 | 458 | 0 459 | 460 | name 461 | punctuation.definition.string.begin.source.cs 462 | 463 | 464 | match 465 | @"([^"]|"")*" 466 | name 467 | string.quoted.double.literal.source.cs 468 | 469 | singleQuotedString 470 | 471 | begin 472 | ' 473 | beginCaptures 474 | 475 | 0 476 | 477 | name 478 | punctuation.definition.string.begin.source.cs 479 | 480 | 481 | end 482 | ' 483 | endCaptures 484 | 485 | 0 486 | 487 | name 488 | punctuation.definition.string.end.source.cs 489 | 490 | 491 | name 492 | string.quoted.single.xml 493 | patterns 494 | 495 | 496 | match 497 | \\. 498 | name 499 | constant.character.escape.source.cs 500 | 501 | 502 | 503 | statementRemainder 504 | 505 | patterns 506 | 507 | 508 | begin 509 | \( 510 | end 511 | (?=\)) 512 | name 513 | meta.definition.param-list.source.cs 514 | patterns 515 | 516 | 517 | include 518 | #builtinTypes 519 | 520 | 521 | 522 | 523 | 524 | 525 | scopeName 526 | source.csx 527 | uuid 528 | 887420AD-8A8D-4654-9EEC-7DB0FFB80CEA 529 | 530 | 531 | -------------------------------------------------------------------------------- /class.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | class 8 | source.csx 9 | 10 | -------------------------------------------------------------------------------- /ctor.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | ctor 8 | source.csx 9 | 10 | -------------------------------------------------------------------------------- /cw.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | cw 6 | source.csx 7 | 8 | -------------------------------------------------------------------------------- /else.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | else 8 | source.csx 9 | 10 | -------------------------------------------------------------------------------- /enum.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | enum 8 | source.csx 9 | 10 | -------------------------------------------------------------------------------- /fn.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | fn 8 | source.csx 9 | 10 | -------------------------------------------------------------------------------- /foreach.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | foreach 8 | source.csx 9 | 10 | -------------------------------------------------------------------------------- /if.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | if 8 | source.csx 9 | 10 | -------------------------------------------------------------------------------- /interface.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | interface 8 | source.csx 9 | 10 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS -------------------------------------------------------------------------------- /prop.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | prop 7 | 8 | source.csx 9 | 10 | -------------------------------------------------------------------------------- /try.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 9 | try 10 | source.csx 11 | 12 | -------------------------------------------------------------------------------- /using.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | using 8 | source.csx 9 | 10 | --------------------------------------------------------------------------------