Commit 0c1d130
Add TEXTJOIN function with i18n and documentation (#1640)
## Summary
Adds the `TEXTJOIN` function — joins text from multiple strings and/or
ranges with a configurable delimiter.
Replaces #1625 (was opened from fork, now from upstream branch
directly).
### Features
- Scalar and array/range delimiter support with cycling behavior
- `ignore_empty` parameter to skip empty strings
- Type coercion (numbers, booleans → strings)
- Error propagation from both delimiter and text arguments
- 32,767 character limit (Excel compatibility)
- i18n translations for all 17 supported languages
- Documentation in `built-in-functions.md`
### Implementation
- New `textjoin` method + `flattenArgToStrings` helper in `TextPlugin`
- `repeatLastArgs: 1` metadata pattern (same as SUMPRODUCT, etc.)
- Defensive `CellError` check on `coerceScalarToString` return value
### Changed files
| File | Change |
|------|--------|
| `src/interpreter/plugin/TextPlugin.ts` | `textjoin()` +
`flattenArgToStrings()` |
| `src/error-message.ts` | `TextJoinResultTooLong` message |
| `src/i18n/languages/*.ts` (17 files) | TEXTJOIN translations |
| `docs/guide/built-in-functions.md` | TEXTJOIN row (alphabetically
between TEXT and TRIM) |
### Review feedback addressed (from #1625)
- Tests moved to private `hyperformula-tests` repo (companion PR
pending)
- Fixed docs alphabetical ordering
- Fixed unsafe `as string` cast in `flattenArgToStrings`
## Test plan
- [x] 35 tests in
`hyperformula-tests/unit/interpreter/function-textjoin.spec.ts`
- [x] Full suite: 480 suites / 5396 tests passed
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adds a new interpreter function (`TEXTJOIN`) with range flattening and
type coercion, which touches formula evaluation paths and may introduce
edge-case regressions around error propagation and large-string
handling.
>
> **Overview**
> Adds the new `TEXTJOIN` spreadsheet function, including interpreter
support for joining scalars and ranges with a delimiter (including
delimiter cycling), optional skipping of empty strings, and consistent
error propagation.
>
> Introduces a new `ErrorMessage.ResultTooLong` and enforces Excel’s
32,767-character output limit (returning `#VALUE!` when exceeded).
>
> Updates function documentation, the unreleased changelog, and adds
`TEXTJOIN` translations across all supported language packs.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
81426d7. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Kuba Sekowski <jakub.sekowski@handsontable.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 72db14b commit 0c1d130
20 files changed
Lines changed: 142 additions & 37 deletions
File tree
- docs/guide
- src
- i18n/languages
- interpreter/plugin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| 505 | + | |
505 | 506 | | |
506 | 507 | | |
507 | 508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
0 commit comments