Pre 6.0 to 6.0 migration issues

I have CM in prod for some time now all using the pre 6.0 build and kept postponing the migration since I expected there would be some turbulence.

From the get go the following extensions are missing when trying to setup the extensions:

  • @codemirror/closebrackets
  • @codemirror/comment
  • @codemirror/matchbrackets
  • @codemirror/rectangular-selection

I assume they were moved?

List of deps:

    "@codemirror/autocomplete": "6.0.2",
    "@codemirror/commands": "6.0.1",
    "@codemirror/fold": "0.19.4",
    "@codemirror/highlight": "0.19.8",
    "@codemirror/history": "0.19.2",
    "@codemirror/lang-markdown": "6.0.0",
    "@codemirror/language": "6.2.0",
    "@codemirror/lint": "6.0.0",
    "@codemirror/state": "6.0.1",
    "@codemirror/view": "6.0.2",

Import list is:

import { autocompletion, completionKeymap } from '@codemirror/autocomplete';
import { closeBrackets, closeBracketsKeymap } from '@codemirror/closebrackets';
import { defaultKeymap, indentWithTab } from '@codemirror/commands';
import { commentKeymap } from '@codemirror/comment';
import { foldKeymap } from '@codemirror/fold';
import { highlightActiveLineGutter, lineNumbers } from '@codemirror/gutter';
import { history, historyKeymap } from '@codemirror/history';
import { indentOnInput, indentUnit } from '@codemirror/language';
import { lintKeymap } from '@codemirror/lint';
import { bracketMatching } from '@codemirror/matchbrackets';
import { rectangularSelection } from '@codemirror/rectangular-selection';
import { highlightSelectionMatches, searchKeymap } from '@codemirror/search';
import { EditorState, Extension } from '@codemirror/state';
import {
} from '@codemirror/view';

Also have a language extension using @lezer/lr and updating that one to 1.1.0 throws:

Server Error

RangeError: Parser version (13) doesn’t match runtime version (14)

List of deps in that repo:

  "dependencies": {
    "@codemirror/highlight": "0.19.8",
    "@codemirror/language": "6.2.0",
    "@codemirror/autocomplete": "6.0.2",
    "@lezer/lr": "1.1.0"

Any help would be greatly appreciated. My apologies if I missed a memo.

PS. Thanks for your work. CM is awesome :+1:

You can find information about breaking changes in the changelog. The exports from those packages were indeed moved somewhere else to simplify the package structure. Rebuilding your grammar with the current version of lezer-generator should solve the “Parser version (13) doesn’t match runtime version (14)” issue.

1 Like