Skip to content

v2.2.0

Choose a tag to compare

@WilliamSmithEdward WilliamSmithEdward released this 23 Sep 05:11
· 76 commits to main since this release

Follows XLIDE 10.6.0, from 6.2.0: twelve new diagnostics, early binding checked against the libraries a project references, and member lookups that follow the type library's own extensibility flags. The full list is in CHANGELOG.md.

New checks

  • invalid-option-statement (error): a malformed Option statement, such as Option Base 2 or Option Explicit Foo.
  • missing-library-reference (error): a type or constant qualified with an Office library the project does not reference, such as Dim doc As Word.Document in a workbook with no reference to Word. It is reported only against a known reference list, which analyze_office_file and the CLI read from the container.
  • Dead code, at information: unused-variable, variable-never-read, unused-procedure and unreachable-code, with edits that remove the dead code.
  • Doc comments, at warning: six checks that compare the XML tags of a ''' block with the declaration it documents.
  • Member calls are checked for arity and argument types, on host objects and project classes alike: Application.Calculate(1), a bare Err.Raise, p.Save "bad" on a class whose Save takes a Long.

Before you upgrade

The CLI's default --fail-level information fails on any diagnostic, so a workbook with one unused variable now exits 1. Pass --fail-level warning to gate on warnings and errors only.

member-not-found reports a member absent from an Excel interface only when the type library closes that interface, as the VBE does. Application.Match and the other worksheet functions reached through Application are no longer reported.

Fixed

False positives 2.1.1 reported on code that compiles, among them: undeclared-variable on XlDirection.xlUp and on a UserForm's own controls, object-variable-not-set on a variable declared As New, member-not-found on a member the type library hides such as ws.OnEntry, readonly-member-assignment on a comparison such as ElseIf w.Part = "b" Then, and event-handler-module-scope on the Document events of Word's ThisDocument.

Verified

Against the upstream analyzer it mirrors. Upstream's own test suite was replayed through the port, 1055 standalone and 929 project calls, every result identical. The oracle corpus (1818 diagnostics), 16 real workbooks, 195 Office files from Excel, Word, PowerPoint and Access, and 693 further projects give identical diagnostics from both analyzers.