diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..06d5fcc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*.md] +indent_style = space +indent_size = 3 + +[*.{yml,yaml-tmlanguage}] +indent_style = space +indent_size = 2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d039f0..32a0984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,7 +72,7 @@ _2022-11-02_ **Additions** - Syntax highlighting for the WinWrap Basic language - Highlight vba keywords `Eqv`, `Imp`, `TypeOf`, `AddressOf`, `WithEvents`, `Event`, `RaiseEvent`, - `Erase` and `Any` + `Erase` and `Any` **Fixes** - Highlight `Exit` at line start and after tabs @@ -125,10 +125,10 @@ _2022-04-12_ **Additions** - Highlighting keywords: `And`, `Case`, `Case Else`, `Currency`, `Date`, `If`, `Is`, `Else`, - `ElseIf`, `Empty`, `End If`, `End Select`, `End With`, `False`, `Let`, `Mod`, `Not`, `Null`, - `Select Case`, `Then`, `Or`, `ReDim`, `Preserve`, `To`, `True`, `Step`, `ByRef`, `ByVal`, - `Class`, `Exit`, `Get`, `Static`, `Property`, `Like`, `Xor`, `On Error`, `GoTo` - > Note: not all are covered by syntax tests + `ElseIf`, `Empty`, `End If`, `End Select`, `End With`, `False`, `Let`, `Mod`, `Not`, `Null`, + `Select Case`, `Then`, `Or`, `ReDim`, `Preserve`, `To`, `True`, `Step`, `ByRef`, `ByVal`, + `Class`, `Exit`, `Get`, `Static`, `Property`, `Like`, `Xor`, `On Error`, `GoTo` + > Note: not all are covered by syntax tests - Highlight names of function declarations - Highlight date literals diff --git a/package.json b/package.json index ade21bf..1802f92 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vscode-vba", "displayName": "VBA", - "description": "VBA tooling, syntax highlighting and snippets for VS Code.", + "description": "VBA tooling, syntax highlighting and snippets.", "icon": "images/icon_256x256.png", "version": "0.9.6", "license": "MIT", @@ -17,6 +17,7 @@ }, "categories": [ "Programming Languages", + "Snippets", "Language Packs" ], "keywords": [ @@ -72,6 +73,12 @@ "path": "./out/wwb.json" } ], + "snippets": [ + { + "language": "vba", + "path": "./out/vba_snippets.json" + } + ], "commands": [ { "command": "vba.extract_from_doc", @@ -114,7 +121,7 @@ "test-wwb": "vscode-tmgrammar-test -g ./out/wwb.json \"syntaxes/tests/other/*.wwd\"", "install-dev-ext": "vsce package -o ./out/vscode-vba-dev.vsix && code --install-extension ./out/vscode-vba-dev.vsix --force", "package": "vsce package", - "convert-yaml": "yaml2json language-configuration.yml \"syntaxes/*.yaml-tmlanguage\"", + "convert-yaml": "yaml2json language-configuration.yml \"syntaxes/*.yaml-tmlanguage\" \"snippets/*.yml\"", "vscode:prepublish": "pnpm run compile && pnpm run convert-yaml" }, "devDependencies": { diff --git a/snippets/vba_snippets.yml b/snippets/vba_snippets.yml new file mode 100644 index 0000000..3cb9ce8 --- /dev/null +++ b/snippets/vba_snippets.yml @@ -0,0 +1,35 @@ +# SPDX-FileCopyrightText: 2024-present Lukas Neubert +# SPDX-License-Identifier: MPL-2.0 + +If: + prefix: If + body: + - If ${1:condition} Then + - "\t${2}" + - End If + +ElseIf: + prefix: ElseIf + body: + - ElseIf ${1:condition} Then + - "\t${2}" + +Else: + prefix: Else + body: + - Else + - "\t${0}" + +Sub: + prefix: Sub + body: + - Sub ${1:Name}() + - "\t${2}" + - End Sub + +Function: + prefix: Function + body: + - Function ${1:Name}() + - "\t${2}" + - End Function diff --git a/src/extension.js.bt b/src/extension.js.bt index 9559954..5c69cb9 100644 --- a/src/extension.js.bt +++ b/src/extension.js.bt @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023-present Lukas Neubert +// SPDX-FileCopyrightText: 2023-present Lukas Neubert // SPDX-License-Identifier: MPL-2.0 package extension diff --git a/syntaxes/vba.yaml-tmlanguage b/syntaxes/vba.yaml-tmlanguage index 727a54e..fa2bc24 100644 --- a/syntaxes/vba.yaml-tmlanguage +++ b/syntaxes/vba.yaml-tmlanguage @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023-present Lukas Neubert +# SPDX-FileCopyrightText: 2023-present Lukas Neubert # SPDX-License-Identifier: MPL-2.0 name: Visual Basic for Applications diff --git a/syntaxes/wwb.yaml-tmlanguage b/syntaxes/wwb.yaml-tmlanguage index b32a479..73974af 100644 --- a/syntaxes/wwb.yaml-tmlanguage +++ b/syntaxes/wwb.yaml-tmlanguage @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023-present Lukas Neubert +# SPDX-FileCopyrightText: 2023-present Lukas Neubert # SPDX-License-Identifier: MPL-2.0 scopeName: source.wwb