All notable changes to this project are documented in this file. The format follows Keep a Changelog and the project adheres to Semantic Versioning.
A review pass over the whole extension: three defects that produced wrong output, a large performance fix, and documentation for every exported declaration.
- Add Type Annotations wrote broken code. A declaration's column was found by searching the raw line for its name, so
var a = 1reported column 1 and the command producedvint ar a = 1. Columns now come from the tokens. The same column is used by Go to Definition and Rename, which were off by the same amount. - A
forcounter was recorded withforas its type, so a value read from it was annotatedfor x = i. Counters are now typedint, andfor x in,for [index, element] indeclare their names too. All three are scoped to the loop block rather than the rest of the file. - The Outline pointed at the wrong lines for the fields of a type or the members of an enum whenever a comment or a blank line sat between them; every entry was off by one per interleaved line. Fields and members now carry the line they are written on.
- Range formatting on a document with Windows line endings never recognised that nothing had changed, and returned an edit anyway.
- The offline checks are 51 times faster on a long script: 160 ms to 3 ms on a 1,500 line document, and now linear rather than quadratic. Semantic highlighting on the same file went from 13 ms to 2 ms. Both used to rescan the token stream for every symbol they looked at; they share one index per document version now.
- Hovering a function parameter shows its declaration and its
//@paramtext instead of nothing. - The Outline lists the declarations at the top level of a script and no longer mixes in variables declared inside blocks.
- Every exported function, class, interface and type in
src/extensionnow carries a comment saying what it is for and what its contract is, rather than only the ones with surprising behaviour. CONTRIBUTING.mdcovers the formatter, the offline rules, navigation, colours and semantic tokens, and explains where a change that walks every identifier belongs.
- Go to Definition, Find All References, Document Highlight and Rename Symbol for functions, methods, types, enums, enum members, variables, parameters and import aliases. Renaming understands scope and leaves named arguments, import paths and type fields alone; renaming a built-in is refused.
- Offline checks that run as you type, with no network:
missing-version,old-version,legacy-name,local-scope-call,unknown-argument,duplicate-argument,unused-variable,unused-parameterandunused-import. Most carry a quick fix.pinescript.lint.enabledandpinescript.lint.disabledRulescontrol them. - Pine Script: Convert to v6, which applies the version, legacy-name and argument fixes across a whole file and reports exactly what it changed.
- Colour swatches with a picker for hex literals, the built-in colour constants,
color.new()andcolor.rgb(), writing the result back as a hex literal or an rgb call. - Semantic highlighting for the identifiers a document declares, so parameters, enum members, type fields and import aliases are coloured for what they are. Both bundled themes gained matching
semanticTokenColors.
- The bundled themes enable semantic highlighting, which they previously switched off.
- A formatter behind Format Document and Format Selection. It indents local blocks with the four spaces the compiler requires, repairs two space and mixed tab indentation, keeps wrapped lines aligned while moving them off a block indent, spaces operators and arguments, and leaves strings, comments and import paths untouched. Lines are never joined or split.
pinescript.format.enabled, andeditor.defaultFormatterfor[pinescript], so formatting works without picking a formatter.- Quick fixes on compiler diagnostics: move a v4 built-in into its namespace, rename
studytoindicator, correct a misspelt name against the reference or the document, correct or remove a named argument, add the type keyword annainitialiser needs, widen a declared type, rename a variable that shadows a built-in throughout the file, and add a missing//@version=6. - Tests for the formatter and the quick fixes, and a check that every snippet and fixture survives a formatting round trip unchanged.
- Compiler diagnostics keep the placeholder values the compiler sends, which is what the quick fixes read.
- 78 new snippets, for a total of 97. They cover script headers and full
indicator()/strategy()declarations, libraryimport/export, tuples, types with methods, enums withinput.enum(),var/varip, conditionswitch, stepped and breaking loops,runtime.error()andlog.*(); section, divider, notes, date and TODO comments plus//@documentation blocks; everyinput.*()function, inline and grouped inputs;plotshape,plotchar,plotarrow,plotcandle,plotbar,bgcolor,barcolor,hline, band fills, gradient plots, labels, lines, boxes, tables, polylines and a debug label;alert()with plain and JSON messages; higher timeframe tuples, non-repaintingrequest.security(),request.security_lower_tf(), a security wrapper, sessions, timeframe changes, backtest windows and last-bar blocks; strategy orders, position flags, percent stop loss / take profit and an ATR trailing stop; crossover signals, a selectable moving average, Bollinger Bands, RSI with bands, ATR stops and breakout levels; arrays, maps and matrices. - A test that checks every snippet for unique prefixes, well-formed placeholders and v6 pragmas.
- The function tuple snippet no longer suggests names that shadow built-in variables.
- README documents the snippet catalogue and walks through the editor features in more detail.
3.0.0 - 2026-09-07
The extension becomes a full language extension. Highlighting is unchanged; everything below is new.
- Completion for built-ins, keywords, types, user symbols, named arguments, annotations and import paths, with documentation and signatures.
- Hover documentation for built-ins, user functions, types, enums, variables and imports.
- Signature help with overloads and named-argument awareness.
- Document outline (functions, methods, types, enums, top-level variables).
- Workspace library indexing and published TradingView library lookup for
importcompletion and hover. - Opt-in diagnostics from the TradingView compiler (
pinescript.diagnostics.remote, off by default). - Commands: New Indicator, New Strategy, New Library, Generate Docstring (with a code action), Add Type Annotations, Open Reference.
- Pine Dark and Pine Light color themes.
src/data/reference.json, generated from the v6 reference, and a build check that keeps it in step with the grammar data.
- Minimum VS Code version is 1.96.
- The package now ships a bundled extension entry point (
dist/extension.cjs) built with esbuild. npm run buildbuilds both the grammar and the extension; grammar-only scripts arebuild:grammarandbuild:grammar:check.line.set_xywas removed from the grammar data; it is not part of Pine Script v6.
2.0.1 - 2026-09-06
- README badges for Marketplace version, installs and rating. The shields.io Marketplace badges were retired and rendered as "retired badge".
2.0.0 - 2026-09-06
Complete rewrite targeting Pine Script v6. The grammar is now generated from data files, so keeping up with new built-ins is a one-line change.
- Full Pine Script v6 vocabulary extracted from the official language reference: 470+ built-in functions, 160+ built-in variables and 230+ constants across every namespace (
ta,math,str,array,matrix,map,request,strategy,input,label,line,box,table,polyline,linefill,log,runtime,chart,ticker,timeframe,syminfo,barstate,session,dividends,earnings,splits,footprint,volume_row, and more). - Keywords introduced since v4:
switch,while,once,for ... in,method,type,enum,import,export,varip, and theto/by/inloop keywords. - Type qualifiers (
series,simple,const,input), built-in types and generics (array<float>,map<string, Point>,matrix<int>). - Compiler annotations inside comments:
//@version=6,//@description,//@function,//@param,//@returns,//@type,//@field,//@variable,//@enum,//@strategy_alert_message. Backtick spans inside doc comments are highlighted as inline code. - Triple-quoted multiline strings (
"""...""",'''...''') added in Pine v6. str.formatplaceholders ({0},{1,number,#.##}) inside strings.- Floating point and exponent literals, hex colors with alpha (
#RRGGBBAA). - User-defined function and method definitions, named arguments (
length = 14), tuple destructuring ([a, b] = f()), user-defined type constructors (Point.new()),import user/lib/1 as alias. - Snippets for indicators, strategies, libraries, functions, methods, types, enums, control flow and common built-in calls.
- Language configuration: indentation-based folding,
// regionmarkers, auto-closing for both quote styles, indentation rules for=>blocks and control structures, four-space defaults for.pinefiles. .pinescriptfile extension and first-line detection via//@version=.- Grammar build pipeline (
npm run build), scope assertion tests and snapshot tests (npm test), Prettier formatting, GitHub Actions CI and a tag-triggered release workflow.
- Minimum VS Code version raised from 1.37 to 1.90.
- Scope names now follow TextMate conventions consistently:
support.function,support.variable,support.constant,support.class(namespaces),support.type,storage.modifier,entity.name.function,entity.name.type,variable.parameter. - Repository, homepage and issue tracker URLs updated to
github.com/yankikucuk/pine-script-syntax-highlighter. - Marketplace categories corrected to
Programming LanguagesandSnippets.
- Hex colors used the misspelled scope
contstant.other.pine, so no theme colored them. acrosin the built-in function list was a typo foracos.- Only integer literals were recognized;
1.5and2e3were split into several tokens. - Unterminated single-line strings no longer bleed into the rest of the file.
- The
bugsfield was nested insiderepositoryinpackage.jsonand the repository URL pointed to a misspelled path. - Trailing comma in
language-configuration.jsonmade it invalid JSON. - Short, common words (
n,tr,len,period) were highlighted as constants even when used as user variables.
- Pine v3 era identifiers that no longer exist in v6 (
study,security,tickerid,input.resolution, baresma,ema,rsiand friends). Use the namespaced v6 equivalents.
1.0.5 - 2020-05-06
:=reassignment operator and variable declarations.
1.0.0 - 2019-08-25
- Language operators, built-in variables and built-in functions for Pine Script v3/v4.