diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2023-04-11 19:09:36 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2023-04-11 19:09:36 +0300 |
| commit | afd5f32e56d3d30bfa98fb35deff51febf50e594 (patch) | |
| tree | 4f96bb6baa697172f54089fb555e3852148ce88b /atk16-syntax | |
| parent | a38b64e1a1bf14dd9c42629f219b0e422aebe52a (diff) | |
Improve extension
Diffstat (limited to 'atk16-syntax')
| -rw-r--r-- | atk16-syntax/atk16-syntax-0.0.1.vsix | bin | 4725 -> 4383 bytes | |||
| -rw-r--r-- | atk16-syntax/extension.js | 15 | ||||
| -rw-r--r-- | atk16-syntax/package.json | 19 | ||||
| -rw-r--r-- | atk16-syntax/syntaxes/atk16.tmLanguage.json | 2 | ||||
| -rw-r--r-- | atk16-syntax/themes/atk16-color-theme.json | 41 |
5 files changed, 21 insertions, 56 deletions
diff --git a/atk16-syntax/atk16-syntax-0.0.1.vsix b/atk16-syntax/atk16-syntax-0.0.1.vsix Binary files differindex b6aa9dc..342049e 100644 --- a/atk16-syntax/atk16-syntax-0.0.1.vsix +++ b/atk16-syntax/atk16-syntax-0.0.1.vsix diff --git a/atk16-syntax/extension.js b/atk16-syntax/extension.js index e49dd07..2c8e294 100644 --- a/atk16-syntax/extension.js +++ b/atk16-syntax/extension.js @@ -135,21 +135,20 @@ async function findSubroutineInDocument(document, labelText) { for (let i = 0; i < document.lineCount; i++) { const line = document.lineAt(i); if (line.text.includes(`@label ${labelText}`)) { - let labelDefinition = ''; for (let j = i + 1; j < document.lineCount; j++) { const docLine = document.lineAt(j); - const docCommentMatch = docLine.text.match(/;\? (.*)/); + const docCommentMatch = docLine.text.match(/;;;\s+(.*)/); if (docCommentMatch) { const lineText = docCommentMatch[1]; - const parts = lineText.split(/\s/); + const parts = lineText.trim().split(/\s+/g); if (lineText.startsWith('subroutine')) { - name = parts[parts.length - 1]; + name = parts[parts.length - 1].trim(); } else if (lineText.startsWith('param')) { - const [_, reg, ...desc] = parts; - params.push([reg, desc.join(" ")]) + const [_kw, reg, ...desc] = parts; + params.push([reg.trim(), desc.filter(a => a).join(" ")]) } else if (lineText.startsWith('return')) { - const [_, reg, ...desc] = parts; - returns.push([reg, desc.join(" ")]) + const [_kw, reg, ...desc] = parts; + returns.push([reg.trim(), desc.filter(a => a).join(" ")]) } else { extra += `${lineText}\n`; } diff --git a/atk16-syntax/package.json b/atk16-syntax/package.json index bdfbb74..5fd48e6 100644 --- a/atk16-syntax/package.json +++ b/atk16-syntax/package.json @@ -28,12 +28,19 @@ "path": "./syntaxes/atk16.tmLanguage.json" } ], - "themes": [ - { - "label": "ATK16 Color Theme", - "uiTheme": "vs-dark", - "path": "./themes/atk16-color-theme.json" + "configurationDefaults": { + "editor.tokenColorCustomizations": { + "[Default Dark+]": { + "textMateRules": [ + { + "scope": "comment.documentation.atk16", + "settings": { + "fontStyle": "italic" + } + } + ] + } } - ] + } } } diff --git a/atk16-syntax/syntaxes/atk16.tmLanguage.json b/atk16-syntax/syntaxes/atk16.tmLanguage.json index 1faadf9..b12f596 100644 --- a/atk16-syntax/syntaxes/atk16.tmLanguage.json +++ b/atk16-syntax/syntaxes/atk16.tmLanguage.json @@ -4,7 +4,7 @@ "patterns": [ { "name": "comment.documentation.atk16", - "match": ";\\?.*$" + "match": ";;;.*" }, { "name": "comment.line.semicolon.atk16", diff --git a/atk16-syntax/themes/atk16-color-theme.json b/atk16-syntax/themes/atk16-color-theme.json deleted file mode 100644 index d1aebb9..0000000 --- a/atk16-syntax/themes/atk16-color-theme.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "ATK16", - "type": "dark", - "colors": { - "editor.background": "#1E1E1E", - "editor.foreground": "#D4D4D4", - "editor.lineHighlightBackground": "#2D2D30" - }, - "tokenColors": [ - { - "scope": "keyword.control.directive.atk16", - "settings": {} - }, - { - "scope": "variable.parameter.register.atk16", - "settings": {} - }, - { - "scope": "constant.numeric.binary.atk16", - "settings": {} - }, - { - "scope": "keyword.control.instruction.atk16", - "settings": {} - }, - { - "scope": "support.function.atk16", - "settings": {} - }, - { - "scope": "entity.name.label.atk16", - "settings": {} - }, - { - "scope": "comment.documentation.atk16", - "settings": { - "fontStyle": "italic" - } - } - ] -}
\ No newline at end of file |
