v0.6.0 — semantic checks in the editor, engine consumed from npm - #21
Merged
Conversation
Ships the seven semantic detectors to users, and moves the extension onto the published engine rather than its own copy. WHAT USERS GET Diagnostics for code that COMPILES and is still wrong: repainting request.security, ta.* inside conditionals, plot/bgcolor outside global scope, functions defined in blocks, platform-limit breaches, entries with no exit. Suppressible with `// pine-ignore: S1` where the author has considered it; syntactic diagnostics remain non-suppressible because a compile error is a fact. ARCHITECTURE (ADR-0001) The extension now consumes pinescript-v6-validator@0.2.0 rather than duplicating the checks. I started to mirror the engine sources into src/parser/ and stopped — that is exactly the drift this project has already been bitten by. The build copies the pinned package's compiled output into dist/engine/; the npm package remains the single source and the copy is a regenerated build artefact. TWO PACKAGING FAILURES CAUGHT BEFORE RELEASE 1. The first VSIX excluded node_modules, so the engine dependency was absent and the extension would have installed and died at activation. Found by extracting the archive and EXECUTING the packaged code — the file listing looked fine. 2. Un-ignoring node_modules to fix that made vsce enumerate the entire tree and hang past ten minutes. Copying the engine into dist/ at build time avoids both. Also wires the semantic source into validate-cli.js and the golden corpus, which scripts/audit.js requires — that guard now covers a diagnostic source that lives in a dependency rather than in src/parser/. Tests 169. Packaged VSIX verified by execution: S1 and S7 fire, clean scripts stay clean, suppression works, syntactic checks unaffected.
|
✅ All checks passed! Ready for review. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ships the seven semantic detectors from SPEC.md to users.
What users get
Diagnostics for code that compiles and is still wrong:
request.security()reading the current, forming bar — repaintingta.*inside a conditional — history develops gapsrequest.*()— TradingView rejects the scriptplot/bgcoloroutside global scope — v6 scope errorstrategy.entrywith no exit anywhere// pine-ignore: S1suppresses one you have considered. Syntactic diagnostics are never suppressible.Architecture — ADR-0001 enforced
Extension now consumes
pinescript-v6-validator@0.2.0. I started mirroring the engine sources intosrc/parser/and stopped — that is precisely the drift this project has already been bitten by. Build copies the pinned package's output intodist/engine/; the package stays the single source.Two packaging failures caught before release
node_modulesis excluded, so the engine dependency was absent. Caught by extracting the archive and executing the packaged code — the file listing looked perfectly fine.node_modulesmadevscewalk the whole tree and hang past ten minutes.Verification
npm testReal bugs found
examples/indicator.2.3.pinecalledbgcolor()insideif— a genuine v6 scope error. One of my own corpus fixtures calledta.highestinsideif barstate.islast, the exact anti-pattern S2 exists to catch.