Skip to content

Add table.cell_set_text_formatting and table.cell text_formatting - #307

Merged
alexgrover merged 1 commit into
LuxAlgo:devfrom
lenstrats:fix/table-cell-text-formatting
Sep 15, 2026
Merged

alexgrover merged 1 commit into
LuxAlgo:devfrom
lenstrats:fix/table-cell-text-formatting

Conversation

@lenstrats

Copy link
Copy Markdown

Problem

table.cell_set_text_formatting() is not implemented or bound in Context, so scripts that call it fail. table.cell() also ignores the v6 text_formatting argument.

//@version=6
indicator("repro", overlay = true)
var t = table.new(position.top_right, 1, 1)
if barstate.islast
    table.cell(t, 0, 0, "x", text_formatting = text.format_bold)
    table.cell_set_text_formatting(t, 0, 0, text.format_italic)
plot(close)

TypeError: table.cell_set_text_formatting is not a function

This script compiles on TradingView. 1 of 729 popular open-source indicators failed on this (Parabolic SAR Constraint Kinematics & Run Geometry).

Fix

This mirrors cell_set_text_font_family:

  • table.cell() now reads text_formatting, both positionally (index 13) and as a named argument. It is stored on the cell with default "none", matching text.format_none, and added to TABLE_CELL_PARAMS.
  • Add cell_set_text_formatting to TableHelper and to the TableObject delegate, and bind it in Context.
  • Update the API coverage docs (table.md, pinescript-v6/table.json).

Tests

  • tests/namespaces/table/table.test.ts: the namespace setter and the method delegate, plus a native Pine script covering text_formatting in table.cell(). The Pine script compiles on TradingView.
  • The new tests fail on dev (table.cell_set_text_formatting is not a function) and pass with this change. table-named-args.test.ts still passes. Full suite: 1840 passed, 5 skipped, 16 todo.
  • Real indicators: the affected indicator now runs without errors (60 labels, 1 table).
  • Differential check: all 729 indicators were run on identical cached market data within the same clock hour, once against dev and once against this branch. The affected indicator now runs without errors. No regressions. The only changed output values are in 6 scripts that use timenow or math.random; their output also differs between two identical dev runs. Output was compared with the text_formatting key left out, because this change adds that key to every table cell.

The repro scripts and tooling are in https://github.com/lenstrats/pinets-compat.

🤖 Generated with Claude Code

table.cell_set_text_formatting() was not implemented or bound in Context, so
scripts calling it threw "table.cell_set_text_formatting is not a function",
and table.cell() ignored the v6 `text_formatting` argument.

Mirrors cell_set_text_font_family: `text_formatting` is parsed in table.cell()
(positional index 13 and named), stored on the cell (default "none", matching
text.format_none), settable through the helper and the table object
delegate, and bound in Context. API coverage docs updated.

Found in 1 of 729 popular open-source TradingView indicators (Parabolic SAR
Constraint Kinematics & Run Geometry), which runs without errors with this
change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@lenstrats

Copy link
Copy Markdown
Author

recheck

@alexgrover
alexgrover merged commit 83559f2 into LuxAlgo:dev Sep 15, 2026
1 of 2 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants