RAS Playground 日本語 GitHub

About the project

Implementation status and verification

This page summarizes what is and is not implemented compared with the language specification, and what has been verified in which environment. Planned features and their priorities are in the ROADMAP.

Commands

Command Status
init / check / build / build --target js / watch / pack / unpack / fmt / lsp --stdio Implemented
form new / form check / form pull Implemented
sync Implemented (Windows only. Applies modules and user forms to a workbook open in Excel. --pull is not implemented)
setup / typegen / pack --via-excel Not implemented (running them prints a message saying so and exits)
run / book dump / book diff / book view / book edit / book samples / book new Implemented (spec §14.13, §14.14)
explain / cheatsheet / doc Implemented (spec §14.15)
test Implemented (spec §14.12. --excel is Windows only)
excel run / excel compile / excel compare Implemented (spec §14.17. Windows only)

Implementation status of the specification

The current state against the specification (Draft v0.7).

Spec Status Notes
§2 Types, numeric literals, type conversion Implemented The error for using long outside #If Win64 is not implemented (only conditional emission of declarations)
§2.4 Generics Implemented Functions, extension methods and classes. Generic methods inside classes are not supported (error). Default type arguments (T = type) are for classes and interfaces only
§2.6 Union types, type narrowing Implemented Narrowing by instanceof / typeof applies only to local variables and arguments (not fields or module variables). Union type inference (for example when the two sides of a conditional operator have different types) is not performed. In the bundled type definitions, activeSheet, sheet collections, Worksheet.next, the various parents, getOpenFilename and others are made union types (§2.6.5)
§3 Functions, byref, extension methods, named arguments Implemented Named arguments (f(a: 123, c: "abc")) are reordered to the declaration order in the output. They cannot be used with lambdas or late-bound calls
§4 Lambdas (loop fusion, closure classes) Implemented map / filter / forEach / reduce / some / every / find / findIndex. The same methods and toArray() also work on host collections (worksheets, etc., §4.4). Array and string methods are implemented as compiler built-ins, not as the "standard library extension methods" of spec §3.2.4
§5 try / catch / finally / using / throw Implemented The catch body runs at a label after Resume, not inside the handler (so that a rethrow reaches an outer try in the same procedure)
§6 Linter Partial Rules 1–6, 8–10, 14 and 15 are implemented. Rule 7 (renaming reserved words) only renames automatically, with no warning; rule 11 only converts, with no notice
§7 CLI and VS Code extension Partial As in the table above
§8 Inlining and loop optimization Partial inline, automatic expansion in loops, preservation of evaluation order, conversion to For...Next, and $ functions are implemented. Hoisting of loop invariants (other than the upper-bound expression), With conversion and string buffers are not implemented
§9 Bulk Range ⇔ array transfer Implemented The "read the existing contents, then write back" mode of @bulk is not implemented (loops that do not satisfy condition 5 are not converted)
§10 Application state, automatic DoEvents insertion Implemented
§11 declare (32/64-bit) Partial Alignment calculation for declare struct and @fallback are not implemented
§12 Boilerplate, events, @init, macro entry points Partial Files for sheets and ThisWorkbook (objects/, §12.1.1, §12.2) are implemented. ActiveX controls on sheets (§12.2.1) and WithEvents (@on("<variable>.<event>"), §12.2.2) are also implemented (in debug runs and tests without Excel, handlers are also called when the variable points to the project's workbook, sheet or Application). Event handlers attached at run time (on / addEventListener, §12.2.3) are also implemented (the generated VBA has been verified on real Excel 2021 for attaching and detaching to sheets, workbooks, Application, shape OnAction and form controls, and for cancelling BeforeClose). The ribbon (@ribbon, §12.5) is not implemented
§13 Avoiding VBA pitfalls Partial The Collection wrapper, the Range.Find wrapper, existence checks for names given as strings, and reuse of temporary variables are not implemented
§14.1–14.8 Live sync Partial Applies to a workbook open in Excel on every save (ras sync, ras watch, the VS Code language server. Windows only). ras rewrites the VBE code modules directly through COM; shared memory and RASBridge.xlam (§14.2, §14.4, §14.5) are not used. Of the application rules (§14.6), diff application, rewriting whole document modules, Import of classes with attributes, rollback on failure, and deferral while running or in break mode, as well as drift detection (§14.7), are implemented. Converting hand-written standard modules, sheet / ThisWorkbook code and forms in the workbook to RAS and importing them, moving them under RAS management (§14.7.1), is implemented. Importing procedures and declarations added in the VBE to a RAS-generated module into the RAS files (§14.7.3; the written code is saved in build/sync/ for comparison) and duplicating the source file for a sheet duplicated in Excel (§14.7.2) are also implemented. A compile check after applying (sync.compileCheck), the Excel → local direction (--pull, two-way sync of unmanaged modules), importing class modules, changing attributes of existing classes, and ras setup are not implemented
§14.9 Offline write and read Implemented Re-signing is not implemented. Writing unmanaged modules in vba/ back to the workbook is not implemented (extraction only. User forms are handled in forms/)
§14.10 Debug run (JavaScript runtime) Implemented User forms (§14.10.7) are shown in a VS Code panel. Key, mouse and drag events and ControlSource are not supported. The connection to Excel (ras_com.node) has been verified on real Excel 2021 (64-bit). Dialog monitoring (§14.10.6) has been verified against message boxes in CI on Windows without Excel, and on real Excel 2021 with run-time errors, compile errors, MsgBox, the confirmation for deleting a sheet, and "Yes / No" prompts that need a choice. CI verifies COM calls on Windows without Excel using Scripting.Dictionary and others. The Excel stand-in for environments without Excel (§14.10.8, ras_book.node) is verified by automated tests (Linux / Windows) that run RAS programs on Node and check cells, formulas and saved results, and also in VS Code (answers in launch.json, sheet preview while paused, forms). Comparison with Excel is done with tools/standin-check (see "Verification status" below). Inserting and deleting cells, cut / copy / paste, sorting and filtering, saving formatting, manual calculation, and workbook and sheet events are also verified by the same automated tests, and the event order, the operations that clear a copy, and the formatting when a saved workbook is opened in Excel were matched against real Excel. The position and size of shapes (Shape.Left / Top / Width / Height / TopLeftCell / BottomRightCell and Range.Left and the like, computed from row heights and column widths) and notes (Range.AddComment / Comment / Worksheet.Comments, written into the saved workbook and shown by ras book view / dump) are checked by the automated tests too, but have not yet been compared with real Excel. Inheritance with super calls is out of scope
§14.11 User forms (forms/) Implemented Generation from FormSpec (including Image pictures and ComboBox / ListBox items), extraction from a workbook (ras form pull), live sync, and running in Excel (§14.11.8). Generating custom ActiveX controls and detecting edits in the VBE (drift) are not implemented
§14.12 Tests (ras test) Partial Listing tests (--list), running, expect, hooks, workbook rollback, useWorkbook / tempDir / printed, replacement (mock*), timeouts, --reporter pretty / json / junit, -t, --ci, --bail, --watch, --inspect-brk, saving the workbook of a failed test, the [test] settings, snapshots (toMatchSnapshot, -u), running in real Excel (--excel, [test] excel = "com"; Windows only), and editor integration (§14.12.10: running, debugging and showing the results in VS Code's test explorer, type checking and completion for test files in the language server) are implemented. --excel is slow because the test's JavaScript drives Excel over COM; converting tests to VBA and running them inside Excel is not done (ROADMAP item 16). On the Excel stand-in, test files run in parallel (one at a time with --sequence or --excel). Tests not selected by -t do not appear in the results. In the Excel stand-in, toBeEmpty and toBeNothing both pass for either Empty or Nothing (because the runtime does not distinguish them). The type of expect checks only the expected value of toBe
§14.13 Running from the CLI (ras run) Implemented Runs only on the Excel stand-in (to run against real Excel, use ras excel run (§14.17, Windows only) or VS Code's debug run). Showing a user form is an error. Calling functions with parameters and @udf functions (--arg) and running @on handlers by what the user does (--event; simulate in tests) are implemented
§14.16 Adding, duplicating, deleting and renaming sheets (ras sheet) Partial Operations that rewrite the workbook file directly (.xlsx / .xlsm; .xlsb is not possible) and the VS Code commands are implemented. Operations on a workbook open in Excel have also been verified on real Excel 2021 (adding, duplicating, deleting, renaming, refusing a delete, refusal while a macro is running, and the language server commands)
§14.14 Viewing, comparing and editing workbook contents (ras book dump / diff / view / edit) Implemented Insertions and deletions of rows / columns are inferred at several places too. The formats of dump / diff (--styles) are only font, fill and borders; alignment, protection and the formats of whole rows and columns are not handled. view draws only color scales and data bars among conditional formats, and does not draw table styles or diagonal borders. Column widths are calculated by treating the default font as a Japanese font (11pt)
§14.15 Machine-readable diagnostics, error explanations, warnings for APIs unavailable in the stand-in Partial --message-format json, ras explain (all codes) and ras check --target stand-in (W0510–W0514) are implemented. The "related locations" of diagnostics (related) give the first declaration of a name declared twice (E0101). The results of user form checks are output as JSON too. ras doc (looking up the API from the CLI, and the list of stand-in support --stand-in) and showing whether the stand-in has a member in the language server's quick info are implemented
§14.17 Running, compiling and comparing in Excel (ras excel) Implemented Windows only. Writes the project into a copy of the workbook and, in an Excel it starts, runs a function, compiles the VBA, or compares the results with the original macro
§15 Project layout, ras.toml, bundled type definitions Partial Type definitions for Excel / VBA / Office are bundled, and members and globals are referenced in camelCase (§15.3.1). Type definitions for Scripting (FileSystemObject, Dictionary) and VBScript.RegExp are also bundled, and emitted to VBA with late binding (§15.3). ras typegen and vba: imports are not implemented
§16.1 JSDoc Implemented Emitting comments and VB_Description to the generated VBA, and checking @param names
§16.2 IntelliSense (LSP) Partial Diagnostics, completion (including argument names for named arguments, and unimported candidates with automatic import insertion), hover, parameter info, go to definition, go to type definition, find references, highlighting, rename, symbol lists (file and workspace), inlay hints, semantic tokens, folding, formatting, CodeLens (optimization notices, and "Run in Excel" / "Debug run" per function), "Show generated VBA", and quick fixes (fixing names written in VBA spelling, adding an import for an unimported name) are implemented. completionItem/resolve (lazy loading of JSDoc), range formatting, other code actions (turning a literal passed to a byref argument into a temporary variable, adding as to a narrowing conversion), and warnings at @deprecated usages are not implemented
§17 Adopted libraries Partial salsa (incremental computation; currently everything is reparsed on every change), line-index, annotate-snippets, rayon, insta, lsp-types and windows are not used

Differences from the specification's examples

Verification status