Commit graph

3919 commits

Author SHA1 Message Date
Marc Durdin
37cb3767ac chore(developer): lower threshold for kmc-model-info coverage, work around TeamCity reporter bug 2025-03-05 01:00:03 +03:00
Marc Durdin
060189a1ab chore(developer): drop coverage threshold for developer-utils to 45% 2025-03-05 00:24:41 +03:00
Marc Durdin
03001bd971 chore(common): add unit test for nul and context() in context part of rule
The compiler and Core appear to be working correctly in this situation;
this test verifies Core's behaviour.

Fixes: #13299
2025-03-04 11:22:35 +01:00
Marc Durdin
accd5e268c
Merge pull request #13326 from keymanapp/fix/developer/13306-13307-include-nul-in-context-offset-kmw-v10
fix(developer): include `nul` in offset calculations for kmw v10 compiler
2025-02-28 23:37:00 +07:00
Marc Durdin
213bbd7d31
Merge pull request #13311 from keymanapp/chore/core/13303-unit-tests-for-nul-index-context
chore(core): add unit tests to validate `nul` with `index` and `context`
2025-02-28 23:36:40 +07:00
Marc Durdin
d6c2657bb0
Merge pull request #13308 from keymanapp/fix/developer/13301-13302-contextex-offset-check
fix(developer): verify `context(n)` offsets are valid in kmcmplib
2025-02-28 23:36:30 +07:00
Marc Durdin
a62735ea4b
Merge pull request #13324 from keymanapp/feat/developer/sensible-initial-dir-for-package-add-file
feat(developer): use .kps folder as initial dir for Add Files
2025-02-28 23:35:15 +07:00
Marc Durdin
0054e76915
Merge pull request #13336 from keymanapp/fix/developer/13293-use-u0001-for-deadkey-markers-in-debugger
fix(developer): use U+0001 for deadkey markers in the debugger
2025-02-28 23:28:57 +07:00
Marc Durdin
7aa0323e74
Merge pull request #13334 from keymanapp/fix/developer/13292-handle-line-breaks-in-debugger
fix(developer): handle line breaks in debugger correctly
2025-02-28 23:27:38 +07:00
Marc Durdin
7be92a8668
Merge pull request #13327 from keymanapp/chore/add-build-edit-action-for-delphi-projects
chore: add build.sh edit action for Delphi projects
2025-02-28 23:27:03 +07:00
Marc Durdin
b92d56198b
Merge pull request #13341 from keymanapp/fix/developer/11584-prevent-opening-same-project-twice
fix(developer): prevent simultaneous opening of the same project by two processes
2025-02-27 23:18:55 +07:00
Marc Durdin
1d450f0494 fix(developer): prevent double action of editor hotkeys in debugger
With the move to the richedit control, hotkeys such as Ctrl+V are
natively managed and we no longer need to handle them separately, as
this caused actions to be applied twice.

Fixes: #13335
2025-02-25 14:47:10 +01:00
Marc Durdin
324b912a07 chore(developer): cleanup code 2025-02-25 09:22:35 +01:00
Marc Durdin
10ba3c9068 fix(developer): use hashed lockfilename for projects
For the project lock files, instead of using a filename in the same path
as the project file, with a .lock extension, use a hash of the project
filename in the Keyman Developer appdata folder, to avoid confusion and
conflict in project folders.

Fixes: #11584
2025-02-25 09:19:14 +01:00
Marc Durdin
671b1baf6e fix(developer): prevent simultaneous opening of the same project by two processes
There is a race condition where two processes may both attempt to open
the same project file. This appears to happen, for example, if an author
double-clicks on a single-click shortcut, launching Keyman Developer
twice in quick succession.

This fix adds a .lock file which is deleted automatically on close of
the project or on normal or abnormal process termination. If a second
process encounters the .lock file, it will simply open the welcome view
instead of attempting to open the project.

Fixes: #11584
Fixes: KEYMAN-DEVELOPER-1PR
2025-02-24 18:14:00 +01:00
Marc Durdin
86e141a963 chore(developer): add missing dependency reference 2025-02-24 10:56:50 +01:00
Marc Durdin
2add4d354d fix(developer): use U+0001 for deadkey markers in the debugger
Previously, we used U+FFFC as a marker in the debugger (for deadkeys and
LDML keyboard markers), which displayed as the letters OBJ in a small
dotted square. However, we switched the underlying component to
RichEdit, in order to better support rendering of many scripts (EDIT has
some problems). The RichEdit control silently converts U+FFFC to U+0020.
I switched to U+0001 as this is handled better, but has an unfortunate
missing-glyph marker.

