The boilerplate code for custom lexical models has never really been
tested. For use in a browser/worker context, we need to define
`exports`. The added unit test verifies that the model will build.
Test-bot: skip
Remove old content and place redirects where the content is adequately
replaced by the new walkthrough. Leaves some content which does not
overlap the walkthrough. Moved reference information about package
contents.
Test-bot: skip
Relative paths would cause `kmc copy` to fail to find sources files for
the project, because component paths would be constructed incorrectly.
The cleanest fix is to ensure that we always full resolve local file
paths before attempting to copy the project.
Fixes: #15659
Without `await`, a 'success' message is always returned, because the
Promise that is returned is not nullish. While the log message was
misleading, the outcome was already correct, because the parent function
`copyProject()` did correctly await the call to `doCopy()`.
Fixes: #15699
Test-bot: skip
Address a review comment from #15665 and cleanup additional references
that I missed the first time around, along with the `fs.readFileSync`
`Uint8Array` cast.
Follows: #15665
Test-bot: skip
Use RichEdit's `ITextDocument` interface to retrieve the selection
anchor/caret information, and avoid the side-effects that can arise with
the hacky `EM_GETSEL` / `EM_SETSEL` pattern we used previously.
Changing the selection with `EM_SETSEL` in order to find the anchor
point causes notification messages to be generated that can arrive at an
unexpected time in some text selection scenarios, which ended up with us
having a saved selection in the debugger pointing to the wrong text
range.
The name `Anchor` was a misnomer, because it was actually returning the
caret position, not the anchor for the selection, which is the far side
of the selection from the anchor!
Fixes: #11706
Fixes: KEYMAN-DEVELOPER-18A
The new project UI process detects if the target project folder already
exists in a given path, and asks if the author wants to overwrite it.
However, this has been inconsistently implemented -- in the clone
keyboard case, the process would fail with a message "error KM0B004:
Output path <PATH> already exists, not overwriting". In other cases, no
files would be removed, but existing files would be overwritten where
there was a collision, resulting in a messy project folder.
I have opted to prevent this situation in a consistent manner, requiring
the author to remove the folder themselves in Windows Explorer, even
though this is higher friction, because it pushes them into verifying
that they actually want to delete the contents of the folder.
I also took the opportunity to DRY out this verification process in the
six different New Project dialogs.
Fixes: #15063
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
While the debugger memo internally uses CRLF, in all references, CRLF
should be converted to CR for consistent text manipulation operations.
This follows a similar fix in the kmn debugger in #13334.
Also addresses review comments from @ermshiperete.
Fixes: #15601
Relates-to: #13334
Turned on strictNullChecks to verify the file and found a few other
problems in this file. However, there are many null check errors
reported across the kmc-package source which should be addressed in a
future patch. (This is a broader problem for the entire Typescript
source of Keyman.)
Fixes: #15627
Test-bot: skip
Build-bot: skip build:developer