twinBASIC Update: August 1, 2021
Highlights include VSCode CodeLens support, compiler warnings, VB_GlobalNameSpace support, and twinBASIC's debut on stackoverflow.
On April 23, 2021, I helped Wayne Phillips introduce the world to twinBASIC at the Access DevCon Vienna conference. I boldly predicted that twinBASIC (along with the Monaco editor) would replace VBA and its outdated development environment by 2025. With that goal in mind, this weekly update is my attempt to keep the project fresh in the minds of the VBA development community.
Every Sunday, I will be providing updates on the status of the project, linking to new articles discussing twinBASIC, and generally trying to increase engagement with the project. If you come across items that should be included here, tweet me @NoLongerSet or email me at mike at nolongerset dot com.
Highlights
CodeLens Support Introduced
From the feature announcement on GitHub:
CodeLens allows us to provide extra information (and actions) inline in the code editor. Initially we've got this one for no-argument procedures in standard modules:
Compiler Warnings
twinBASIC now has support for compiler warnings. Each warning has three possible project-level settings:
- Error: code won't compile
- Warning [default]: warning shown during compilation
- Ignore: code compiles; no message shown
You can override these settings at the class, module, or procedure level using the following attributes:
[ EnforceWarnings(TBxxxx) ]
[ EnforceErrors(TBxxxx) ]
[ IgnoreWarnings(TBxxxx) ]
The warnings can be found in the project Settings page under the heading, Compiler Warnings. So far there are three warnings (see below). To suggest others, head to the Compiler Warnings issue page on GitHub.
VB_GlobalNameSpace Support
From the feature announcement on GitHub:
This feature allows class members to be called implicitly on a predeclared class, without qualifying the call with the class name. Many of the Office applications use this feature in their typelibraries. For example, in Access you can do this:
MsgBox Access.Name ' Access is the type library identifier.
' this routes through to the predeclared
' Application class, via Application.Name
MsgBox Name ' Same as above, showing you
' don't need the type library identifier.
This is now supported as of v0.10.3790, so for example the two examples [above] work as expected if a COM reference to the Access type library is set. Additionally, we now have a [AppObject]
attribute, as pictured [below], to allow unqualified access to predeclared object members, matching the legacy VB6 VB_GlobalNameSpace attribute (which is also supported).
Around the Web
twinBASIC Debuts on StackOverflow
The first question referencing twinBASIC appeared on StackOverflow on June 25. Andrew Mansell pointed out the question over on the GitHub issue tracker.
I added a twinBASIC tag to the question and filled in some preliminary information about the twinBASIC project in the tag wiki.
Changelog
Here are the updates from the past week. You can also find this information by installing the twinBASIC VS Code extension and clicking on the Changelog tab of the extension page:
[v0.10.3790, 1st August 2021]
- added: support for [ AppObject ] and legacy VB_GlobalNameSpace attribute and corresponding type library infostructure [ https://github.com/WaynePhillipsEA/twinbasic/issues/316 ]
[v0.10.3744, 1st August 2021]
- fixed: predeclared objects defined in external type libraries are now supported [ https://github.com/WaynePhillipsEA/twinbasic/issues/278 ]
- fixed: warning TB0003 would sometimes incorrectly trigger on a Property-Set decleration
[v0.10.3697, 31st July 2021]
- fixed: corrected handling of datatype hint characters on constants, enumeration values and UDT field accessors [ https://github.com/WaynePhillipsEA/twinbasic/issues/314 ]
- fixed: renaming a project would sometimes cause a VS code error upon restart of the compiler [ https://github.com/WaynePhillipsEA/twinbasic/issues/313 ]
[v0.10.3685, 30th July 2021]
- fixed: some more edge cases involving the special ErrObject [ https://github.com/WaynePhillipsEA/twinbasic/issues/274 ]
[v0.10.3664, 30th July 2021]
- added: new semantic highlighting token 'basicLineContinuationCharacter' [ https://github.com/WaynePhillipsEA/twinbasic/issues/282#issuecomment-888516637 ]
- added: compiler warning TB0003 'datatype has not been explicitly declared so will default to Variant' [ https://github.com/WaynePhillipsEA/twinbasic/issues/208 ]
- fixed: some edge cases involving the special ErrObject [ https://github.com/WaynePhillipsEA/twinbasic/issues/274 ]
[v0.10.3613, 29th July 2021]
- fixed: internal error upon compiling particular code inside Print statements [ https://github.com/WaynePhillipsEA/twinbasic/issues/300 ]
- fixed: some variant-coersion problems with the special ErrObject class [ https://github.com/WaynePhillipsEA/twinbasic/issues/274 ]
[v0.10.3604, 29th July 2021]
- added: internal framework for supporting compiler warnings [ https://github.com/WaynePhillipsEA/twinbasic/issues/208 ]
- added: compiler warning TB0001: use of legacy DefType statements is strongly discouraged
- added: compiler warning TB0002: this variable has been auto-declared by the compiler due to Option Explicit being OFF
[v0.10.3511, 27th July 2021]
- added: initial support for codeLens [ https://github.com/WaynePhillipsEA/twinbasic/issues/299 ]
- improved: added a codeLens warning for when an external source file is opened from outside of the project workspace [ https://github.com/WaynePhillipsEA/twinbasic/issues/290 ]
[v0.10.3482, 26th July 2021]
- fixed: auto-correct addition of parenthesis on first line of procedure definition when function return type is defined [ https://github.com/WaynePhillipsEA/twinbasic/issues/295 ]
- improved: added a notification for when an external source file is opened from outside of the project workspace [ https://github.com/WaynePhillipsEA/twinbasic/issues/290 ]