├── CHANGELOG.md ├── .vscode └── launch.json ├── syntaxes ├── cos1.tmLanguage.json └── cos.tmLanguage.json ├── package.json ├── language-configuration.json ├── vsc-extension-quickstart.md └── README.md /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to the "intersystems-cos" extension will be documented in this file. 3 | 4 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. 5 | 6 | ## [Unreleased] 7 | - Initial release -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [ 5 | { 6 | "name": "Launch Extension", 7 | "type": "extensionHost", 8 | "request": "launch", 9 | "runtimeExecutable": "${execPath}", 10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /syntaxes/cos1.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", 3 | "name": "CacheObjectScript", 4 | "patterns": [ 5 | { 6 | "include": "#keywords" 7 | }, 8 | { 9 | "include": "#strings" 10 | } 11 | ], 12 | "repository": { 13 | "keywords": { 14 | "patterns": [{ 15 | "name": "keyword.control.cos", 16 | "match": "\\b(if|while|for|return)\\b" 17 | }] 18 | }, 19 | "strings": { 20 | "name": "string.quoted.double.cos", 21 | "begin": "\"", 22 | "end": "\"", 23 | "patterns": [ 24 | { 25 | "name": "constant.character.escape.cos", 26 | "match": "\\\\." 27 | } 28 | ] 29 | } 30 | }, 31 | "scopeName": "source.cos" 32 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "doublefint-cos", 3 | "displayName": "doublefint-cos", 4 | "description": "", 5 | "version": "0.0.1", 6 | "publisher": "doublefint", 7 | "engines": { 8 | "vscode": "^1.5.0" 9 | }, 10 | "categories": [ 11 | "Languages" 12 | ], 13 | "contributes": { 14 | "languages": [{ 15 | "id": "cos", 16 | "aliases": ["CacheObjectScript", "cos"], 17 | "extensions": [".cls"], 18 | "configuration": "./language-configuration.json" 19 | }], 20 | "grammars": [{ 21 | "language": "cos", 22 | "scopeName": "source.cos", 23 | "path": "./syntaxes/cos.tmLanguage.json" 24 | }] 25 | } 26 | } -------------------------------------------------------------------------------- /language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | // symbol used for single line comment. Remove this entry if your language does not support line comments 4 | "lineComment": "//", 5 | // symbols used for start and end a block comment. Remove this entry if your language does not support block comments 6 | "blockComment": [ "/*", "*/" ] 7 | }, 8 | // symbols used as brackets 9 | "brackets": [ 10 | ["{", "}"], 11 | ["[", "]"], 12 | ["(", ")"] 13 | ], 14 | // symbols that are auto closed when typing 15 | "autoClosingPairs": [ 16 | ["{", "}"], 17 | ["[", "]"], 18 | ["(", ")"], 19 | ["\"", "\""], 20 | ["'", "'"] 21 | ], 22 | // symbols that that can be used to surround a selection 23 | "surroundingPairs": [ 24 | ["{", "}"], 25 | ["[", "]"], 26 | ["(", ")"], 27 | ["\"", "\""], 28 | ["'", "'"] 29 | ] 30 | } -------------------------------------------------------------------------------- /vsc-extension-quickstart.md: -------------------------------------------------------------------------------- 1 | # Welcome to your VS Code Extension 2 | 3 | ## What's in the folder 4 | * This folder contains all of the files necessary for your extension 5 | * `package.json` - this is the manifest file in which you declare your language support and define 6 | the location of the grammar file that has been copied into you extension. 7 | * `syntaxes/cos.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization 8 | * `language-configuration.json` - this the language configuration, defining the tokens that are used for 9 | comments and brackets. 10 | 11 | ## Get up and running straight away 12 | * Make sure the language configuration settings in `language-configuration.json` are accurate 13 | * press `F5` to open a new window with your extension loaded 14 | * create a new file with a file name suffix matching your language 15 | * verify that syntax highlight works and that the language configuration settings are working 16 | 17 | ## Make changes 18 | * you can relaunch the extension from the debug toolbar after making changes to the files listed above 19 | * you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes 20 | 21 | ## Add more language features 22 | * To add features such as intellisense, hovers and validators check out the VS Code extenders documentation at 23 | https://code.visualstudio.com/docs 24 | 25 | ## Install your extension 26 | * To start using your extension with Visual Studio Code copy it into the /.vscode/extensions folder and restart Code. 27 | * To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cos-vscode README 2 | 3 | This is the README for your extension "cos-vscode". After writing up a brief description, we recommend including the following sections. 4 | 5 | ## Features 6 | 7 | Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. 8 | 9 | For example if there is an image subfolder under your extension project workspace: 10 | 11 | \!\[feature X\]\(images/feature-x.png\) 12 | 13 | > Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. 14 | 15 | ## Requirements 16 | 17 | If you have any requirements or dependencies, add a section describing those and how to install and configure them. 18 | 19 | ## Installation 20 | Download or clone the repo, unpack and copy folder to your $HOME/.vscode/extensions/ on Mac and Linux or the %USERPROFILE%\.vscode\extensions folder on Windows devices. 21 | 22 | ## Extension Settings 23 | 24 | Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. 25 | 26 | For example: 27 | 28 | This extension contributes the following settings: 29 | 30 | * `myExtension.enable`: enable/disable this extension 31 | * `myExtension.thing`: set to `blah` to do something 32 | 33 | ## Known Issues 34 | 35 | Calling out known issues can help limit users opening duplicate issues against your extension. 36 | 37 | ## Release Notes 38 | 39 | Users appreciate release notes as you update your extension. 40 | 41 | ### 1.0.0 42 | 43 | Initial release of ... 44 | 45 | ### 1.0.1 46 | 47 | Fixed issue #. 48 | 49 | ### 1.1.0 50 | 51 | Added features X, Y, and Z. 52 | 53 | ----------------------------------------------------------------------------------------------------------- 54 | 55 | ## Working with Markdown 56 | 57 | **Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: 58 | 59 | * Split the editor (`Cmd+\` on OSX or `Ctrl+\` on Windows and Linux) 60 | * Toggle preview (`Shift+CMD+V` on OSX or `Shift+Ctrl+V` on Windows and Linux) 61 | * Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (OSX) to see a list of Markdown snippets 62 | 63 | ### For more information 64 | 65 | * [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) 66 | * [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) 67 | 68 | **Enjoy!** 69 | -------------------------------------------------------------------------------- /syntaxes/cos.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", 3 | "name": "CacheObjectScript", 4 | "scopeName": "source.cos", 5 | "patterns": [ 6 | { 7 | "include": "#comments" 8 | }, 9 | { 10 | "include": "#directives" 11 | }, 12 | { 13 | "include": "#statements" 14 | }, 15 | { 16 | "include": "text.xml" 17 | } 18 | ], 19 | "repository": { 20 | "comments": { 21 | "patterns": [ 22 | { 23 | "name": "comment.line.character.cos", 24 | "begin": "\\s*\\/\\/\\/", 25 | "end": "$", 26 | "patterns": [ 27 | { 28 | "include": "text.xml" 29 | } 30 | ] 31 | }, 32 | { 33 | "name": "comment.line.double-slash.cos", 34 | "begin": "\\s*\\/\\/", 35 | "end": "$", 36 | "patterns": [ 37 | { 38 | "include": "text.xml" 39 | } 40 | ] 41 | }, 42 | { 43 | "name": "comment.line.number.cos", 44 | "begin": "\\s*#;", 45 | "end": "$", 46 | "patterns": [ 47 | { 48 | "include": "text.xml" 49 | } 50 | ] 51 | }, 52 | { 53 | "name": "comment.block.documentation.cos", 54 | "begin": "\\/\\*", 55 | "end": "\\*\\/", 56 | "patterns": [ 57 | { 58 | "include": "text.xml" 59 | } 60 | ] 61 | }, 62 | { 63 | "name": "comment.line.semicolon.cos", 64 | "begin": ";", 65 | "end": "$", 66 | "patterns": [ 67 | { 68 | "include": "text.xml" 69 | } 70 | ] 71 | } 72 | ] 73 | }, 74 | "directives": { 75 | "patterns": [ 76 | { 77 | "include": "#include-directives" 78 | }, 79 | { 80 | "include": "#define-directives" 81 | } 82 | ] 83 | }, 84 | "include-directives": { 85 | "begin": "\\s*(?i)(#?include)\\s*", 86 | "beginCaptures": { 87 | "1": { 88 | "name": "keyword.other.include.cos" 89 | } 90 | }, 91 | "end": "$", 92 | "patterns": [ 93 | { 94 | "include": "#dotted-attrs" 95 | } 96 | ] 97 | }, 98 | "define-directives": { 99 | "patterns": [ 100 | { 101 | "begin": "^\\s*(?i)(#define)\\s*", 102 | "beginCaptures": { 103 | "1": { 104 | "name": "keyword.other.define.cos" 105 | } 106 | }, 107 | "end": "$", 108 | "patterns": [ 109 | { 110 | "match": "[a-zA-Z0-9%\\(\\)+\\-*=]+", 111 | "name": "constant.other.macros.cos" 112 | } 113 | ] 114 | }, 115 | { 116 | "begin": "^\\s*(?i)(#ifdef)\\s*(\\w+)", 117 | "beginCaptures": { 118 | "1": { 119 | "name": "keyword.other.ifdef.cos" 120 | }, 121 | "2": { 122 | "name": "constant.other.ifdef.cos" 123 | } 124 | }, 125 | "end": "$" 126 | }, 127 | { 128 | "match": "^\\s*(?i)(#else|#endif)", 129 | "captures": { 130 | "1": { 131 | "name": "keyword.other.else-endif.cos" 132 | } 133 | } 134 | }, 135 | { 136 | "begin": "^\\s*(?i)(#dim)\\s*([\\w,]+)", 137 | "beginCaptures": { 138 | "1": { 139 | "name": "keyword.other.dim.cos" 140 | }, 141 | "2": { 142 | "name": "variable.other.cos" 143 | } 144 | }, 145 | "end": "$", 146 | "patterns": [ 147 | { 148 | "match": "=\\s*(\\w+)", 149 | "name": "entity.name.variable.equals.cos" 150 | }, 151 | { 152 | "match": "(?i)\\b(as)\\b\\s*\\b(list|array)\\b\\s*\\b(of)\\b\\s*\\b(\\w+)\\b", 153 | "captures": { 154 | "1": { 155 | "name": "keyword.operator.as.cos" 156 | }, 157 | "2": { 158 | "name": "entity.name.variable.list-array.cos" 159 | }, 160 | "3": { 161 | "name": "keyword.operator.of.cos" 162 | }, 163 | "4": { 164 | "name": "entity.name.variable.cos" 165 | } 166 | } 167 | }, 168 | { 169 | "match": "(?i)\\b(as)\\b\\s*\\b(\\w+)\\b", 170 | "captures": { 171 | "1": { 172 | "name": "keyword.operator.as.cos" 173 | }, 174 | "2": { 175 | "name" : "entity.name.variable.cos" 176 | } 177 | } 178 | } 179 | ] 180 | } 181 | ] 182 | }, 183 | "dotted-attrs": { 184 | "match": "((%|\\w|\\.|#)+)", 185 | "captures": { 186 | "1": { 187 | "name": "variable.language.cos" 188 | } 189 | } 190 | }, 191 | "statements": { 192 | "patterns": [ 193 | { 194 | "include": "#properties" 195 | }, 196 | { 197 | "include": "#parameters" 198 | }, 199 | { 200 | "include": "#indices" 201 | }, 202 | { 203 | "include": "#fks" 204 | }, 205 | { 206 | "include": "#classes" 207 | }, 208 | { 209 | "include": "#methods" 210 | }, 211 | { 212 | "include": "#xml-data" 213 | }, 214 | { 215 | "include": "#keywords" 216 | }, 217 | { 218 | "include": "#variables" 219 | } 220 | ] 221 | }, 222 | "properties": { 223 | "begin": "^\\s*(?i)(Property)\\s+(\\w+)", 224 | "beginCaptures": { 225 | "1": { 226 | "name": "entity.name.type.property.cos" 227 | }, 228 | "2": { 229 | "name": "variable.other.cos" 230 | } 231 | }, 232 | "end": "$", 233 | "patterns": [ 234 | { 235 | "include": "#as-keywords" 236 | }, 237 | { 238 | "include": "#dotted-attrs" 239 | } 240 | ] 241 | }, 242 | "parameters": { 243 | "begin": "^\\s*(?i)(Parameter)\\s+(\\w+)", 244 | "beginCaptures": { 245 | "1": { 246 | "name": "entity.name.type.property.cos" 247 | }, 248 | "2": { 249 | "name": "variable.other.cos" 250 | } 251 | }, 252 | "end": "$", 253 | "patterns": [ 254 | { 255 | "include": "#as-keywords" 256 | }, 257 | { 258 | "include": "#dotted-attrs" 259 | } 260 | ] 261 | }, 262 | "indices": { 263 | "begin": "^\\s*(?i)(Index)\\s+(\\w+)", 264 | "beginCaptures": { 265 | "1": { 266 | "name": "entity.name.type.property.cos" 267 | }, 268 | "2": { 269 | "name": "variable.other.cos" 270 | } 271 | }, 272 | "end": "$", 273 | "patterns": [ 274 | { 275 | "match": "\\b(?i)(ON)\\b", 276 | "captures": { 277 | "1": { 278 | "name": "keyword.operator.on.cos" 279 | } 280 | } 281 | }, 282 | { 283 | "include": "#dotted-attrs" 284 | } 285 | ] 286 | }, 287 | "fks": { 288 | "begin": "^\\s*(?i)(Relationship)\\s+(\\w+)", 289 | "beginCaptures": { 290 | "1": { 291 | "name": "entity.name.type.property.cos" 292 | }, 293 | "2": { 294 | "name": "variable.other.cos" 295 | } 296 | }, 297 | "end": "$", 298 | "patterns": [ 299 | { 300 | "include": "#as-keywords" 301 | }, 302 | { 303 | "include": "#dotted-attrs" 304 | } 305 | ] 306 | }, 307 | "as-keywords": { 308 | "match": "\\b(?i)(As)\\b", 309 | "captures": { 310 | "1": { 311 | "name": "keyword.operator.as.cos" 312 | } 313 | } 314 | }, 315 | "classes": { 316 | "begin": "^\\s*(?i)(Class)\\s+(\\w+)", 317 | "beginCaptures": { 318 | "1": { 319 | "name": "entity.name.type.property.cos" 320 | }, 321 | "2": { 322 | "name": "variable.other.cos" 323 | } 324 | }, 325 | "end": "$", 326 | "patterns": [ 327 | { 328 | "match": "\\b(?i)(Extends)\\b", 329 | "captures": { 330 | "1": { 331 | "name": "keyword.operator.extends.cos" 332 | } 333 | } 334 | }, 335 | { 336 | "include": "#dotted-attrs" 337 | }, 338 | { 339 | "begin": "\\{", 340 | "end": "\\}", 341 | "patterns": [ 342 | { 343 | "include": "#statements" 344 | } 345 | ] 346 | } 347 | ] 348 | }, 349 | "methods": { 350 | "begin": "^\\s*(?i)(Method|ClassMethod|ClientMethod)\\s+(\\w+)", 351 | "beginCaptures": { 352 | "1": { 353 | "name": "entity.name.type.property.cos" 354 | }, 355 | "2": { 356 | "name": "variable.other.cos" 357 | } 358 | }, 359 | "end": "$", 360 | "patterns": [ 361 | { 362 | "include": "#method-params" 363 | }, 364 | { 365 | "include": "#as-keywords" 366 | }, 367 | { 368 | "include": "#dotted-attrs" 369 | }, 370 | { 371 | "begin": "\\{", 372 | "end": "\\}", 373 | "patterns": [ 374 | { 375 | "include": "#statements" 376 | } 377 | ] 378 | } 379 | ] 380 | }, 381 | "method-params": { 382 | "begin": "\\(", 383 | "end": "\\)", 384 | "patterns": [ 385 | { 386 | "match": "(\\w+)\\s*(As)\\s*((\\w|%|\\.)+)\\s*=\\s*([\\w\\{\\}\\$]+)", 387 | "captures": { 388 | "1": { 389 | "name": "variable.parameter.method-param.cos" 390 | }, 391 | "2": { 392 | "name": "keyword.operator.as-method-param.cos" 393 | }, 394 | "3": { 395 | "name": "storage.type.method.cos" 396 | }, 397 | "5": { 398 | "name": "entity.name.variable.equals.cos" 399 | } 400 | } 401 | }, 402 | { 403 | "match": "(\\w+)\\s*(As)\\s*((\\w|%|\\.)+)", 404 | "captures": { 405 | "1": { 406 | "name": "variable.parameter.method-param.cos" 407 | }, 408 | "2": { 409 | "name": "keyword.operator.as-method-param.cos" 410 | }, 411 | "3": { 412 | "name": "storage.type.method.cos" 413 | } 414 | } 415 | }, 416 | { 417 | "match": "(\\w+)", 418 | "captures": { 419 | "1": { 420 | "name": "variable.parameter.method-param.cos" 421 | } 422 | } 423 | } 424 | ] 425 | }, 426 | "keywords": { 427 | "patterns": [ 428 | { 429 | "include": "#action-keywords" 430 | }, 431 | { 432 | "include": "#control-keywords" 433 | }, 434 | { 435 | "include": "#system-functions" 436 | }, 437 | { 438 | "include": "#keyword-operator-logical" 439 | }, 440 | { 441 | "include": "#sql-keyword" 442 | }, 443 | { 444 | "include": "#class-keyword" 445 | } 446 | ] 447 | }, 448 | "keyword-operator-logical": { 449 | "match": "(&&|&|!|'|\\|\\|)", 450 | "captures": { 451 | "1": { 452 | "name": "keyword.operator.logical.cos" 453 | } 454 | } 455 | }, 456 | "action-keywords": { 457 | "match": "(?i)\\b(SET|S|DO|D|KILL|K|GOTO|G|READ|R|WRITE|W|OPEN|O|USE|U|CLOSE|C|CONTINUE|FOR|F|HALT|HANG|H|JOB|J|LOCK|L|MERGE|M|NEW|N|QUIT|Q|RETURN|RET|TSTART|TS|TCOMMIT|TC|TROLLBACK|TR|THROW|VIEW|V|XECUTE|X|ZKILL|ZK|ZNSPACE|ZN|ZTRAP|ZWRITE|ZW|ZZDUMP|ZZWRITE)\\b", 458 | "captures": { 459 | "1": { 460 | "name": "keyword.operator.action.cos" 461 | } 462 | } 463 | }, 464 | "control-keywords": { 465 | "match": "(?i)\\b(if|i|while|for|f|try|catch|else|e|elseif)\\b", 466 | "captures": { 467 | "1": { 468 | "name": "keyword.control.cos" 469 | } 470 | } 471 | }, 472 | "system-functions": { 473 | "match": "\\.%\\w+", 474 | "name": "entity.name.function.system.cos" 475 | }, 476 | "sql-keyword": { 477 | "begin": "(&sql)\\(", 478 | "beginCaptures": { 479 | "1": { 480 | "name": "entity.name.function.sql.cos" 481 | } 482 | }, 483 | "end": "\\)", 484 | "patterns": [ 485 | { 486 | "include": "#expressions" 487 | } 488 | ] 489 | }, 490 | "class-keyword": { 491 | "match": "(##class)\\(((%|\\w|\\.|#)+)\\)", 492 | "captures": { 493 | "1": { 494 | "name": "entity.name.class.reference.cos" 495 | }, 496 | "2": { 497 | "name": "variable.parameter.function-argument.cos" 498 | } 499 | } 500 | }, 501 | "function-exec": { 502 | "match": "\\)\\.(\\w+)", 503 | "captures": { 504 | "1": { 505 | "name": "entity.name.function.ordinary.cos" 506 | } 507 | }, 508 | "comment": "TODO: doesn't work" 509 | }, 510 | "variables": { 511 | "patterns": [ 512 | { 513 | "match": "\\.\\.\\w+", 514 | "name": "variable.other.property.cos" 515 | }, 516 | { 517 | "match": "\\.\\.#\\w+", 518 | "name": "variable.other.parameter.cos" 519 | }, 520 | { 521 | "match": "\\^\\w+", 522 | "name": "variable.other.global.cos" 523 | }, 524 | { 525 | "match": "\\$\\w+(\\.\\w+)*", 526 | "name": "variable.other.system.cos" 527 | }, 528 | { 529 | "match": "\\$\\$\\$\\w+", 530 | "name": "variable.other.macros.cos" 531 | }, 532 | { 533 | "include": "#strings" 534 | } 535 | ] 536 | }, 537 | "strings": { 538 | "patterns": [ 539 | { 540 | "begin": "(\")", 541 | "beginCaptures": { 542 | "1": { 543 | "name": "punctuation.definition.string.begin.cos" 544 | } 545 | }, 546 | "end": "(\")", 547 | "endCaptures": { 548 | "1": { 549 | "name": "punctuation.definition.string.end.cos" 550 | } 551 | }, 552 | "name": "string.quoted.double.cos" 553 | } 554 | ] 555 | }, 556 | "xml-data": { 557 | "patterns": [ 558 | { 559 | "match": "^\\s*(?i)(XData|Storage)\\s+(\\w+)", 560 | "captures": { 561 | "1": { 562 | "name": "storage.type.xdata.cos" 563 | }, 564 | "2": { 565 | "name": "variable.other.cos" 566 | } 567 | } 568 | } 569 | ] 570 | }, 571 | "expressions": { 572 | "patterns": [ 573 | { 574 | "begin": "\\(", 575 | "end": "\\)", 576 | "patterns": [ 577 | { 578 | "include": "#expressions" 579 | } 580 | ] 581 | }, 582 | { 583 | "include": "source.sql" 584 | }, 585 | { 586 | "include": "source.js" 587 | } 588 | ] 589 | } 590 | } 591 | } 592 | --------------------------------------------------------------------------------