In the future, it would be better to use a non-character marker
(leveraging RichEdit), but this is a much more complex change, and this
fix at least matches previous functionality.

Fixes: #13293
2025-02-24 10:38:33 +01:00
Marc Durdin
bdf6503eb6 chore(developer): Merge branch 'fix/developer/13292-handle-line-breaks-in-debugger' 2025-02-24 10:33:19 +01:00
Marc Durdin
cd29991697 fix(developer): additional cleanup of CRLF in debugger 2025-02-24 10:32:24 +01:00
Marc Durdin
3a9bbdaff7
Update developer/src/tike/child/UfrmDebug.pas 2025-02-24 09:51:00 +01:00
Marc Durdin
3c86ac332d fix(developer): handle line breaks in debugger correctly
The debugger memo takes input with \n but internally represents this as
\r\n, so we need to strip out \r in order to track caret position
correctly.

Fixes: #13292
2025-02-24 09:35:17 +01:00
Marc Durdin
a04e977749 fix(developer): include nul in offset calculations for kmw v10 compiler
The cached context comparison for v10 kmw compiler includes the `nul`
statement, unlike the comparison in the earlier compiler. This
difference was missed in earlier iterations including the recent patch
in #13003. This patch fixes the problem for both `context(n)` and
`index(store,n)` offset calculations.

Fixes: #13306
Fixes: #13307
Follows: #13003
2025-02-23 16:25:51 +01:00
Marc Durdin
ef60c08d7c chore: add build.sh edit action for Delphi projects
This opens up the Delphi IDE with the correct KEYMAN_ROOT environment,
which allows for debugging. This is very helpful when working with
multiple worktrees, and also helps to avoid editing a project in the
wrong tree.
2025-02-22 06:18:47 +01:00
Marc Durdin
1aaddf49c7 feat(developer): use .kps folder as initial dir for Add Files
Requested by @DavidLRowe. Default was either CWD or My Documents,
neither of which is helpful.

The initial dir will now be folder of the .kps file, and then will
remember last used folder for each additional use of the dialog for that
.kps file.
2025-02-22 06:13:03 +01:00
Marc Durdin
2b9b8eb419 chore(core): add unit tests to validate nul with index and context
Add 4 test keyboards to validate `nul` and `if` used in conjunction with
`index` and `context` and corresponding references in core unit tests.

Add a script to rebuild baseline keyboards using a copy of kmcomp.exe
16.0.138; this is setup and tested only on Windows (YMMV on WINE, etc).

Add the 4 additional baseline test keyboards to kmcmplib unit tests for
build consistency between kmcomp 16 and kmcmplib 18 (all pass).

Note: two of the new Core tests currently fail. This is expected, see
issue #13304.

Fixes: #13303
2025-02-21 13:06:29 +07:00
Marc Durdin
5d16d083bd chore(developer): update unit test error checks 2025-02-21 11:10:53 +07:00
Marc Durdin
4a797d0e5a fix(developer): verify context(n) offsets are valid in kmcmplib
Add validity checks to kmcmplib to verify that offsets provided to
`context(n)` are in range for the context, and do not point to
non-character elements (`nul` and `if`) in the context string.

Fixes: #13301
Fixes: #13302
Relates-to: #13299
Relates-to: #13276
2025-02-21 09:58:26 +07:00
Marc Durdin
64410d02e9 fix(developer): Use 'desktop' for target in OSK fill temp keyboard
When the IDE fills the On Screen Keyboard on the basis of the .kmn
rules, it generates a temporary .kmn and builds it. When it does this,
it temporarily replaces the `&targets` system store with one that is
supposed to ensure that a .kmx is generated. However, previously, for
reasons long lost in history, the store was filled with the value
'windows native'.

