Add table.cell_set_text_formatting and table.cell text_formatting - #307
Merged
Merged
Conversation
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>
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
recheck |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
table.cell_set_text_formatting()is not implemented or bound inContext, so scripts that call it fail.table.cell()also ignores the v6text_formattingargument.→
TypeError: table.cell_set_text_formatting is not a functionThis 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 readstext_formatting, both positionally (index 13) and as a named argument. It is stored on the cell with default"none", matchingtext.format_none, and added toTABLE_CELL_PARAMS.cell_set_text_formattingtoTableHelperand to theTableObjectdelegate, and bind it inContext.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 coveringtext_formattingintable.cell(). The Pine script compiles on TradingView.dev(table.cell_set_text_formatting is not a function) and pass with this change.table-named-args.test.tsstill passes. Full suite: 1840 passed, 5 skipped, 16 todo.devand once against this branch. The affected indicator now runs without errors. No regressions. The only changed output values are in 6 scripts that usetimenowormath.random; their output also differs between two identicaldevruns. Output was compared with thetext_formattingkey 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