serkonda7 / vscode-vba

VBA language extension to use with VS Code. Also used for syntax highlighting on GitHub.
https://marketplace.visualstudio.com/items?itemName=serkonda7.vscode-vba
Mozilla Public License 2.0
34 stars 12 forks source link

Allow custom types with underscore and numbers #88

Closed DecimalTurn closed 1 year ago

DecimalTurn commented 1 year ago

In the VBA syntax, while all the builtin types only contain letters, user defined types can contain underscores and numbers. Eg.:

Public Type REMOTE_MEMORY2
    '...
End Type

is a valid name for a user defined type.

Hence, types should be allowed to contain these characters and be highlighted properly:

Public Sub InitRemoteMemory(ByRef rm As REMOTE_MEMORY2)
    '...
End Sub

Example in the wild: https://github.com/cristianbuse/VBA-MemoryTools/blob/922a64c48e7e6c276c7be64605216173cc8bf7d9/src/LibMemory.bas#L642

For the tests, I'm not sure if the one with String_Extension2 is needed. Also note that I've changed Sub eggs... to Function eggs... because it has a return type.