@lvce-editor/editor-worker 19.18.1 → 19.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8599,47 +8599,17 @@ const setDecorations = (editor, decorations, diagnostics) => {
8599
8599
  };
8600
8600
  };
8601
8601
 
8602
- // TODO add command to set language id
8603
- // without needing to specify tokenizePath
8604
8602
  const setLanguageId = async (editor, languageId, tokenizePath) => {
8605
8603
  const {
8606
8604
  tokenizerId
8607
8605
  } = editor;
8608
- setTokenizePath(languageId, tokenizePath);
8609
- // TODO move tokenizer to syntax highlighting worker
8610
- // TODO only load tokenizer if not already loaded
8611
- // if already loaded just set tokenizer and rerender text
8612
- // TODO race condition
8613
8606
  await loadTokenizer(languageId, tokenizePath);
8614
8607
  const tokenizer = getTokenizer(languageId);
8615
8608
  const newTokenizerId = tokenizerId + 1;
8616
8609
  set$4(newTokenizerId, tokenizer);
8617
- const latest = getEditor$1(editor.uid);
8618
- if (!latest) {
8619
- return editor;
8620
- }
8621
- const syncIncremental = getEnabled();
8622
- const {
8623
- differences,
8624
- textInfos
8625
- } = await getVisible$1(editor, syncIncremental);
8626
- const latest2 = getEditor$1(editor.uid);
8627
- if (!latest2) {
8628
- return editor;
8629
- }
8630
- const newEditor4 = {
8631
- ...latest2,
8632
- differences,
8633
- focused: true,
8634
- textInfos
8635
- };
8636
-
8637
- // TODO don't update editor if tokenizer was already loaded
8638
- // TODO update syntax highlighting
8639
- // TODO get edits
8640
-
8641
8610
  return {
8642
- ...newEditor4,
8611
+ ...editor,
8612
+ focused: true,
8643
8613
  invalidStartIndex: 0,
8644
8614
  languageId,
8645
8615
  tokenizerId: newTokenizerId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.18.1",
3
+ "version": "19.19.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"