Skip to content

v1#1484

Open
TwitchBronBron wants to merge 574 commits into
masterfrom
v1
Open

v1#1484
TwitchBronBron wants to merge 574 commits into
masterfrom
v1

Conversation

@TwitchBronBron
Copy link
Copy Markdown
Member

This is the official branch for the v1.0.0 release, tracking milesone v1.0.0.

markwpearce and others added 30 commits February 13, 2025 10:59
…e,tag,segment,etc, instead of looping all diagnostics
markwpearce and others added 25 commits May 7, 2026 08:58
The plugin event system swallows handler exceptions and logs them via
console.error, which lets tests pass while real bugs go silent. Each error
below was firing during the test suite run; the underlying cause is fixed
in production code (or the affected test) so the ERROR log line is gone.

- util.getCallFuncType: bail when methodName is empty/missing. An unfinished
  `widget@.` callfunc has tokens.methodName === undefined; the downstream
  ReferenceType chain ended up in `getCacheKey('undefined')` and crashed.
- util.getAllDottedGetPartsAsString: skip undefined parts. Same input shape
  pushed an undefined methodName token into the parts array; reading
  part.text then crashed.
- ReferenceType (ParamTypeFromValueReferenceType.proxy.get): bail to
  DynamicType when getDefaultTypeFromValueType re-wraps the same objType.
  An unresolvable IntersectionType passed in returns a fresh
  ParamTypeFromValueReferenceType wrapper of itself; the proxy then
  forwards the get to that wrapper, which calls getDefaultTypeFromValueType
  again on the same intersection, repeats forever via Reflect.get and
  blows the call stack. Also skip re-wrapping in
  util.getDefaultTypeFromValueType when the input is already a
  ParamTypeFromValueReferenceType (defense in depth — the proxy bail
  catches the live recursion, the util skip prevents future callers from
  building the same chain on a single hop).
- Project.validate: bail if builder/program was disposed. ProjectManager's
  Phase-2 awaited validate slot can be reached after a superseding sync
  disposed the project (worker-thread or otherwise).

Test-side adjustments (not production fixes):

- Parser.spec.ts token() helper now defaults synthetic tokens to a
  zero-width (0,0) location instead of `null`. Real lexer-emitted tokens
  always have a location, and the parser does range arithmetic on
  token.location.range for paths like splitting `exitwhile` into
  `exit` + `while`. Production was correct; the helper was the gap.
- Program.spec.ts 'fires plugin events' / 'sets needsTranspiled=true':
  build prepares every file in the program (including the auto-injected
  bslib added by BscPlugin.beforeBuildProgram). The two test plugins
  assumed `event.file` was always the authored main.brs and crashed on
  bslib's AST. Guard each handler with `if (event.file !== file)`.
- LanguageServer.spec.ts 'project-activate' describe: tests fire the
  event directly on the project manager without calling server.run(),
  so connection.workspace was never wired up and syncLogLevel crashed.
  Added a beforeEach that assigns the existing mock connection.
- ProjectManager.spec.ts 'spawns a worker thread when threading is
  enabled': comment the test to note that the afterEach
  manager.dispose() will print a 'MessageHandler is now disposed' error
  to the console. That's expected — Phase 2 worker-thread validation
  isn't awaited and the dispose tears it down before the in-flight
  worker request resolves.
Splitting the file-validation forEach into three steps let cancellation
land between `validateFile` and `afterValidateFile`, leaving files in a
half-processed state. The next validation either re-ran BrsFileValidator
(pushing duplicate symbols that CrossScopeValidator flagged as name
collisions) or skipped the file entirely (no segments registered → no
scope diagnostics). Collapsing the three plugin events into one per-file
sequencer action makes cancellation atomic at file granularity, removing
the entire half-state class of bugs without needing dedup or rollback.

Plugins that need an all-files-done signal should subscribe to
`afterValidateProgram` instead of `afterValidateFile`.
…ogging

Adds eight regression tests covering common-file edits propagating across
scopes (renames, additions, signature changes, namespace members, sync and
async with cancellation, rapid overlapping edits). All eight pass under the
atomic-per-file structural fix.

Also adds a debug log inside ScopeValidator's `addDiagnostic` and
`addMultiScopeDiagnostic` that fires when a diagnostic falls through to
`ScopeValidatorDiagnosticTag.Default`. There is no `clearByFilter` for
that tag anywhere in the codebase, so any diagnostic registered outside
an active segment walk sticks for the lifetime of the process. This log
helps identify the code paths producing those non-clearable diagnostics.
The reported diagnostics turned out to be from an unrelated tool, not
from the never-cleared `Default`-tagged path. Removing the investigation
log added in the previous commit.
@rokucommunity-bot
Copy link
Copy Markdown
Contributor

Hey there! I just built a new temporary npm package based on a723ae8. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.50-v1.20260520123430.tgz

@rokucommunity-bot
Copy link
Copy Markdown
Contributor

Hey there! I just built a new temporary npm package based on 3ab3aaf. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-1.0.0-alpha.51-v1.20260520141716.tgz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-package create a temporary npm package on every commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants