Merge master into v1 - #1795
Merged
Merged
Conversation
…1712) Co-authored-by: Bronley Plumb <bronley@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Fixes all 183 violations across 35 files by either giving values their real types, narrowing existing `as any` casts to specific types, or routing generic event forwarding through the underlying emitter directly instead of a call-site cast. A few genuinely unavoidable any[] spreads (blocked from using .apply() by prefer-spread) are left as scoped, commented eslint-disable-next-line suppressions. Also fixes two related bugs uncovered along the way: - walkArray's optional `filter` callback had a stray inner `<T>` that shadowed the outer generic, silently widening every filtered item to `any` instead of the array's real element type. - Several event-forwarding `on()` implementations (Project, ProjectManager, DocumentManager, WorkerThreadProject) called handlers without awaiting/voiding them, silently swallowing unhandled promise rejections. The highest-leverage single fix: AstNode's abstract `clone()` had no declared return type at all, which alone accounted for 60+ of the 183 errors once no-unsafe-argument was enabled. Giving it (and Statement's and Expression's overrides) an explicit return type fixed the majority of the parser/AST files in one change. Resolves #457 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review pass on top of #1785. Two goals: revert every change that altered runtime behavior, and cut the eslint-disable count where the rule can be satisfied by a better type instead. Reverted to master's logic (these were behavior changes, not type fixes): - BusyStatusTracker.once() / DocumentManager.once(): restore the on()/off() closure instead of calling the emitter directly - on() in DocumentManager, Project, WorkerThreadProject, ProjectManager: drop the `void handler(...)` wrapper. Not awaiting async handlers is a real bug, but fixing it changes rejection behavior and belongs in its own PR - BrsFile: restore the `arg.name` and `calleeName` duck-types. Narrowing them to VariableExpression drops DottedGetExpression, so `person.name` and `m.top.id` args silently lost their text. Added a regression test Fewer suppressions, no logic change: - pure-passthrough rest params typed `unknown[]` rather than `any[]`, which the rule accepts without a disable (and matches @rokucommunity/logger's own `debug(...messages: unknown[])`) - Logger, Scope, XmlFile, Sequencer - `as never` instead of `as any` for the two finalizeClone propsToReparent arrays whose constraint genuinely resolves to never - catch-all emit() overload so the widened event name needs no cast - Program.addOrReplaceFile: collapse the two identical branches Net: 12 disables (10 of them in the lsp event wrappers, where a widened `string` can't match a literal-string overload and no type fixes it). Worth considering an .eslintrc override for src/lsp/** instead. tsc clean, lint clean, 3043 passing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add a type-predicate overload to `AstNode.findAncestor` so a guard matcher infers its own result type, removing the redundant type argument from ~22 call sites. The pre-existing boolean-matcher signature is retained as a second overload, so explicit type arguments still work unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
# Conflicts: # src/Program.ts # src/Scope.ts # src/parser/AstNode.spec.ts # src/parser/AstNode.ts # src/parser/Expression.ts # src/parser/Statement.ts # src/validators/ClassValidator.ts
`PreceedingRegexTypes` gates where a `/` may begin a regex literal. `TemplateStringExpressionBegin` was missing, so any regex opening a template string expression lexed as division instead -- and a `}` in a character class then ended the expression early. `Comma` was missing for the same reason, breaking regexes in array/argument literals. Neither token can precede division, so adding them is unambiguous. Also drops a duplicate `Throw` entry. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TwitchBronBron <2544493+TwitchBronBron@users.noreply.github.com> Co-authored-by: Bronley Plumb <bronley@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
#1648) Co-authored-by: Bronley Plumb <bronley@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
markwpearce
approved these changes
Sep 8, 2026
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Ports every master commit since 0.73.1 (through 0.73.3). Where master's code collided with v1's rewrites, v1's architecture wins and the change was re-implemented against it rather than taken verbatim. Features ported: - `continue` transpiles to a goto label for firmware below 11.5 (#489) - go-to-definition for file path strings in BRS/BS/XML (#1648) - `isTerminal`/`previousInChain` on AstNode (#1788) - nested curly braces in template strings (#1539) - regex literals after `${` and `,` (#1789) - wrong-cased XML tag diagnostic (#1793) - duplicate/crashing "find all references" fix (#1791) - duplicate sourceMappingURL fix (#1786) - findAncestor type-guard inference (#1787) - lexer token-text interning (#1712) - memory-aware default for max worker threads (#1798) - js-yaml override bumped to ^4.3.2 (#1796) Notable adaptations: - master's whitespace fast-path skipped `addToken`, which in v1 is also what routes a token into `leadingTrivia`. Kept the Token allocation (trivia depends on it) and took only the interning half of that optimization. - #1798 rewrote WorkerPool around master's simpler worker tracking. v1 has an `isDead` crashed-worker feature master lacks, so only the `getDefaultMaxWorkerThreads` logic was ported, on top of v1's tracking. - `no-unsafe-argument` is a warning, not an error: master enabled it after cleaning up v0's call sites, and v1's rewrites carry ~76 more that were never part of that cleanup. - three tests from master assert v0 behavior v1 changed on purpose (Comment tokens are trivia, `getReferences` returns `[]` not null, and the NamespacedVariableNameExpression chain step is gone). Updated to v1's contract. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
TwitchBronBron
force-pushed
the
merge-master-into-v1
branch
from
September 9, 2026 14:32
ae1060f to
7dd2478
Compare
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.
Brings v1 up to date with every master commit through 0.73.3. Conflicts were resolved in v1's favor architecturally, but each feature was re-implemented against v1's APIs rather than dropped.
Ported from master
continuetranspiles to a goto label for firmware below 11.5 (Transpile continue down for firmware below 11.5 #489)isTerminal/previousInChainonAstNode(AddisTerminalandpreviousInChaingetters to AstNode #1788)${and,(Recognize regex literals after${and,#1789)sourceMappingURLfix (Avoid emitting a duplicate sourceMappingURL comment #1786)findAncestortype-guard inference (Infer node type from findAncestor type-guard matchers #1787)js-yamloverride bumped to^4.3.2(chore: Security enhancements #1796)Worth a reviewer's attention
addTokento avoid allocating a Token it discards. In v1addTokenis also what routes a token intoleadingTrivia, so skipping it silently dropped all whitespace trivia (20 test failures). Kept the allocation, took only the interning half.WorkerPoolaround master's simpler worker tracking. v1 has anisDeadcrashed-worker feature master lacks, so onlygetDefaultMaxWorkerThreadswas ported, on top of v1's tracking — taking master's file wholesale would have deleted that feature.@typescript-eslint/no-unsafe-argumentiswarnhere, noterror. Master enabled it after cleaning up v0's call sites; v1's rewrites carry ~76 more violations that were never part of that cleanup. TODO left in.eslintrc.js.getReferencesreturns[]rather thannull, and theNamespacedVariableNameExpressionchain step no longer exists. Updated to v1's contract, reasoning inline.Breaking changes
getDefinitionreturnsArray<Location | LocationLink>instead ofLocation[](Program,BrsFile,LspProject,Project,ProjectManager,WorkerThreadProject,ProvideDefinitionEvent.definitions). Inherent to Add generic go-to-definition for file path strings in BRS/BS/XML files #1648. Pushing aLocationstill works; reading results now needs narrowing.AliasStatement.valuenarrowed toVariableExpression | DottedGetExpression— master'sabstract clone(): Expressionmade the oldExpressionfield fail to compile against its own constructor. Only breaks code that was already building invalid AST.xml-tag-wrong-caseis a newError-severity diagnostic, so projects with<Children>/<Component>that previously built clean will report errors. Suppressible viadiagnosticFilters.Verification —
npm run test:nocover: 4503 passing, 0 failing (v1 baseline was 4373, so all 130 new tests from master run).npx tsc --noEmitandnpm run lintclean. Verified by hand that wrong-cased XML round-trips through transpile unchanged, and thatcontinue→gotocodegen is correct for nested loops, empty bodies, andcontinueinside anif.🤖 Generated with Claude Code