From 193dd85378ed495fb6dd31f55f9ee4da785aad25 Mon Sep 17 00:00:00 2001 From: heterophyllus <56807079+heterophyllus@users.noreply.github.com> Date: Fri, 31 Jan 2020 19:50:48 +0900 Subject: [PATCH] add snippets --- package.json | 2 +- snippets/zemax.json | 4 +--- syntaxes/zemax.tmLanguage.json | 38 ++++++++++++---------------------- 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 6a2861d..5f03d18 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-zemax", "displayName": "Zemax OpticStudio ZPL language support", "description": "Zemax OpticStudio ZPL language support for Visual Studio Code", - "version": "0.2.2", + "version": "0.3.0", "repository": { "type": "git", "url": "https://github.com/heterophyllus/vscode-zemax.git" diff --git a/snippets/zemax.json b/snippets/zemax.json index dd83e14..14a01d7 100644 --- a/snippets/zemax.json +++ b/snippets/zemax.json @@ -1552,6 +1552,4 @@ "description":"Connect two ZRD" } - - -} \ No newline at end of file +} diff --git a/syntaxes/zemax.tmLanguage.json b/syntaxes/zemax.tmLanguage.json index 2fe41a3..524f142 100644 --- a/syntaxes/zemax.tmLanguage.json +++ b/syntaxes/zemax.tmLanguage.json @@ -26,9 +26,6 @@ }, { "include": "#keywords" - }, - { - "include": "#constants" } ], "repository":{ @@ -90,12 +87,12 @@ { "match": "\\b([a-zA-Z0-9_]+)(\\$)\\b", "captures":{ - "1":{ - "name": "variable.string.zemax" - }, - "2":{ - "name": "punctuation.definition.variable.string.zemax" - } + "1":{ + "name": "variable.string.zemax" + }, + "2":{ + "name": "punctuation.definition.variable.string.zemax" + } } } ] @@ -145,40 +142,31 @@ "name": "keyword.language.zemax" } } - } - ] - }, - "constants":{ - "patterns":[ + }, { - "comment": "type code for MODIFYSETTINGS", + "comment": "MODIFYSETTINGS", "match": "\\b((?i)LAY_RAYS|DVW_SURFACE|DVW_DETECTER|DVW_SHOW|DVW_ROWCOL|DVW_ZPLANE|DVW_SCALE|DVW_SMOOTHING|DVW_DATA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SDCX|PCI_RSDCY|PCI_RSDLX|PCI_RSDLY|POP_END|POP_FIELD|POP_START|POP_WAVE|POP_AUTO|POP_BEAMTYPE|POP_PARM[1-9]|POP_PEAKIRRAD|POP_POWER|POP_SAMPX|POP_SAMPY|POP_SOURCEFILE|POP_WIDEX|POP_WIDEY|POP_COMPUTE|POP_FIBERFILE|POP_FIBERTYPE|POP_FPARAM[1-9]|POP_IGNOREPOL|POP_POSITION|POP_TILTX|POP_TILTY|SPT_RAYS|WFM_SAMP|WFM_FIELD|WFM_WAVE|WFM_SUBSR|WFM_SUBSX|WFM_SUBSY)\\b", "captures": { "1":{ "name": "constant.language.zemax" } + } }, { - "comment": "type for PLOT", - "match": "\\b((?i)PLOT)\\s+((?i)NEW|TITLE|TITLE|BANNER|WINASPECT|COMM|RANGE[XY]|CHECK|TICK|FORMAT[XY]|DATA|LINE|LABEL)\\b", + "comment": "PLOT", + "match": "\\b((?i)NEW|TITLE|TITLE[XY]|BANNER|WINASPECT|COMM[1-6]|RANGE[XY]|CHECK|TICK|FORMAT[XY]|DATA|LINE|LABEL)\\b", "captures": { "1":{ - "name": "keyword.language.zemax" - }, - "2":{ "name": "constant.language.zemax" } } }, { - "comment": "type for PLOT2D", - "match": "\\b((?i)PLOT2D)\\s+((?i)NEW|TITLE|COMM|RANGE|ASPECT|WINASPECT|DATA|ACTIVECURSOR|DISPLAYTYPE|CONTOURINTERVAL|SURFACESCALE|LOGPLOT|HIDEADDRESS|CONFIG)\\b", + "comment": "PLOT2D", + "match": "\\b((?i)NEW|TITLE|COMM[1-5]|RANGE|ASPECT|WINASPECT|DATA|ACTIVECURSOR|DISPLAYTYPE|CONTOURINTERVAL|SURFACESCALE|LOGPLOT|HIDEADDRESS|CONFIG)\\b", "captures": { "1":{ - "name": "keyword.language.zemax" - }, - "2":{ "name": "constant.language.zemax" } }