Skip to content

Release 3.2.0: formatter and quick fixes - #4

Merged
yankikucuk merged 1 commit into
masterfrom
feature/formatter-and-quick-fixes
Sep 8, 2026
Merged

yankikucuk merged 1 commit into
masterfrom
feature/formatter-and-quick-fixes

Conversation

@yankikucuk

Copy link
Copy Markdown
Owner

Summary

  • Formatter behind Format Document and Format Selection. Indents local blocks with the four spaces the compiler requires (repairing two space and mixed tab indentation), keeps wrapped lines aligned while shifting them off a block indent when Pine would read them as a new block, spaces operators and arguments, and leaves strings, comments, triple-quoted blocks and import paths untouched. Lines are never joined or split.
  • Quick fixes on compiler diagnostics: move a v4 built-in into its namespace, study to indicator, correct a misspelt name against the reference or the document, correct or remove a named argument, add the type keyword an na initialiser needs, widen a declared type, rename a variable that shadows a built-in throughout the file, add a missing //@version=6.
  • pinescript.format.enabled and an editor.defaultFormatter default for [pinescript].
  • Compiler diagnostics now carry the placeholder values the compiler sends, which the fixes read.
  • README documents both features with a before and after example.

Test plan

  • npm test (257 tests, 54 of them new)
  • npm run build and vsce package
  • Every snippet and test fixture (98 sources) formatted and recompiled with the TradingView compiler: none changed meaning, none changed diagnostics, all idempotent
  • A v4 era script with eight distinct faults fixed one lightbulb at a time, then formatted, compiles clean

@yankikucuk
yankikucuk merged commit 40822fd into master Sep 8, 2026
1 check passed
@yankikucuk
yankikucuk deleted the feature/formatter-and-quick-fixes branch September 8, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant