From 8eded2f273a38ea2dc4a07c22f647d0777ea380e Mon Sep 17 00:00:00 2001 From: Kuba Sekowski Date: Wed, 29 Jul 2026 15:21:04 +0200 Subject: [PATCH] fix(metadata): mark the SHEET/SHEETS argument as optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `SHEET` and `SHEETS` declared their single argument as required in `implementedFunctions`, although both accept a zero-argument call: `runFunctionWithReferenceArgument` serves `args.length === 0` itself, before `isNumberOfArgumentValuesValid` is consulted. The change is metadata-only — `optionalArg` has no other consumer in `src/`, and evaluation is unaffected (covered by the existing function-sheet/function-sheets specs). It is split out of #1692, whose function-metadata API is the first consumer that can observe it. Co-Authored-By: Claude Opus 5 --- CHANGELOG.md | 1 + src/interpreter/plugin/InformationPlugin.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46de676d5e..0b82300dee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed +- Fixed the `SHEET` and `SHEETS` functions declaring their single argument as required, while both accept a zero-argument call. - Fixed the behavior of `MATCH`, `VLOOKUP`, `HLOOKUP`, and `XLOOKUP` functions when the search range contained empty cells. [#1697](https://github.com/handsontable/hyperformula/pull/1697) - Fixed the `VLOOKUP`, `HLOOKUP`, and `XLOOKUP` functions to return `0` instead of an empty value when the matched cell in the result range is empty. [#1697](https://github.com/handsontable/hyperformula/pull/1697) - Fixed the page freezing when entering a long string of digits containing a non-digit character near the end (e.g. `012...789a` or `012...789 123`) into a cell. [#1520](https://github.com/handsontable/hyperformula/issues/1520) diff --git a/src/interpreter/plugin/InformationPlugin.ts b/src/interpreter/plugin/InformationPlugin.ts index 4815221078..8c10ac05ed 100644 --- a/src/interpreter/plugin/InformationPlugin.ts +++ b/src/interpreter/plugin/InformationPlugin.ts @@ -137,7 +137,7 @@ export class InformationPlugin extends FunctionPlugin implements FunctionPluginT 'SHEET': { method: 'sheet', parameters: [ - {argumentType: FunctionArgumentType.STRING} + {argumentType: FunctionArgumentType.STRING, optionalArg: true} ], doesNotNeedArgumentsToBeComputed: true, vectorizationForbidden: true, @@ -145,7 +145,7 @@ export class InformationPlugin extends FunctionPlugin implements FunctionPluginT 'SHEETS': { method: 'sheets', parameters: [ - {argumentType: FunctionArgumentType.STRING} + {argumentType: FunctionArgumentType.STRING, optionalArg: true} ], doesNotNeedArgumentsToBeComputed: true, vectorizationForbidden: true,