'native' is not a valid target (this may be due to confusion with
`if(&platform)` where 'native' is permitted), and now the compiler
verifies `&targets` (as of #11918), so this broke the compile.

Now uses 'desktop' (which encompasses 'windows', 'macos', 'linux').

Fixes: #13256
Relates-to: #11918
2025-02-18 10:53:38 +07:00
Marc Durdin
f3abae39f5
Merge pull request #13200 from keymanapp/chore/developer/13127-info-logs-for-kmc-copy-and-generate
chore(developer): add INFO messages for `kmc copy` and `kmc generate`
2025-02-14 10:13:07 +07:00
Marc Durdin
d6e7c0b9d1 chore: Revert "Merge branch 'master' into beta"
This reverts commit fae3932e15, reversing
changes made to 793daddb48.
2025-02-14 07:45:28 +07:00
Marc Durdin
19be021a6e chore: improve message color and content for info messages 2025-02-13 10:25:19 +07:00
Marc Durdin
0e48e44d2d chore(developer): add INFO messages for kmc copy and kmc generate
Note: these messages are in `kmc`, not in `kmc-copy` or `kmc-generate`,
matching the structure for existing `INFO_BuildingProject` and related
messages.

Fixes: #13127
2025-02-12 13:14:42 +07:00
Marc Durdin
342f216291 chore: increment to alpha 19.0 2025-02-11 14:14:15 +07:00
Marc Durdin
7554786bc3
Merge pull request #13161 from keymanapp/fix/developer/13135-new-project-welcome-and-model-file-format
fix(developer): link welcome.htm in package for new projects; use v17 project format for new models
2025-02-10 09:10:07 +07:00
Marc Durdin
c1b930217b
Merge branch 'master' into feat/developer/13109-check-that-package-does-not-contain-itself 2025-02-10 08:20:05 +07:00
Marc Durdin
2d5e3ee440
Merge pull request #13156 from keymanapp/feat/developer/13134-improve-messages-and-links
feat(developer): improve compiler messages and user interface
2025-02-10 08:19:11 +07:00
Marc Durdin
b9c0c180db
Merge pull request #13131 from keymanapp/fix/developer/13052-support-non-us-base-keyboard-in-debugger
fix(developer): support non-US base keyboard layouts in debuggers
2025-02-10 08:19:04 +07:00
Marc Durdin
d5a594ad81
Merge pull request #13118 from keymanapp/feat/developer/13067-verify-version-format-in-kmc-package
feat(developer): verify package version number format in kmc-package
2025-02-10 08:18:53 +07:00
Marc Durdin
503d045fee fix(developer): for new projects, link welcome.htm in package; use v17 project format for new models
* Links welcome.htm in the package details for all project types
* Uses v17 project file format for new lexical model projects
* Nit: changes shortcut key for 'supported languages' from 'l' to 's'
  to fix conflict with 'full copyright'.

Fixes: #13135
2025-02-07 13:50:11 +07:00
Marc Durdin
a00e446ee7
chore(developer): use correct .kmp file extension in fixture
Co-authored-by: Darcy Wong <darcy_wong@sil.org>
2025-02-07 05:11:47 +01:00
Marc Durdin
4509aca88a feat(developer): verify that packages do not contain themselves in kmc-package
Fixes: #13109
2025-02-07 09:30:07 +07:00
Marc Durdin
bd4633333b feat(developer): improve compiler messages and user interface
* Add unit test to verify the format of message detail strings
  (max line length of 80 chars)
* Add unit test to verify non-null, non-empty message strings
* Tidy up a number of messages (to pass unit tests)
* Add message details for all kmw compiler messages
* Add a clickable link for the TIKE message window for each message
  so that explanations and further message details are more accessible
  to authors (`kmc message` is already available for command-line users)
* Fixes a number of minor issues with the messages window in TIKE,
  mostly relating to when popup menu commands are enabled and how
  messages are selected.

Fixes: #13134
2025-02-07 08:46:46 +07:00
Marc Durdin
432f975283 fix(developer): support non-US base keyboard layouts in debuggers
Keyman Core expects US English virtual key codes, so make sure that the
debuggers translate the key codes they receive from Windows to the hard-
coded values for US English, as defined in ScanCodeMap.

Fixes: #13052
2025-02-05 15:22:24 +07:00
Marc Durdin
662ad0f4c1
Merge pull request #13080 from keymanapp/chore/developer/add-verbose-logs-for-copier
chore(developer): add verbose logs for project copier
2025-02-05 11:30:33 +07:00
Marc Durdin
7d70b6c31d
Merge pull request #13076 from keymanapp/feat/developer/13073-kmc-copy-ui-in-developer
feat(developer): add user interface for `kmc copy` to TIKE
2025-02-05 11:30:22 +07:00
Marc Durdin
2df63dddae
Merge pull request #13075 from keymanapp/fix/developer/13072-make-kmc-log-options-consistent
fix(developer): make kmc log options consistent across all commands
2025-02-05 11:30:10 +07:00
Marc Durdin
9db0d086dc
Merge pull request #13113 from keymanapp/feat/developer/kmc-include-command-line-in-sentry-reports
feat(developer): include command line in kmc sentry reports
2025-02-04 11:43:12 +07:00
Marc Durdin
4a879acd9d chore(developer): minimize PII in sentry cmdline report 2025-02-04 10:12:23 +07:00
Marc Durdin
439c091c9e chore: update docs to reference node 20.0
Relates-to: keyman-keyboards/khmer_angkor#1
2025-02-04 07:58:52 +07:00
Marc Durdin
706f3996c2 chore(developer): prevent leading zeroes in initial component of version number 2025-02-03 14:07:38 +07:00