After using devin.ai to check some of my PRs, it caught something on #15817 that I was able to trace back to some decisions already in place for `TokenResultMapping`. It appears best to simplify the type and its relation to spaceId-tagging now to simplify it, to prevent the bug, and to hopefully prevent re-implementing the bug in the future.
I did consider constructing new instances of SearchNode, just with the changed spaceId... but that may be prone to causing memory churn that can be avoided by just letting spaceId be public.
Build-bot: skip build:web
Test-bot: skip
The implementation of ContextState.analyzeTransition is rather long and large, comprised of multiple subsections. We can get clearer, more maintainable code if we split it into multiple pieces - especially if we can do so in a manner that allows individual pieces to be unit-tested.
Also, with whitespace fat-finger handling coming up, special handling for applied suggestions may be needed. This refactor may facilitate development of a suggestion-specialized variant.
Build-bot: skip build:web
Test-bot: skip
This gives us smaller, more specialized methods - something that's usually a win of its own. It will also help facilitate further adjustments needed for support of whitespace fat-finger prediction & autocorrection.
Build-bot: skip build:web
Test-bot: skip
With the various ways that tokenizations can transition depending upon which potential inputs are applied, it's possible for multiple different tokenizations to transition into the same one. As such, there will no longer be "just one" way that a tokenization is reached.
Accordingly, it's best to perform word-boundary realignment operations (splits, merges) separately from text-editing operations (inserts, deletes).
Build-bot: skip build:web
Test-bot: skip
This function will also be utiliized for specifying tests for the specialized spur types coming up, so rather than duplicate the function, it's best to make it a proper test helper defined outside a specific unit test suite.
As the next work in line will introduce new, specialized spur types designed to replace the current 'legacy spurs', it is wise to clarify existing search-graph unit tests and which sections of the code they actually target. We'll eventually drop behaviors specific to 'legacy' spurs, but those that apply to the new incoming specialized spur types should be preserved.
At the same time, it may be wise to improve the unit testing of each specific type by placing each within its own specialized unit-test suite, then adding new tests that test and clarify the role of each type.
Build-bot: skip build:web
Test-bot: skip
The removed bits of code were already refactored into LegacyQuotientSpur's implementation. They just... weren't removed from their original source.
There's a chance that the original removal got undone during a rebase, but either way, it's best to do this cleanup now, as this code would impact some of the specialized spur code coming up.
Build-bot: skip build:web
Test-bot: skip
Simplify usage of `TestCompilerCallbacks` by making it responsible for
the `beforeEach` and `afterEach` incantations itself. There are a couple
of more complex usages of `TestCompilerCallbacks` which have been
excluded from this change on purpose.
Renamed `testCallbacks` to `callbacks` in the one place where it was
different.
Hoist @types/node and @types/mocha because inconsistent versions of
@types/mocha were causing compiler errors with this change.
Also added a cast to `fs.readFileSync` to `Uint8Array` to eliminate
compiler warnings/errors in test files.
Fixes: #15654
Test-bot: skip
The command shortcuts that were used by Web
scripts to create bundles via `esbuild` were not
properly handling the $KEYMAN_ROOT path when it
contained a space. These changes will rectify
this behavior and permit builds for such cases.
Build-bot: skip build:web
Test-bot: skip