-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update CodeMirror and lezer packages #15987
Update CodeMirror and lezer packages #15987
Conversation
Thanks for making a pull request to jupyterlab! |
as that version requires that `allowMultipleSelections` extension is enabled to set multiple cursors; it is enabled by default in JupyterLab but was previously filtered out in tests setup. This commit adds it to the include list of extensions to use in tests.
The cast from CodeMirror's `Rect` to `ICoordinate` was incorrect and was masking the fact that the former did not have `x`, `y`, `width`, `height`, nor `toJSON()`, along with the fact that CodeMirror could also return `null`. This lead to type safety violations and bad failure in a test.
- The ``CodeEditor.ICoordinate`` interface was corrected to not include ``toJSON()``, ``x``, ``y``, | ||
``width`` and ``height``; these properties were never set by methods returning ``ICoordinate`` | ||
and they were never used by methods accepting it. | ||
- ``CodeEditor.getCoordinateForPosition`` return type was corrected to clarify that it can return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be considered as a breaking change? Thinking this may affect some extensions not checking for the value to be null
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or I guess this change is ok, since it's a "fix" of the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a bug fix - if an extension was not checking for a non-null value (which it most likely did not) its users would have a runtime error in some cases which is arguably worse than the developer having a build time error after upgrading packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
It looks like |
References
PSA: if you see
../codemirror/src/extension.ts(823,17): error TS2322: Type
error after merging this PR, you need to calljlpm clean
before rebuilding again to remove old versions from packages dist.Code changes
CodeMirror core:
@codemirror/state
6.2.0 → 6.4.1@codemirror/view
6.9.6 → 6.26.0@codemirror/search
6.3.0 → 6.5.6@codemirror/language
6.6.0 → 6.10.1@codemirror/autocomplete
6.5.1 → 6.15.0@codemirror/commands
6.2.3 → 6.3.3Language modes
@codemirror/lang-css
: 6.1.1 → 6.2.1@codemirror/lang-html
: 6.4.3 → 6.4.8@codemirror/lang-javascript
: 6.1.7 → 6.2.2@codemirror/lang-markdown
: 6.1.1 → 6.2.4@codemirror/lang-python
: 6.1.3 → 6.1.4@codemirror/lang-sql
: 6.4.1 → 6.6.1@codemirror/lang-wast
: 6.0.1 → 6.0.2@codemirror/lang-xml
: 6.0.2 → 6.1.0@codemirror/legacy-modes
6.3.2 → 6.3.3Lezer
@lezer/common
: 1.0.2 → 1.2.1,@lezer/generator
: 1.2.2 → 1.7.0,@lezer/highlight
: 1.1.4 → 1.2.0,@lezer/markdown
: 1.0.2 → 1.2.0,User-facing changes
Hundreds of bug fixes in editor functionality, including a number of compatibility fixes. Some highlights:
@codemirror/view
:@codemirror/search
:@codemirror/language
:@codemirror/commands
:@codemirror/lang-css
:@codemirror/lang-html
:@codemirror/lang-markdown
:@codemirror/lang-sql
:@codemirror/lang-xml
:@codemirror/legacy-modes
:Backwards-incompatible changes
None