You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 55cb5d6
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+30-19Lines changed: 30 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Contributing
2
2
3
-
Thanks for helping keep Pine Script highlighting accurate. This document covers the workflow; the README explains how the grammar is put together.
3
+
Thanks for helping keep Pine Script support accurate. This document covers the workflow; the README explains what the extension does and how the pieces fit together.
| Change a theme color |`themes/*.json` (`tokenColors` for the grammar, `semanticTokenColors` for declared names) |
34
+
| Never |`syntaxes/pinescript.tmLanguage.json`, `src/data/reference.json`, `dist/` (generated) |
30
35
31
36
The data files are grouped by namespace. A function `ta.sma` goes under the `"ta"` key as `"sma"`. Identifiers without a namespace go under the `""` key. Nested namespaces such as `strategy.closedtrades` are their own key.
32
37
33
38
`src/extension/core` never imports `vscode`; that is what makes it testable with vitest. Providers and commands only translate between VS Code types and core types.
34
39
40
+
Everything a provider needs from a document goes through `analyze()` in `src/extension/vscode/document-cache.ts`, which parses each document once per version. Anything that walks every identifier of a file should go through `sourceIndex()` in `src/extension/core/symbols.ts` rather than rescanning the token stream: that is what keeps the offline checks linear instead of quadratic on long scripts.
41
+
35
42
## Working on the extension
36
43
37
44
```sh
@@ -68,18 +75,22 @@ Built-in identifiers come from the [Pine Script v6 reference](https://www.tradin
68
75
## Manual checklist before a release
69
76
70
77
- Completion after `ta.`, inside `plot(`, after `//@`, after `import `
71
-
- Hover on `close`, `ta.sma`, a user function, an import line
78
+
- Hover on `close`, `ta.sma`, a user function, a function parameter, an import line
72
79
- Signature help through all parameters of `plot(`
Copy file name to clipboardExpand all lines: CHANGELOG.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,29 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
5
5
6
6
## [Unreleased]
7
7
8
+
## [3.4.0] - 2026-09-08
9
+
10
+
A review pass over the whole extension: three defects that produced wrong output, a large performance
11
+
fix, and documentation for every exported declaration.
12
+
13
+
### Fixed
14
+
15
+
-**Add Type Annotations wrote broken code.** A declaration's column was found by searching the raw line for its name, so `var a = 1` reported column 1 and the command produced `vint 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.
16
+
-**A `for` counter was recorded with `for` as its type**, so a value read from it was annotated `for x = i`. Counters are now typed `int`, and `for x in`, `for [index, element] in` declare their names too. All three are scoped to the loop block rather than the rest of the file.
17
+
-**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.
18
+
- Range formatting on a document with Windows line endings never recognised that nothing had changed, and returned an edit anyway.
19
+
20
+
### Changed
21
+
22
+
- 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.
23
+
- Hovering a function parameter shows its declaration and its `//@param` text instead of nothing.
24
+
- The Outline lists the declarations at the top level of a script and no longer mixes in variables declared inside blocks.
25
+
26
+
### Documentation
27
+
28
+
- Every exported function, class, interface and type in `src/extension` now carries a comment saying what it is for and what its contract is, rather than only the ones with surprising behaviour.
29
+
-`CONTRIBUTING.md` covers the formatter, the offline rules, navigation, colours and semantic tokens, and explains where a change that walks every identifier belongs.
0 commit comments