Skip to content

HSL VS Code Extension v2.0.6

Choose a tag to compare

@zdmilot zdmilot released this 08 Mar 14:46
· 51 commits to main since this release

HSL (Hamilton) Language Support v2.0.6

What's Changed since v1.9.3

This is a major release with significant improvements to the linter/diagnostics engine, the HSL simulation debugger, developer tooling, and LLM-assisted development instructions. 20 commits spanning March 5--8, 2026.


New Diagnostics & Linter Rules

  • String member function on wrong type (variable vs string) -- The extension now flags calls to .GetLength(), .Find(), .Left(), .Mid(), .Right(), .Compare(), .MakeUpper(), .MakeLower(), .SpanExcluding() when the receiver is declared as variable instead of string. Calling these on variable causes VENUS error 1317.
  • Anonymous block detection -- HSL does not support C-style anonymous { } blocks with local variable declarations inside functions. The linter now flags these as errors and advises moving declarations to the top of the enclosing scope.
  • Array element in + expression detection (array-element-in-expression) -- The VENUS parser cannot handle arr[index] used directly as an operand of +. The linter now flags this pattern and recommends extracting to a temporary variable first.
  • String concatenation with + operator -- Added a checker that flags + used with string-typed variables, since HSL's + operator does not work with the string type (only variable).
  • Object-type receiver exclusion for arity checks -- COM objects (object type) now skip method call arity validation, eliminating false positives on COM method calls like _comEngine.GetUsedPositions(barcode) that were incorrectly matched against built-in sequence.GetUsedPositions() (0 args).
  • Scope-aware variable type tracking -- Fixed a bug where the linter used a "first declaration wins" policy across all functions, causing false positives when the same variable name was declared with different types in different functions (e.g., variable strPos in one function and string strPos in another).

Context Menu Integration

  • "Open in Hamilton HSL Editor" -- Added a right-click context menu command that launches the external Hamilton Method Editor (HxHSLMetEd.exe). The menu item only appears when:
    • The file is an HSL file
    • Hamilton VENUS is installed (auto-detected at C:\Program Files (x86)\Hamilton\Bin\HxHSLMetEd.exe)
  • Available from both the editor context menu and the file explorer context menu.

Custom Editor Removal

  • Removed the customEditors contribution and the in-VS-Code Hamilton HSL Method Editor from the extension. The "Open With" menu no longer shows this editor. The external editor launch command (above) replaces it.

HSL Debugger Improvements

  • COM object simulation -- Added BarcodedTipTracking.Engine COM object simulation with pure-Python implementations of GetUsedPositions, GetUsedPositionsCsv, and related methods. COM objects in HSL code can now be exercised in simulation without hardware.
  • Enhanced interpreter -- Expanded the interpreter with targeted debug capabilities, better handling of absent HSL code paths, vector database line tracking, and improved system progress trace output.
  • Parser type-check tuples -- Added missing types to the parser's type-check tuples for handling unknown types gracefully.

Package Tooling

  • Hamilton .pkg file documentation -- Added comprehensive documentation of the Hamilton VENUS .pkg binary package format (header, entry table, zlib decompression, HxPars manifest parsing).
  • Package extractor -- Added extract_pkg.py for parsing and extracting Hamilton VENUS .pkg binary package files.

LLM / Copilot Instructions

  • Non-ASCII character zero-tolerance rule -- Added a prominent rule at the top of the Copilot instructions prohibiting em dashes, en dashes, smart quotes, non-breaking spaces, and all other non-ASCII characters in any workspace file. The VENUS compiler (Win32/ANSI) misinterprets UTF-8 multi-byte sequences, causing silent corruption and cascading syntax errors.
  • Comprehensive HSL language rules -- Added detailed rules covering:
    • variable vs string type system and when to use each
    • String member function reference table
    • sequence.GetPositionId() takes zero arguments (use SetCurrentPosition first)
    • sequence.Add(labwareId, positionId) argument order
    • private function scope (file-local only)
    • No anonymous blocks inside functions
    • Variable declarations must be at top of scope
    • Array element assignment (one per line)
    • No array element access in + expressions
    • No continue keyword
    • No compound assignment operators (+=, -=, etc.)
    • Function declaration/definition pairing
  • HSL Debugger usage instructions -- Added complete documentation for the Python-based HSL simulation runtime, including command-line options, scope/limitations, and examples for testing library files.

Codebase Cleanup

  • Purged all em/en dashes across 40+ files (.ts, .js, .py, .md, .json, .ps1) -- replaced with -- and - respectively, ensuring workspace-wide consistency with the VENUS compiler's ANSI requirement.
  • Removed stale .vsix binaries from the repository.
  • Rebuilt all compiled output (out/ directory) to match cleaned TypeScript sources.

Full Commit Log

Commit Description
b06f342 Version bumped to 2.0.6, 355 files packaged
6ff0516 Parser: add missing types to type-check tuples; handle unknown types
9ee7571 Interpreter: handle absence in HSL code paths
ee17c11 Debugger: track vector database lines, system progress trace output
9997496 Debugger: add targeted debug, COM object creation handling
772901a Interpreter: fix global namespace-scoped lookups
5c79c8c Diagnostics: scope-aware variable type tracking (first-declaration-wins fix)
89d6248 Remove customEditors contribution from package.json and extension.ts
b5821e5 Rebuild and repackage (353 files, 3.11 MB)
0b63cbb Diagnostics: add array-element-in-expression rule
6b3e9ac Rebuild: prepublish tsc compilation
a48df54 Version bump to 1.91.3, clean rebuild
21f6de1 Add non-ASCII zero-tolerance rule; purge 1,369 em/en dashes workspace-wide
a55d6af Diagnostics: string member function on wrong type checker
add8e96 Diagnostics: object type receiver detection for arity checker
2bcdf89 Diagnostics: skip arity validation on object-typed COM receivers
e009840 Fix BarcodedTipTrackingHelper; add HSL language rules to instructions
72304b4 Diagnostics: changelog visibility, method call checks, dotnet checksum updates
002054f Add "Open in Hamilton HSL Editor" context menu command
8d88b83 Add Hamilton .pkg format documentation and extractor
e03a864 Remove stale .vsix binaries, update version

Installation

Download hsl-language-support-2.0.6.vsix from the assets below, then install via:

code --install-extension hsl-language-support-2.0.6.vsix

Or in VS Code: Extensions sidebar > ... menu > "Install from VSIX..."