HF-161: document OFFSET function limitations#1666
Merged
Merged
Conversation
Contributor
|
Task linked: HF-161 Document limitations of the OFFSET function |
✅ Deploy Preview for hyperformula-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
3 tasks
Performance comparison of head (67ad2cd) vs base (d213a57) |
dac40ae to
563642b
Compare
… to known-limitations)
Per Q2 principle (describe runtime-observable behavior, not internal strings): replace verbatim copies of internal parser error messages with behavioral descriptions. Future internal-string refactors will no longer silently invalidate these doc comments.
8b0b936 to
4b5366c
Compare
- Replace 'Raises a parsing error' wording with explicit 'cell stores a parser error' — the JS API does not throw an exception - Specify 'bare positive integer literals' instead of 'positive integers' to reflect that the parser accepts only NUMBER AST nodes (so `+1` and parenthesised expressions are also rejected, not just non-integers) - Reframe the out-of-sheet bullet to make the parse-time-vs-evaluation distinction explicit (matches Excel value but not detection timing)
✅ Deploy Preview for hyperformula-dev-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1666 +/- ##
========================================
Coverage 97.16% 97.16%
========================================
Files 175 175
Lines 15319 15319
Branches 3287 3356 +69
========================================
Hits 14884 14884
+ Misses 435 427 -8
- Partials 0 8 +8 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a single canonical
### OFFSET functionsub-section under## Nuances of the implemented functionsindocs/guide/known-limitations.md. Documents all six behavioral limits of the OFFSET function in HyperFormula, each backed either by an existing test inunit/parser/offset-translation.spec.tsor by a runtime check captured before this PR was opened.Removes the now-superseded one-row OFFSET entry from
docs/guide/list-of-differences.md(per Kuba's decision in the 2026-04-21 meeting: "można wtedy to stąd też usunąć. Żeby wszystko było tam jednak"). The HF-vs-Excel/Sheets behavioral differences for OFFSET are not lost — they remain documented in full inknown-limitations.mdunder the new sub-section, which is the canonical place for parse-time restrictions per the 04-21 decision to consolidate.Linked
known-limitations/list-of-differences/specifications-and-limitspagesLimits documented
NUMBERAST nodes only (unary+, parens, non-integers, values <1 all rejected at parse time)#REF!error stored at parse time (not evaluation time), with the message Resulting reference is out of the sheetgetCellFormulareturns the resolved reference, not the original=OFFSET(...)getCellFormulashows the resolved reference rather than the callRuntime verification
All six limits were verified against this branch's HEAD before publishing:
Tests covering all six limits live in
test/hyperformula-tests/unit/parser/offset-translation.spec.ts(24 tests, lines 13–206 in the private repo). Run vianpm run test:jest -- --testPathPattern="offset-translation".Test plan
handsontable/hyperformula/guide/known-limitations— verify the new### OFFSET functionsub-section renders, including the four embeddedjscode blocks/guide/list-of-differences— verify the table is intact and the OFFSET row is goneNotes
ErrorMessage.OutOfSheetstring is intentionally NOT quoted verbatim in the docs; the bullet describes the behavior instead, so future internal-string refactors don't break the docs.NUMBERliterals (unary+etc. rejected).Note
Low Risk
Low risk docs-only change; the main risk is confusing users if the newly documented OFFSET constraints are inaccurate or drift from implementation.
Overview
Adds a canonical
### OFFSET functionsection todocs/guide/known-limitations.mddescribing HyperFormula’s parse-time rewriting behavior and the resulting constraints (single-cell first arg, static integer shifts/sizes, strict positive literal height/width, out-of-sheet#REF!at parse time, andgetCellFormulareturning the resolved reference), with small JS snippets.Removes the now-redundant
OFFSETrow fromdocs/guide/list-of-differences.mdto consolidate documentation in one place.Reviewed by Cursor Bugbot for commit 67ad2cd. Bugbot is set up for automated code reviews on this repo. Configure here.