diff --git a/builder/Cargo.lock b/builder/Cargo.lock index 4ec14ca5..24c5ff75 100644 --- a/builder/Cargo.lock +++ b/builder/Cargo.lock @@ -43,22 +43,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys", ] [[package]] @@ -263,7 +263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -433,15 +433,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.61.2" @@ -450,68 +441,3 @@ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ "windows-link", ] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" diff --git a/client/package.json5 b/client/package.json5 index d00a1867..f94747cc 100644 --- a/client/package.json5 +++ b/client/package.json5 @@ -43,7 +43,7 @@ url: 'https://github.com/bjones1/CodeChat_editor', }, type: 'module', - version: '0.1.40', + version: '0.1.41', dependencies: { '@codemirror/commands': '^6.10.0', '@codemirror/lang-cpp': '^6.0.3', @@ -61,7 +61,7 @@ '@codemirror/lang-xml': '^6.1.0', '@codemirror/lang-yaml': '^6.1.2', '@codemirror/state': '^6.5.2', - '@codemirror/view': '^6.38.6', + '@codemirror/view': '^6.38.8', '@mathjax/mathjax-newcm-font': '4.0.0', codemirror: '^6.0.2', 'graphviz-webcomponent': 'github:bjones1/graphviz-webcomponent#dist', @@ -69,18 +69,18 @@ mermaid: '^11.12.1', 'npm-check-updates': '^19.1.2', 'pdfjs-dist': '^5.4.394', - tinymce: '^8.2.1', + tinymce: '^8.2.2', 'toastify-js': '^1.12.0', }, devDependencies: { '@types/chai': '^5.2.3', '@types/js-beautify': '^1.14.3', '@types/mocha': '^10.0.10', - '@types/node': '^24.10.0', + '@types/node': '^24.10.1', '@types/toastify-js': '^1.12.4', '@typescript-eslint/eslint-plugin': '^8.46.4', '@typescript-eslint/parser': '^8.46.4', - chai: '^6.2.0', + chai: '^6.2.1', esbuild: '^0.27.0', eslint: '^9.39.1', 'eslint-config-prettier': '^10.1.8', diff --git a/client/pnpm-lock.yaml b/client/pnpm-lock.yaml index 201098a8..ac137ef1 100644 --- a/client/pnpm-lock.yaml +++ b/client/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ^6.5.2 version: 6.5.2 '@codemirror/view': - specifier: ^6.38.6 - version: 6.38.6 + specifier: ^6.38.8 + version: 6.38.8 '@mathjax/mathjax-newcm-font': specifier: 4.0.0 version: 4.0.0 @@ -81,8 +81,8 @@ importers: specifier: ^5.4.394 version: 5.4.394 tinymce: - specifier: ^8.2.1 - version: 8.2.1 + specifier: ^8.2.2 + version: 8.2.2 toastify-js: specifier: ^1.12.0 version: 1.12.0 @@ -97,8 +97,8 @@ importers: specifier: ^10.0.10 version: 10.0.10 '@types/node': - specifier: ^24.10.0 - version: 24.10.0 + specifier: ^24.10.1 + version: 24.10.1 '@types/toastify-js': specifier: ^1.12.4 version: 1.12.4 @@ -109,8 +109,8 @@ importers: specifier: ^8.46.4 version: 8.46.4(eslint@9.39.1)(typescript@5.9.3) chai: - specifier: ^6.2.0 - version: 6.2.0 + specifier: ^6.2.1 + version: 6.2.1 esbuild: specifier: ^0.27.0 version: 0.27.0 @@ -222,8 +222,8 @@ packages: '@codemirror/state@6.5.2': resolution: {integrity: sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==} - '@codemirror/view@6.38.6': - resolution: {integrity: sha512-qiS0z1bKs5WOvHIAC0Cybmv4AJSkAXgX5aD6Mqd2epSLlVJsQl8NG23jCVouIgkh4All/mrbdsf2UOLFnJw0tw==} + '@codemirror/view@6.38.8': + resolution: {integrity: sha512-XcE9fcnkHCbWkjeKyi0lllwXmBLtyYb5dt89dJyx23I9+LSh5vZDIuk7OLG4VM1lgrXZQcY6cxyZyk5WVPRv/A==} '@esbuild/aix-ppc64@0.27.0': resolution: {integrity: sha512-KuZrd2hRjz01y5JK9mEBSD3Vj3mbCvemhT466rSuJYeE/hjuBrHfjjcjMdTm/sz7au+++sdbJZJmuBwQLuw68A==} @@ -706,8 +706,8 @@ packages: '@types/mocha@10.0.10': resolution: {integrity: sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==} - '@types/node@24.10.0': - resolution: {integrity: sha512-qzQZRBqkFsYyaSWXuEHc2WR9c0a0CXwiE5FWUvn7ZM+vdy1uZLfCunD38UzhuB7YN/J11ndbDBcTmOdxJo9Q7A==} + '@types/node@24.10.1': + resolution: {integrity: sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==} '@types/toastify-js@1.12.4': resolution: {integrity: sha512-zfZHU4tKffPCnZRe7pjv/eFKzTVHozKewFCKaCjZ4gFinKgJRz/t0bkZiMCXJxPhv/ZoeDGNOeRD09R0kQZ/nw==} @@ -878,8 +878,8 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - chai@6.2.0: - resolution: {integrity: sha512-aUTnJc/JipRzJrNADXVvpVqi6CO0dn3nx4EVPxijri+fj3LUUDyZQOgVeW54Ob3Y1Xh9Iz8f+CgaCl8v0mn9bA==} + chai@6.2.1: + resolution: {integrity: sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==} engines: {node: '>=18'} chalk@4.1.2: @@ -1618,8 +1618,8 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + js-yaml@4.1.1: + resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} hasBin: true json-buffer@3.0.1: @@ -2040,8 +2040,8 @@ packages: resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==} engines: {node: '>=18'} - tinymce@8.2.1: - resolution: {integrity: sha512-gbZJH91f91jLfD39juLt/oiAMoaxwTquJMJZR0A1uzcOVrddo8hI/2Y+Uji0/vPudmbDxatnmfIG/9/j3KzP0g==} + tinymce@8.2.2: + resolution: {integrity: sha512-CFDSZwciMvFGW2czK/Xig1HcOGpXI0qcQMIqaIcG2F4RuuTdf+LQTreyEZunAJoFTQ9L0KAugOqL7OA5TJkoAA==} to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} @@ -2216,14 +2216,14 @@ snapshots: dependencies: '@codemirror/language': 6.11.3 '@codemirror/state': 6.5.2 - '@codemirror/view': 6.38.6 + '@codemirror/view': 6.38.8 '@lezer/common': 1.3.0 '@codemirror/commands@6.10.0': dependencies: '@codemirror/language': 6.11.3 '@codemirror/state': 6.5.2 - '@codemirror/view': 6.38.6 + '@codemirror/view': 6.38.8 '@lezer/common': 1.3.0 '@codemirror/lang-cpp@6.0.3': @@ -2254,7 +2254,7 @@ snapshots: '@codemirror/lang-javascript': 6.2.4 '@codemirror/language': 6.11.3 '@codemirror/state': 6.5.2 - '@codemirror/view': 6.38.6 + '@codemirror/view': 6.38.8 '@lezer/common': 1.3.0 '@lezer/css': 1.3.0 '@lezer/html': 1.3.12 @@ -2270,7 +2270,7 @@ snapshots: '@codemirror/language': 6.11.3 '@codemirror/lint': 6.9.2 '@codemirror/state': 6.5.2 - '@codemirror/view': 6.38.6 + '@codemirror/view': 6.38.8 '@lezer/common': 1.3.0 '@lezer/javascript': 1.5.4 @@ -2285,7 +2285,7 @@ snapshots: '@codemirror/lang-html': 6.4.11 '@codemirror/language': 6.11.3 '@codemirror/state': 6.5.2 - '@codemirror/view': 6.38.6 + '@codemirror/view': 6.38.8 '@lezer/common': 1.3.0 '@lezer/markdown': 1.6.0 @@ -2324,7 +2324,7 @@ snapshots: '@codemirror/autocomplete': 6.19.1 '@codemirror/language': 6.11.3 '@codemirror/state': 6.5.2 - '@codemirror/view': 6.38.6 + '@codemirror/view': 6.38.8 '@lezer/common': 1.3.0 '@lezer/xml': 1.0.6 @@ -2341,7 +2341,7 @@ snapshots: '@codemirror/language@6.11.3': dependencies: '@codemirror/state': 6.5.2 - '@codemirror/view': 6.38.6 + '@codemirror/view': 6.38.8 '@lezer/common': 1.3.0 '@lezer/highlight': 1.2.3 '@lezer/lr': 1.4.3 @@ -2350,20 +2350,20 @@ snapshots: '@codemirror/lint@6.9.2': dependencies: '@codemirror/state': 6.5.2 - '@codemirror/view': 6.38.6 + '@codemirror/view': 6.38.8 crelt: 1.0.6 '@codemirror/search@6.5.11': dependencies: '@codemirror/state': 6.5.2 - '@codemirror/view': 6.38.6 + '@codemirror/view': 6.38.8 crelt: 1.0.6 '@codemirror/state@6.5.2': dependencies: '@marijn/find-cluster-break': 1.0.2 - '@codemirror/view@6.38.6': + '@codemirror/view@6.38.8': dependencies: '@codemirror/state': 6.5.2 crelt: 1.0.6 @@ -2479,7 +2479,7 @@ snapshots: globals: 14.0.0 ignore: 5.3.2 import-fresh: 3.3.1 - js-yaml: 4.1.0 + js-yaml: 4.1.1 minimatch: 3.1.2 strip-json-comments: 3.1.1 transitivePeerDependencies: @@ -2823,7 +2823,7 @@ snapshots: '@types/mocha@10.0.10': {} - '@types/node@24.10.0': + '@types/node@24.10.1': dependencies: undici-types: 7.16.0 @@ -3046,7 +3046,7 @@ snapshots: camelcase@6.3.0: {} - chai@6.2.0: {} + chai@6.2.1: {} chalk@4.1.2: dependencies: @@ -3085,7 +3085,7 @@ snapshots: '@codemirror/lint': 6.9.2 '@codemirror/search': 6.5.11 '@codemirror/state': 6.5.2 - '@codemirror/view': 6.38.6 + '@codemirror/view': 6.38.8 color-convert@2.0.1: dependencies: @@ -3919,7 +3919,7 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 - js-yaml@4.1.0: + js-yaml@4.1.1: dependencies: argparse: 2.0.1 @@ -4053,7 +4053,7 @@ snapshots: glob: 10.4.5 he: 1.2.0 is-path-inside: 3.0.3 - js-yaml: 4.1.0 + js-yaml: 4.1.1 log-symbols: 4.1.0 minimatch: 9.0.5 ms: 2.1.3 @@ -4408,7 +4408,7 @@ snapshots: tinyexec@1.0.2: {} - tinymce@8.2.1: {} + tinymce@8.2.2: {} to-regex-range@5.0.1: dependencies: diff --git a/client/src/CodeChatEditor.mts b/client/src/CodeChatEditor.mts index 8462b04c..7a271607 100644 --- a/client/src/CodeChatEditor.mts +++ b/client/src/CodeChatEditor.mts @@ -117,10 +117,14 @@ declare global { // Called by the Client Framework. open_lp: ( codechat_for_web: CodeChatForWeb, - cursor_position?: number, + cursor_line?: number, + scroll_line?: number, ) => Promise; on_save: (_only_if_dirty: boolean) => Promise; - scroll_to_line: (line: number) => void; + scroll_to_line: ( + cursor_line?: number, + scroll_line?: number, + ) => void; show_toast: (text: string) => void; allow_navigation: boolean; }; @@ -180,11 +184,12 @@ const is_doc_only = () => { // Wait for the DOM to load before opening the file. const open_lp = async ( codechat_for_web: CodeChatForWeb, - cursor_position?: number, + cursor_line?: number, + scroll_line?: number, ) => await new Promise((resolve) => on_dom_content_loaded(async () => { - await _open_lp(codechat_for_web, cursor_position); + await _open_lp(codechat_for_web, cursor_line, scroll_line); resolve(); }), ); @@ -205,7 +210,8 @@ const _open_lp = async ( // A data structure provided by the server, containing the source and // associated metadata. See [`AllSource`](#AllSource). codechat_for_web: CodeChatForWeb, - cursor_position?: number, + cursor_line?: number, + scroll_line?: number, ) => { // Use // [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) @@ -281,12 +287,14 @@ const _open_lp = async ( tinymce.activeEditor!.selection.moveToBookmark(bm); } mathJaxTypeset(codechat_body); + scroll_to_line(cursor_line, scroll_line); } else { await CodeMirror_load( codechat_body, codechat_for_web, [], - cursor_position, + cursor_line, + scroll_line, ); } autosaveEnabled = true; @@ -322,8 +330,7 @@ const save_lp = (is_dirty: boolean) => { mathJaxUnTypeset(codechat_body); // To save a document only, simply get the HTML from the only Tiny // MCE div. - tinymce.activeEditor!.save(); - const html = tinymce.activeEditor!.getContent(); + const html = tinymce.activeEditor!.save(); ( code_mirror_diffable as { Plain: CodeMirror; @@ -488,11 +495,11 @@ const save_then_navigate = (codeChatEditorUrl: URL) => { // This can be called by the framework. Therefore, make no assumptions about // variables being valid; it be called before a file is loaded, etc. -const scroll_to_line = (line: number) => { +const scroll_to_line = (cursor_line?: number, scroll_line?: number) => { if (is_doc_only()) { // TODO. } else { - codemirror_scroll_to_line(line); + codemirror_scroll_to_line(cursor_line, scroll_line); } }; diff --git a/client/src/CodeChatEditorFramework.mts b/client/src/CodeChatEditorFramework.mts index 153ffb10..86b46c6e 100644 --- a/client/src/CodeChatEditorFramework.mts +++ b/client/src/CodeChatEditorFramework.mts @@ -183,17 +183,19 @@ class WebSocketComm { await set_content( contents, current_update.cursor_position, + current_update.scroll_position, ); resolve(); }), ); } - } else if (cursor_position !== undefined) { + } else { // We might receive a message while the Client is // reloading; during this period, `scroll_to_line` // isn't defined. root_iframe!.contentWindow?.CodeChatEditor?.scroll_to_line?.( cursor_position, + current_update.scroll_position, ); } @@ -371,7 +373,8 @@ const get_client = () => root_iframe?.contentWindow?.CodeChatEditor; // in the `root_iframe`. const set_content = async ( contents: CodeChatForWeb, - cursor_position?: number, + cursor_line?: number, + scroll_line?: number, ) => { let client = get_client(); if (client === undefined) { @@ -390,7 +393,8 @@ const set_content = async ( } else { await root_iframe!.contentWindow!.CodeChatEditor.open_lp( contents, - cursor_position, + cursor_line, + scroll_line, ); } }; diff --git a/client/src/CodeMirror-integration.mts b/client/src/CodeMirror-integration.mts index e5ae10db..60818d63 100644 --- a/client/src/CodeMirror-integration.mts +++ b/client/src/CodeMirror-integration.mts @@ -69,6 +69,7 @@ import { EditorSelection, Transaction, Annotation, + TransactionSpec, } from "@codemirror/state"; import { cpp } from "@codemirror/lang-cpp"; import { css } from "@codemirror/lang-css"; @@ -103,6 +104,8 @@ let tinymce_singleton: Editor | undefined; // When true, don't update on the next call to `on_dirty`. See that function for // more info. let ignore_next_dirty = false; +// This indicates that a call to `on_dirty` is scheduled, but hasn't run yet. +let on_dirty_scheduled = false; // True to ignore the next text selection change, since updates to the cursor or // scroll position from the Client trigged this change. let ignore_selection_change = false; @@ -435,6 +438,7 @@ class DocBlockWidget extends WidgetType { `
` + this.contents + "
"; + // TODO: this is an async call. However, CodeMirror doesn't provide async support. mathJaxTypeset(wrap); return wrap; } @@ -456,16 +460,17 @@ class DocBlockWidget extends WidgetType { // The contents div could be a TinyMCE instance, or just a plain div. // Handle both cases. const [contents_div, is_tinymce] = get_contents(dom); + window.MathJax.typesetClear(contents_div); if (is_tinymce) { ignore_next_dirty = true; tinymce_singleton!.setContent(this.contents); tinymce_singleton!.save(); } else { contents_div.innerHTML = this.contents; - mathJaxTypeset(contents_div); } + mathJaxTypeset(contents_div); - // Indicate the update was successful. + // Indicate the update was successful. TODO: but, contents are still pending... return true; } @@ -500,17 +505,9 @@ class DocBlockWidget extends WidgetType { export const mathJaxTypeset = async ( // The node to typeset. node: HTMLElement, - // An optional function to run when the typeset finishes. - afterTypesetFunc: () => void = () => {}, ) => { - // Don't await this promise -- other MathJax processing may still be - // running. See the - // [release notes](https://github.com/mathjax/MathJax-src/releases/tag/4.0.0-rc.4#api). - window.MathJax.typesetPromise([node]); try { - // Instead, this function calls `afterTypesetFunc` after it awaits all - // internal MathJax promises. - window.MathJax.whenReady(afterTypesetFunc); + await window.MathJax.typesetPromise([node]); } catch (err: any) { report_error(`Typeset failed: ${err.message}`); } @@ -575,40 +572,57 @@ const on_dirty = ( ignore_next_dirty = false; return; } - // Find the doc block parent div. - const target = (event_target as HTMLDivElement).closest( - ".CodeChat-doc", - )! as HTMLDivElement; - // We can only get the position (the `from` value) for the doc block. Use - // this to find the `to` value for the doc block. - const from = current_view.posAtDOM(target); - // Send an update to the state field associated with this DOM element. - const indent_div = target.childNodes[0] as HTMLDivElement; - const indent = indent_div.innerHTML; - const delimiter = indent_div.getAttribute("data-delimiter")!; - const [contents_div, is_tinymce] = get_contents(target); - // Sorta ugly hack: TinyMCE stores its date in the DOM. CodeMirror stores - // state in external structs. We need to update the CodeMirror state, but - // not overwrite the DOM with this "new" state, since the DOM is already - // updated. So, signal that this "update" is already done. - (target as any).update_complete = true; - tinymce_singleton!.save(); - const contents = is_tinymce - ? tinymce_singleton!.getContent() - : contents_div.innerHTML; - let effects: StateEffect[] = [ - updateDocBlock.of({ - from, - indent, - delimiter, - contents, - }), - ]; + if (on_dirty_scheduled) { + return; + } - current_view.dispatch({ effects }); + // Only run this after typesetting is done. + window.MathJax.whenReady(() => { + // Find the doc block parent div. + const target = (event_target as HTMLDivElement).closest( + ".CodeChat-doc", + )! as HTMLDivElement; - return false; + // We can only get the position (the `from` value) for the doc block. Use + // this to find the `to` value for the doc block. + let from; + try { + from = current_view.posAtDOM(target); + } catch (e) { + console.error("Unable to get position from DOM.", target); + return; + } + // Send an update to the state field associated with this DOM element. + const indent_div = target.childNodes[0] as HTMLDivElement; + const indent = indent_div.innerHTML; + const delimiter = indent_div.getAttribute("data-delimiter")!; + const [contents_div, is_tinymce] = get_contents(target); + // I'd like to extract this string, then untypeset only that string, not the actual div. But I don't know how. + mathJaxUnTypeset(contents_div); + const contents = is_tinymce + ? tinymce_singleton!.save() + : contents_div.innerHTML; + // Although this is async, nothing following this call depends on its completion. + mathJaxTypeset(contents_div); + // Sorta ugly hack: TinyMCE stores its data in the DOM. CodeMirror stores + // state in external structs. We need to update the CodeMirror state, but + // not overwrite the DOM with this "new" state, since the DOM is already + // updated. So, signal that this "update" is already done. + (target as any).update_complete = true; + let effects: StateEffect[] = [ + updateDocBlock.of({ + from, + indent, + delimiter, + contents, + }), + ]; + + current_view.dispatch({ effects }); + + on_dirty_scheduled = false; + }); }; export const DocBlockPlugin = ViewPlugin.fromClass( @@ -713,17 +727,17 @@ export const DocBlockPlugin = ViewPlugin.fromClass( // See if this is already a TinyMCE instance; if not, move it // here. if (is_tinymce) { - ignore_next_dirty = true; - mathJaxUnTypeset(contents_div); - // If there was no math to untypeset, then `on_dirty` wasn't - // called, but we should no longer ignore the next dirty - // flag. - ignore_next_dirty = false; + // Nothing to do. } else { // Wait until the focus event completes; this causes the // cursor position (the selection) to be set in the // contenteditable div. Then, save that location. setTimeout(() => { + // Untypeset math in the old doc block and the current doc block before moving its contents around. + const tinymce_div = + document.getElementById("TinyMCE-inst")!; + mathJaxUnTypeset(tinymce_div); + mathJaxUnTypeset(contents_div); // The code which moves TinyMCE into this div disturbs // all the nodes, which causes it to loose a selection // tied to a specific node. So, instead store the @@ -778,8 +792,7 @@ export const DocBlockPlugin = ViewPlugin.fromClass( // With the selection saved, it's safe to replace the // contenteditable div with the TinyMCE instance (which // would otherwise wipe the selection). - const tinymce_div = - document.getElementById("TinyMCE-inst")!; + // // Copy the current TinyMCE instance contents into a // contenteditable div. const old_contents_div = document.createElement("div")!; @@ -793,13 +806,11 @@ export const DocBlockPlugin = ViewPlugin.fromClass( old_contents_div, null, ); + // The previous content edited by TinyMCE is now a div. Retypeset this after the transition. + mathJaxTypeset(old_contents_div); // Move TinyMCE to the new location, then remove the old // div it will replace. target.insertBefore(tinymce_div, null); - // TinyMCE edits booger MathJax. Also, the math is - // uneditable. So, translate it back to its untypeset - // form. When editing is done, it will be re-rendered. - mathJaxUnTypeset(contents_div); // Setting the content makes TinyMCE consider it dirty // -- ignore this "dirty" event. @@ -807,6 +818,8 @@ export const DocBlockPlugin = ViewPlugin.fromClass( tinymce_singleton!.setContent(contents_div.innerHTML); tinymce_singleton!.save(); contents_div.remove(); + // The new div is now a TinyMCE editor. Retypeset this. + mathJaxTypeset(tinymce_div); // This process causes TinyMCE to lose focus. Restore // that. However, this causes TinyMCE to lose the @@ -823,7 +836,9 @@ export const DocBlockPlugin = ViewPlugin.fromClass( tinymce_singleton!.getContentAreaContainer(); for ( ; - selection_path.length; + selection_path.length && + // If something goes wrong, bail out instead of producing exceptions. + selection_node !== undefined; selection_node = // As before, use the more-consistent // `children` except for the last element, @@ -912,7 +927,8 @@ export const CodeMirror_load = async ( codechat_for_web: CodeChatForWeb, // Additional extensions. extensions: Array, - cursor_position?: number, + cursor_line?: number, + scroll_line?: number, ) => { if ("Plain" in codechat_for_web.source) { // Although the @@ -1025,6 +1041,19 @@ export const CodeMirror_load = async ( // [docs](https://codemirror.net/examples/tab/). TODO: // document a way to escape the tab key per the same docs. keymap.of([indentWithTab]), + // Change the font size. See [this post](https://discuss.codemirror.net/t/changing-the-font-size-of-cm6/2935/6). + [ + // TODO: get these values from the IDE, so we match its size. + EditorView.theme({ + "&": { + fontSize: "14px", + }, + ".cm-content": { + fontFamily: + "Consolas, 'Courier New', monospace", + }, + }), + ], ...extensions, ], }, @@ -1039,38 +1068,16 @@ export const CodeMirror_load = async ( await init({ selector: "#TinyMCE-inst", setup: (editor: Editor) => { + // See the [docs](https://www.tiny.cloud/docs/tinymce/latest/events/#editor-core-events). editor.on("Dirty", (event: any) => { // Get the div TinyMCE stores edits in. TODO: find - // documentation for this. + // documentation for `event.target.bodyElement`. const target_or_false = event.target?.bodyElement; if (target_or_false == null) { return false; } - on_dirty(target_or_false); - }); - // When leaving a TinyMCE block, retypeset the math. (It's - // untypeset when entering the block, to avoid editing - // problems.) - editor.on("focusout", (event: any) => { - const target_or_false = event.target; - if (target_or_false == null) { - return false; - } - // If the editor is dirty, save it first before we - // possibly modify it. - if (tinymce_singleton!.isDirty()) { - tinymce_singleton!.save(); - } - // When switching from one doc block to another, the - // MathJax typeset finishes after the new doc block has - // been updated. To prevent saving the "dirty" content - // from typesetting, wait until this finishes to clear - // the `ignore_next_dirty` flag. - ignore_next_dirty = true; - mathJaxTypeset(target_or_false, () => { - tinymce_singleton!.save(); - ignore_next_dirty = false; - }); + // For some reason, calling this directly omits the most recent edit. Earlier versions of the code didn't have this problem. ??? + setTimeout(() => on_dirty(target_or_false)); }); }, }) @@ -1113,21 +1120,41 @@ export const CodeMirror_load = async ( // Update the view with these changes to the state. current_view.dispatch({ effects: stateEffects }); } - // If provided, scroll the cursor position into view. - if (cursor_position !== undefined) { - scroll_to_line(cursor_position); - } + scroll_to_line(cursor_line, scroll_line); }; -// Scroll so that the given line is centered in the viewport. -export const scroll_to_line = (line: number) => { +// Scroll to the provided `scroll_line`; place the cursor at `cursor_line`. +export const scroll_to_line = (cursor_line?: number, scroll_line?: number) => { + if (cursor_line === undefined && scroll_line === undefined) { + return; + } + + // Create a transaction to set the cursor and scroll position. + const dispatch_data: TransactionSpec = {}; + if (cursor_line !== undefined) { + // Translate the line numbers to a position. + const cursor_pos = current_view?.state.doc.line(cursor_line).from; + dispatch_data.selection = { + anchor: cursor_pos, + head: cursor_pos, + }; + // If a scroll position is provided, use it; otherwise, scroll the + // cursor into the current view. + if (scroll_line == undefined) { + dispatch_data.scrollIntoView = true; + } + } + + if (scroll_line !== undefined) { + const scroll_pos = current_view?.state.doc.line(scroll_line).from; + dispatch_data.effects = EditorView.scrollIntoView(scroll_pos, { + y: "start", + }); + } + + // Run it. ignore_selection_change = true; - // Translate the line number to a position. - const pos = current_view?.state.doc.line(line).from; - current_view?.dispatch({ - effects: EditorView.scrollIntoView(pos, { y: "center" }), - scrollIntoView: true, - }); + current_view?.dispatch(dispatch_data); }; // Apply a `StringDiff` to the before string to produce the after string. @@ -1163,10 +1190,31 @@ export const CodeMirror_save = (): CodeMirrorDiffable => { export const set_CodeMirror_positions = ( update_message_contents: UpdateMessageContents, ) => { - update_message_contents.cursor_position = current_view.state.doc.lineAt( - current_view.state.selection.main.from, + // If a doc block has focus, then the CodeMirror selection reports line 1. + // Use the starting line number of the doc block instead. + let cursor_line; + const doc_block = document.activeElement?.closest(".CodeChat-doc"); + if (doc_block) { + cursor_line = current_view.state.doc.lineAt( + current_view.posAtDOM(doc_block), + ).number; + } else { + cursor_line = current_view.state.doc.lineAt( + current_view.state.selection.main.from, + ).number; + } + update_message_contents.cursor_position = cursor_line; + + // `current_view.viewport.from` isn't accurate, since it's not really the + // top line, but a margin before it; see the + // [docs](https://codemirror.net/docs/ref/#view.EditorView.viewport). + // Instead, use + // [this approach](https://discuss.codemirror.net/t/how-can-i-get-the-top-line-number-in-real-time/9404). + // This value still seems a bit off, probably because CodeMirror doesn't + // account for doc block sizing? + update_message_contents.scroll_position = current_view.state.doc.lineAt( + current_view.lineBlockAtHeight(-current_view.documentTop).from, ).number; - update_message_contents.scroll_position = current_view.viewport.from; }; const report_error = (text: string) => { diff --git a/client/src/tinymce-config.mts b/client/src/tinymce-config.mts index 9e313f3c..00d813a4 100644 --- a/client/src/tinymce-config.mts +++ b/client/src/tinymce-config.mts @@ -47,7 +47,6 @@ import "tinymce/models/dom/index.js"; import "tinymce/plugins/advlist/index.js"; import "tinymce/plugins/anchor/index.js"; import "tinymce/plugins/charmap/index.js"; -import "tinymce/plugins/code/index.js"; import "tinymce/plugins/directionality/index.js"; import "tinymce/plugins/emoticons/index.js"; import "tinymce/plugins/emoticons/js/emojis.js"; @@ -59,8 +58,6 @@ import "tinymce/plugins/image/index.js"; import "tinymce/plugins/link/index.js"; import "tinymce/plugins/lists/index.js"; import "tinymce/plugins/media/index.js"; -import "tinymce/plugins/nonbreaking/index.js"; -import "tinymce/plugins/pagebreak/index.js"; import "tinymce/plugins/quickbars/index.js"; import "tinymce/plugins/searchreplace/index.js"; import "tinymce/plugins/table/index.js"; @@ -85,7 +82,7 @@ export const init = async ( // [plugins](https://www.tiny.cloud/docs/tinymce/6/plugins/). These must // be accompanied by the corresponding import above. plugins: - "advlist anchor charmap directionality emoticons help image link lists media nonbreaking pagebreak quickbars searchreplace table visualblocks visualchars", + "advlist anchor charmap directionality emoticons help image link lists media quickbars searchreplace table visualblocks visualchars", // The imports above apply the skins; don't try to dynamically load the // skin's CSS. skin: false, diff --git a/extensions/VSCode/Cargo.lock b/extensions/VSCode/Cargo.lock index bfa572b8..8032fca6 100644 --- a/extensions/VSCode/Cargo.lock +++ b/extensions/VSCode/Cargo.lock @@ -156,9 +156,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a597b77b5c6d6a1e1097fddde329a83665e25c5437c696a3a9a4aa514a614dea" +checksum = "2233f53f6cb18ae038ce1f0713ca0c72ca0c4b71fe9aaeb59924ce2c89c6dd85" dependencies = [ "actix-codec", "actix-http", @@ -191,7 +191,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "smallvec", - "socket2 0.5.10", + "socket2 0.6.1", "time", "tracing", "url", @@ -315,22 +315,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -427,9 +427,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" dependencies = [ "serde", ] @@ -445,9 +445,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.45" +version = "1.2.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35900b6c8d709fb1d854671ae27aeaa9eec2f8b01b364e1619a40da3e6fe2afe" +checksum = "b97463e1064cb1b1c1384ad0a0b9c8abd0988e2a91f52606c80ef14aadb63e36" dependencies = [ "find-msvc-tools", "jobserver", @@ -522,7 +522,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "codechat-editor-server" -version = "0.1.40" +version = "0.1.41" dependencies = [ "actix-files", "actix-http", @@ -569,7 +569,7 @@ dependencies = [ [[package]] name = "codechat-editor-vscode-extension" -version = "0.1.40" +version = "0.1.41" dependencies = [ "codechat-editor-server", "log", @@ -657,9 +657,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "typenum", @@ -837,9 +837,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" [[package]] name = "flate2" @@ -982,9 +982,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.9" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -1056,7 +1056,7 @@ dependencies = [ [[package]] name = "htmd" version = "0.3.2" -source = "git+https://github.com/bjones1/htmd.git?branch=fix-faithful-serialization#d7e755a6c4d12a9c670bdd9236d1cea69818bcf5" +source = "git+https://github.com/bjones1/htmd.git?branch=fix-faithful-serialization#e13d5a5ed195163c60b0c59974fc5bb521bdd70b" dependencies = [ "html5ever", "markup5ever_rcdom", diff --git a/extensions/VSCode/Cargo.toml b/extensions/VSCode/Cargo.toml index 443fb8b1..fac7846a 100644 --- a/extensions/VSCode/Cargo.toml +++ b/extensions/VSCode/Cargo.toml @@ -32,7 +32,7 @@ license = "GPL-3.0-only" name = "codechat-editor-vscode-extension" readme = "../README.md" repository = "https://github.com/bjones1/CodeChat_Editor" -version = "0.1.40" +version = "0.1.41" [lib] crate-type = ["cdylib"] diff --git a/extensions/VSCode/package.json b/extensions/VSCode/package.json index 770eeeed..8723d3cd 100644 --- a/extensions/VSCode/package.json +++ b/extensions/VSCode/package.json @@ -40,7 +40,7 @@ "type": "git", "url": "https://github.com/bjones1/CodeChat_Editor" }, - "version": "0.1.40", + "version": "0.1.41", "activationEvents": [ "onCommand:extension.codeChatEditorActivate", "onCommand:extension.codeChatEditorDeactivate" @@ -79,12 +79,12 @@ "escape-html": "^1.0.3" }, "devDependencies": { - "@emnapi/core": "^1.7.0", - "@emnapi/runtime": "^1.7.0", + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1", "@napi-rs/cli": "^3.4.1", "@tybys/wasm-util": "^0.10.1", "@types/escape-html": "^1.0.4", - "@types/node": "^24.10.0", + "@types/node": "^24.10.1", "@types/vscode": "1.61.0", "@typescript-eslint/eslint-plugin": "^8.46.4", "@typescript-eslint/parser": "^8.46.4", diff --git a/extensions/VSCode/pnpm-lock.yaml b/extensions/VSCode/pnpm-lock.yaml index 8ec7f474..a02d9e62 100644 --- a/extensions/VSCode/pnpm-lock.yaml +++ b/extensions/VSCode/pnpm-lock.yaml @@ -13,14 +13,14 @@ importers: version: 1.0.3 devDependencies: '@emnapi/core': - specifier: ^1.7.0 - version: 1.7.0 + specifier: ^1.7.1 + version: 1.7.1 '@emnapi/runtime': - specifier: ^1.7.0 - version: 1.7.0 + specifier: ^1.7.1 + version: 1.7.1 '@napi-rs/cli': specifier: ^3.4.1 - version: 3.4.1(@emnapi/runtime@1.7.0)(@types/node@24.10.0) + version: 3.4.1(@emnapi/runtime@1.7.1)(@types/node@24.10.1) '@tybys/wasm-util': specifier: ^0.10.1 version: 0.10.1 @@ -28,8 +28,8 @@ importers: specifier: ^1.0.4 version: 1.0.4 '@types/node': - specifier: ^24.10.0 - version: 24.10.0 + specifier: ^24.10.1 + version: 24.10.1 '@types/vscode': specifier: 1.61.0 version: 1.61.0 @@ -125,8 +125,8 @@ packages: resolution: {integrity: sha512-vQYQcG4J43UWgo1lj7LcmdsGUKWYo28RfEvDQAEMmQIMjSFufvb+pS0FJ3KXmrPmnWlt1vHDl3oip6mIDUQ4uA==} engines: {node: '>=0.8.0'} - '@azure/msal-node@3.8.1': - resolution: {integrity: sha512-HszfqoC+i2C9+BRDQfuNUGp15Re7menIhCEbFCQ49D3KaqEDrgZIgQ8zSct4T59jWeUIL9N/Dwiv4o2VueTdqQ==} + '@azure/msal-node@3.8.2': + resolution: {integrity: sha512-dQrex2LiXwlCe9WuBHnCsY+xxLyuMXSd2SDEYJuhqB7cE8u6QafiC1xy8j8eBjGO30AsRi2M6amH0ZKk7vJpjA==} engines: {node: '>=16'} '@babel/code-frame@7.27.1': @@ -137,11 +137,11 @@ packages: resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} engines: {node: '>=6.9.0'} - '@emnapi/core@1.7.0': - resolution: {integrity: sha512-pJdKGq/1iquWYtv1RRSljZklxHCOCAJFJrImO5ZLKPJVJlVUcs8yFwNQlqS0Lo8xT1VAXXTCZocF9n26FWEKsw==} + '@emnapi/core@1.7.1': + resolution: {integrity: sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==} - '@emnapi/runtime@1.7.0': - resolution: {integrity: sha512-oAYoQnCYaQZKVS53Fq23ceWMRxq5EhQsE0x0RdQ55jT7wagMu5k+fS39v1fiSLrtrLQlXwVINenqhLMtTrV/1Q==} + '@emnapi/runtime@1.7.1': + resolution: {integrity: sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==} '@emnapi/wasi-threads@1.1.0': resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==} @@ -360,8 +360,8 @@ packages: resolution: {integrity: sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==} engines: {node: '>=18'} - '@inquirer/checkbox@4.3.1': - resolution: {integrity: sha512-rOcLotrptYIy59SGQhKlU0xBg1vvcVl2FdPIEclUvKHh0wo12OfGkId/01PIMJ/V+EimJ77t085YabgnQHBa5A==} + '@inquirer/checkbox@4.3.2': + resolution: {integrity: sha512-VXukHf0RR1doGe6Sm4F0Em7SWYLTHSsbGfJdS9Ja2bX5/D5uwVOEjr07cncLROdBvmnvCATYEWlHqYmXv2IlQA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -369,8 +369,8 @@ packages: '@types/node': optional: true - '@inquirer/confirm@5.1.20': - resolution: {integrity: sha512-HDGiWh2tyRZa0M1ZnEIUCQro25gW/mN8ODByicQrbR1yHx4hT+IOpozCMi5TgBtUdklLwRI2mv14eNpftDluEw==} + '@inquirer/confirm@5.1.21': + resolution: {integrity: sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -378,8 +378,8 @@ packages: '@types/node': optional: true - '@inquirer/core@10.3.1': - resolution: {integrity: sha512-hzGKIkfomGFPgxKmnKEKeA+uCYBqC+TKtRx5LgyHRCrF6S2MliwRIjp3sUaWwVzMp7ZXVs8elB0Tfe682Rpg4w==} + '@inquirer/core@10.3.2': + resolution: {integrity: sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -387,8 +387,8 @@ packages: '@types/node': optional: true - '@inquirer/editor@4.2.22': - resolution: {integrity: sha512-8yYZ9TCbBKoBkzHtVNMF6PV1RJEUvMlhvmS3GxH4UvXMEHlS45jFyqFy0DU+K42jBs5slOaA78xGqqqWAx3u6A==} + '@inquirer/editor@4.2.23': + resolution: {integrity: sha512-aLSROkEwirotxZ1pBaP8tugXRFCxW94gwrQLxXfrZsKkfjOYC1aRvAZuhpJOb5cu4IBTJdsCigUlf2iCOu4ZDQ==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -396,8 +396,8 @@ packages: '@types/node': optional: true - '@inquirer/expand@4.0.22': - resolution: {integrity: sha512-9XOjCjvioLjwlq4S4yXzhvBmAXj5tG+jvva0uqedEsQ9VD8kZ+YT7ap23i0bIXOtow+di4+u3i6u26nDqEfY4Q==} + '@inquirer/expand@4.0.23': + resolution: {integrity: sha512-nRzdOyFYnpeYTTR2qFwEVmIWypzdAx/sIkCMeTNTcflFOovfqUk+HcFhQQVBftAh9gmGrpFj6QcGEqrDMDOiew==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -418,8 +418,8 @@ packages: resolution: {integrity: sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==} engines: {node: '>=18'} - '@inquirer/input@4.3.0': - resolution: {integrity: sha512-h4fgse5zeGsBSW3cRQqu9a99OXRdRsNCvHoBqVmz40cjYjYFzcfwD0KA96BHIPlT7rZw0IpiefQIqXrjbzjS4Q==} + '@inquirer/input@4.3.1': + resolution: {integrity: sha512-kN0pAM4yPrLjJ1XJBjDxyfDduXOuQHrBB8aLDMueuwUGn+vNpF7Gq7TvyVxx8u4SHlFFj4trmj+a2cbpG4Jn1g==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -427,8 +427,8 @@ packages: '@types/node': optional: true - '@inquirer/number@3.0.22': - resolution: {integrity: sha512-oAdMJXz++fX58HsIEYmvuf5EdE8CfBHHXjoi9cTcQzgFoHGZE+8+Y3P38MlaRMeBvAVnkWtAxMUF6urL2zYsbg==} + '@inquirer/number@3.0.23': + resolution: {integrity: sha512-5Smv0OK7K0KUzUfYUXDXQc9jrf8OHo4ktlEayFlelCjwMXz0299Y8OrI+lj7i4gCBY15UObk76q0QtxjzFcFcg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -436,8 +436,8 @@ packages: '@types/node': optional: true - '@inquirer/password@4.0.22': - resolution: {integrity: sha512-CbdqK1ioIr0Y3akx03k/+Twf+KSlHjn05hBL+rmubMll7PsDTGH0R4vfFkr+XrkB0FOHrjIwVP9crt49dgt+1g==} + '@inquirer/password@4.0.23': + resolution: {integrity: sha512-zREJHjhT5vJBMZX/IUbyI9zVtVfOLiTO66MrF/3GFZYZ7T4YILW5MSkEYHceSii/KtRk+4i3RE7E1CUXA2jHcA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -445,8 +445,8 @@ packages: '@types/node': optional: true - '@inquirer/prompts@7.10.0': - resolution: {integrity: sha512-X2HAjY9BClfFkJ2RP3iIiFxlct5JJVdaYYXhA7RKxsbc9KL+VbId79PSoUGH/OLS011NFbHHDMDcBKUj3T89+Q==} + '@inquirer/prompts@7.10.1': + resolution: {integrity: sha512-Dx/y9bCQcXLI5ooQ5KyvA4FTgeo2jYj/7plWfV5Ak5wDPKQZgudKez2ixyfz7tKXzcJciTxqLeK7R9HItwiByg==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -454,8 +454,8 @@ packages: '@types/node': optional: true - '@inquirer/rawlist@4.1.10': - resolution: {integrity: sha512-Du4uidsgTMkoH5izgpfyauTL/ItVHOLsVdcY+wGeoGaG56BV+/JfmyoQGniyhegrDzXpfn3D+LFHaxMDRygcAw==} + '@inquirer/rawlist@4.1.11': + resolution: {integrity: sha512-+LLQB8XGr3I5LZN/GuAHo+GpDJegQwuPARLChlMICNdwW7OwV2izlCSCxN6cqpL0sMXmbKbFcItJgdQq5EBXTw==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -463,8 +463,8 @@ packages: '@types/node': optional: true - '@inquirer/search@3.2.1': - resolution: {integrity: sha512-cKiuUvETublmTmaOneEermfG2tI9ABpb7fW/LqzZAnSv4ZaJnbEis05lOkiBuYX5hNdnX0Q9ryOQyrNidb55WA==} + '@inquirer/search@3.2.2': + resolution: {integrity: sha512-p2bvRfENXCZdWF/U2BXvnSI9h+tuA8iNqtUKb9UWbmLYCRQxd8WkvwWvYn+3NgYaNwdUkHytJMGG4MMLucI1kA==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -472,8 +472,8 @@ packages: '@types/node': optional: true - '@inquirer/select@4.4.1': - resolution: {integrity: sha512-E9hbLU4XsNe2SAOSsFrtYtYQDVi1mfbqJrPDvXKnGlnRiApBdWMJz7r3J2Ff38AqULkPUD3XjQMD4492TymD7Q==} + '@inquirer/select@4.4.2': + resolution: {integrity: sha512-l4xMuJo55MAe+N7Qr4rX90vypFwCajSakx59qe/tMaC1aEHWLyw68wF4o0A4SLAY4E0nd+Vt+EyskeDIqu1M6w==} engines: {node: '>=18'} peerDependencies: '@types/node': '>=18' @@ -974,12 +974,12 @@ packages: peerDependencies: '@octokit/core': '>=6' - '@octokit/request-error@7.0.2': - resolution: {integrity: sha512-U8piOROoQQUyExw5c6dTkU3GKxts5/ERRThIauNL7yaRoeXW0q/5bgHWT7JfWBw1UyrbK8ERId2wVkcB32n0uQ==} + '@octokit/request-error@7.1.0': + resolution: {integrity: sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==} engines: {node: '>= 20'} - '@octokit/request@10.0.6': - resolution: {integrity: sha512-FO+UgZCUu+pPnZAR+iKdUt64kPE7QW7ciqpldaMXaNzixz5Jld8dJ31LAUewk0cfSRkNSRKyqG438ba9c/qDlQ==} + '@octokit/request@10.0.7': + resolution: {integrity: sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA==} engines: {node: '>= 20'} '@octokit/rest@22.0.1': @@ -1041,20 +1041,20 @@ packages: resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} engines: {node: '>=18'} - '@textlint/ast-node-types@15.3.0': - resolution: {integrity: sha512-y61yQXWRVEpUozPUoDUx3Qw8YO86LTU9+LMB23UbPKadM2W2XjKLkKxzzP8A/m0aw4EXozW098E+y55ZmNVZ1w==} + '@textlint/ast-node-types@15.4.0': + resolution: {integrity: sha512-IqY8i7IOGuvy05wZxISB7Me1ZyrvhaQGgx6DavfQjH3cfwpPFdDbDYmMXMuSv2xLS1kDB1kYKBV7fL2Vi16lRA==} - '@textlint/linter-formatter@15.3.0': - resolution: {integrity: sha512-MfSgfmN4QCdgVy1s0HttpsjsfXRYpB4QWXHCsxX/OVEcNOHhwEKrDzlyS6Osb74VpQSzSiWMtX1oY++iVw0l0w==} + '@textlint/linter-formatter@15.4.0': + resolution: {integrity: sha512-rfqOZmnI1Wwc/Pa4LK+vagvVPmvxf9oRsBRqIOB04DwhucingZyAIJI/TyG18DIDYbP2aFXBZ3oOvyAxHe/8PQ==} - '@textlint/module-interop@15.3.0': - resolution: {integrity: sha512-SzJLo3SBd526I+RI69+DCj0TpS2C40VxgI52uv2Q31qENaa2xHCI7JXV37J26bVyYBZMA4uwRwj74GWeaZD5rA==} + '@textlint/module-interop@15.4.0': + resolution: {integrity: sha512-uGf+SFIfzOLCbZI0gp+2NLsrkSArsvEWulPP6lJuKp7yRHadmy7Xf/YHORe46qhNyyxc8PiAfiixHJSaHGUrGg==} - '@textlint/resolver@15.3.0': - resolution: {integrity: sha512-utvrWoc9X0PaF/yzA3IpSDHWKlA/iTsuWRJ9gKzDLTz+ErgHcB2aV97YvhMDdE8qtHpOp4MGjVK1cw4BviRQBQ==} + '@textlint/resolver@15.4.0': + resolution: {integrity: sha512-Vh/QceKZQHFJFG4GxxIsKM1Xhwv93mbtKHmFE5/ybal1mIKHdqF03Z9Guaqt6Sx/AeNUshq0hkMOEhEyEWnehQ==} - '@textlint/types@15.3.0': - resolution: {integrity: sha512-pOlYZ0TWS5XFek2axLK2KOQJCXC4zEj57u4/YTkN3CU1DtvUsvLQUs5oGSrxTyAGtYPFCYOrSqEzER6252732A==} + '@textlint/types@15.4.0': + resolution: {integrity: sha512-ZMwJgw/xjxJufOD+IB7I2Enl9Si4Hxo04B76RwUZ5cKBKzOPcmd6WvGe2F7jqdgmTdGnfMU+Bo/joQrjPNIWqg==} '@tybys/wasm-util@0.10.1': resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} @@ -1071,8 +1071,8 @@ packages: '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - '@types/node@24.10.0': - resolution: {integrity: sha512-qzQZRBqkFsYyaSWXuEHc2WR9c0a0CXwiE5FWUvn7ZM+vdy1uZLfCunD38UzhuB7YN/J11ndbDBcTmOdxJo9Q7A==} + '@types/node@24.10.1': + resolution: {integrity: sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -1156,13 +1156,13 @@ packages: cpu: [x64] os: [alpine] - '@vscode/vsce-sign-darwin-arm64@2.0.2': - resolution: {integrity: sha512-rz8F4pMcxPj8fjKAJIfkUT8ycG9CjIp888VY/6pq6cuI2qEzQ0+b5p3xb74CJnBbSC0p2eRVoe+WgNCAxCLtzQ==} + '@vscode/vsce-sign-darwin-arm64@2.0.6': + resolution: {integrity: sha512-5HMHaJRIQuozm/XQIiJiA0W9uhdblwwl2ZNDSSAeXGO9YhB9MH5C4KIHOmvyjUnKy4UCuiP43VKpIxW1VWP4tQ==} cpu: [arm64] os: [darwin] - '@vscode/vsce-sign-darwin-x64@2.0.2': - resolution: {integrity: sha512-MCjPrQ5MY/QVoZ6n0D92jcRb7eYvxAujG/AH2yM6lI0BspvJQxp0o9s5oiAM9r32r9tkLpiy5s2icsbwefAQIw==} + '@vscode/vsce-sign-darwin-x64@2.0.6': + resolution: {integrity: sha512-25GsUbTAiNfHSuRItoQafXOIpxlYj+IXb4/qarrXu7kmbH94jlm5sdWSCKrrREs8+GsXF1b+l3OB7VJy5jsykw==} cpu: [x64] os: [darwin] @@ -1191,8 +1191,8 @@ packages: cpu: [x64] os: [win32] - '@vscode/vsce-sign@2.0.8': - resolution: {integrity: sha512-H7p8E11cZMj6mt8xIi3QXZ7dSU/2MH3Y7c+5JfUhHAV4xfaPNc8ozwLVK282c6ah596KoIJIdPUlNHV7Qs/5JA==} + '@vscode/vsce-sign@2.0.9': + resolution: {integrity: sha512-8IvaRvtFyzUnGGl3f5+1Cnor3LqaUWvhaUjAYO8Y39OUYlOf3cRd+dowuQYLpZcP3uwSG+mURwjEBOSq4SOJ0g==} '@vscode/vsce@3.7.0': resolution: {integrity: sha512-LY9r2T4joszRjz4d92ZPl6LTBUPS4IWH9gG/3JUv+1QyBJrveZlcVISuiaq0EOpmcgFh0GgVgKD4rD/21Tu8sA==} @@ -1465,12 +1465,12 @@ packages: deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - default-browser-id@5.0.0: - resolution: {integrity: sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==} + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} engines: {node: '>=18'} - default-browser@5.2.1: - resolution: {integrity: sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==} + default-browser@5.4.0: + resolution: {integrity: sha512-XDuvSq38Hr1MdN47EDvYtx3U0MTqpCEn+F6ft8z2vYDzMrvQhVp0ui9oQdqW3MvK3vqUETglt1tVGgjLuJ5izg==} engines: {node: '>=18'} define-data-property@1.1.4: @@ -1524,8 +1524,8 @@ packages: resolution: {integrity: sha512-UgGlf8IW75je7HZjNDpJdCv4cGJWIi6yumFdZ0R7A8/CIhQiWUjyGLCxdHpd8bmyD1gnkfUNK0oeOXqUS2cpfQ==} engines: {ecmascript: '>= es5', node: '>=4'} - emnapi@1.7.0: - resolution: {integrity: sha512-d/RB4oJJu56sOxx+ooK4978jUvnoUo3iRob1/U3N+QnCr91IRQ2QNpAGa3/ZSEZqDWgdhfB1Er5jarfYzjvghg==} + emnapi@1.7.1: + resolution: {integrity: sha512-wlLK2xFq+T+rCBlY6+lPlFVDEyE93b7hSn9dMrfWBIcPf4ArwUvymvvMnN9M5WWuiryYQe9M+UJrkqw4trdyRA==} peerDependencies: node-addon-api: '>= 6.1.0' peerDependenciesMeta: @@ -1584,8 +1584,8 @@ packages: resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} engines: {node: '>= 0.4'} - es-toolkit@1.41.0: - resolution: {integrity: sha512-bDd3oRmbVgqZCJS6WmeQieOrzpl3URcWBUVDXxOELlUW2FuW+0glPOz1n0KnRie+PdyvUZcXz2sOn00c6pPRIA==} + es-toolkit@1.42.0: + resolution: {integrity: sha512-SLHIyY7VfDJBM8clz4+T2oquwTQxEzu263AyhVK4jREOAwJ+8eebaa4wM3nlvnAqhDrMm2EsA6hWHaQsMPQ1nA==} esbuild@0.27.0: resolution: {integrity: sha512-jd0f4NHbD6cALCyGElNpGAOtWxSq46l9X/sWB0Nzd5er4Kz2YTm+Vl0qKFT9KUJvD8+fiO8AvoHhFvEatfVixA==} @@ -1771,8 +1771,8 @@ packages: resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} - form-data@4.0.4: - resolution: {integrity: sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==} + form-data@4.0.5: + resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} engines: {node: '>= 6'} fs-constants@1.0.0: @@ -2080,12 +2080,12 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - js-yaml@3.14.1: - resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + js-yaml@3.14.2: + resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} hasBin: true - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + js-yaml@4.1.1: + resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} hasBin: true json-buffer@3.0.1: @@ -2258,9 +2258,9 @@ packages: mute-stream@0.0.8: resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} - mute-stream@3.0.0: - resolution: {integrity: sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==} - engines: {node: ^20.17.0 || >=22.9.0} + mute-stream@2.0.0: + resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} + engines: {node: ^18.17.0 || >=20.5.0} napi-build-utils@2.0.0: resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} @@ -2268,8 +2268,8 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - node-abi@3.80.0: - resolution: {integrity: sha512-LyPuZJcI9HVwzXK1GPxWNzrr+vr8Hp/3UqlmWxxh8p54U1ZbclOqbSog9lWHaCX+dBaiGi6n/hIX+mKu74GmPA==} + node-abi@3.85.0: + resolution: {integrity: sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg==} engines: {node: '>=10'} node-addon-api@4.3.0: @@ -2279,9 +2279,9 @@ packages: resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} hasBin: true - node-sarif-builder@3.2.0: - resolution: {integrity: sha512-kVIOdynrF2CRodHZeP/97Rh1syTUHBNiw17hUCIVhlhEsWlfJm19MuO56s4MdKbr22xWx6mzMnNAgXzVlIYM9Q==} - engines: {node: '>=18'} + node-sarif-builder@3.3.0: + resolution: {integrity: sha512-8taRy2nQs1xNs8iO2F0XbkZJEliiijpKgFVcyiwKjJ2+3X59LVI3wY84qRdJwRDpIo5GK8wvb1pxcJ+JVu3jrg==} + engines: {node: '>=20'} normalize-package-data@6.0.2: resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} @@ -2351,8 +2351,8 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} - p-map@7.0.3: - resolution: {integrity: sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==} + p-map@7.0.4: + resolution: {integrity: sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ==} engines: {node: '>=18'} package-json-from-dist@1.0.1: @@ -2984,7 +2984,7 @@ snapshots: '@azure/core-util': 1.13.1 '@azure/logger': 1.3.0 '@azure/msal-browser': 4.26.1 - '@azure/msal-node': 3.8.1 + '@azure/msal-node': 3.8.2 open: 10.2.0 tslib: 2.8.1 transitivePeerDependencies: @@ -3003,7 +3003,7 @@ snapshots: '@azure/msal-common@15.13.1': {} - '@azure/msal-node@3.8.1': + '@azure/msal-node@3.8.2': dependencies: '@azure/msal-common': 15.13.1 jsonwebtoken: 9.0.2 @@ -3017,12 +3017,12 @@ snapshots: '@babel/helper-validator-identifier@7.28.5': {} - '@emnapi/core@1.7.0': + '@emnapi/core@1.7.1': dependencies: '@emnapi/wasi-threads': 1.1.0 tslib: 2.8.1 - '@emnapi/runtime@1.7.0': + '@emnapi/runtime@1.7.1': dependencies: tslib: 2.8.1 @@ -3139,7 +3139,7 @@ snapshots: globals: 14.0.0 ignore: 5.3.2 import-fresh: 3.3.1 - js-yaml: 4.1.0 + js-yaml: 4.1.1 minimatch: 3.1.2 strip-json-comments: 3.1.1 transitivePeerDependencies: @@ -3167,128 +3167,128 @@ snapshots: '@inquirer/ansi@1.0.2': {} - '@inquirer/checkbox@4.3.1(@types/node@24.10.0)': + '@inquirer/checkbox@4.3.2(@types/node@24.10.1)': dependencies: '@inquirer/ansi': 1.0.2 - '@inquirer/core': 10.3.1(@types/node@24.10.0) + '@inquirer/core': 10.3.2(@types/node@24.10.1) '@inquirer/figures': 1.0.15 - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/type': 3.0.10(@types/node@24.10.1) yoctocolors-cjs: 2.1.3 optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/confirm@5.1.20(@types/node@24.10.0)': + '@inquirer/confirm@5.1.21(@types/node@24.10.1)': dependencies: - '@inquirer/core': 10.3.1(@types/node@24.10.0) - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/core': 10.3.2(@types/node@24.10.1) + '@inquirer/type': 3.0.10(@types/node@24.10.1) optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/core@10.3.1(@types/node@24.10.0)': + '@inquirer/core@10.3.2(@types/node@24.10.1)': dependencies: '@inquirer/ansi': 1.0.2 '@inquirer/figures': 1.0.15 - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/type': 3.0.10(@types/node@24.10.1) cli-width: 4.1.0 - mute-stream: 3.0.0 + mute-stream: 2.0.0 signal-exit: 4.1.0 wrap-ansi: 6.2.0 yoctocolors-cjs: 2.1.3 optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/editor@4.2.22(@types/node@24.10.0)': + '@inquirer/editor@4.2.23(@types/node@24.10.1)': dependencies: - '@inquirer/core': 10.3.1(@types/node@24.10.0) - '@inquirer/external-editor': 1.0.3(@types/node@24.10.0) - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/core': 10.3.2(@types/node@24.10.1) + '@inquirer/external-editor': 1.0.3(@types/node@24.10.1) + '@inquirer/type': 3.0.10(@types/node@24.10.1) optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/expand@4.0.22(@types/node@24.10.0)': + '@inquirer/expand@4.0.23(@types/node@24.10.1)': dependencies: - '@inquirer/core': 10.3.1(@types/node@24.10.0) - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/core': 10.3.2(@types/node@24.10.1) + '@inquirer/type': 3.0.10(@types/node@24.10.1) yoctocolors-cjs: 2.1.3 optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/external-editor@1.0.3(@types/node@24.10.0)': + '@inquirer/external-editor@1.0.3(@types/node@24.10.1)': dependencies: chardet: 2.1.1 iconv-lite: 0.7.0 optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 '@inquirer/figures@1.0.15': {} - '@inquirer/input@4.3.0(@types/node@24.10.0)': + '@inquirer/input@4.3.1(@types/node@24.10.1)': dependencies: - '@inquirer/core': 10.3.1(@types/node@24.10.0) - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/core': 10.3.2(@types/node@24.10.1) + '@inquirer/type': 3.0.10(@types/node@24.10.1) optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/number@3.0.22(@types/node@24.10.0)': + '@inquirer/number@3.0.23(@types/node@24.10.1)': dependencies: - '@inquirer/core': 10.3.1(@types/node@24.10.0) - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/core': 10.3.2(@types/node@24.10.1) + '@inquirer/type': 3.0.10(@types/node@24.10.1) optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/password@4.0.22(@types/node@24.10.0)': + '@inquirer/password@4.0.23(@types/node@24.10.1)': dependencies: '@inquirer/ansi': 1.0.2 - '@inquirer/core': 10.3.1(@types/node@24.10.0) - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/core': 10.3.2(@types/node@24.10.1) + '@inquirer/type': 3.0.10(@types/node@24.10.1) optionalDependencies: - '@types/node': 24.10.0 - - '@inquirer/prompts@7.10.0(@types/node@24.10.0)': - dependencies: - '@inquirer/checkbox': 4.3.1(@types/node@24.10.0) - '@inquirer/confirm': 5.1.20(@types/node@24.10.0) - '@inquirer/editor': 4.2.22(@types/node@24.10.0) - '@inquirer/expand': 4.0.22(@types/node@24.10.0) - '@inquirer/input': 4.3.0(@types/node@24.10.0) - '@inquirer/number': 3.0.22(@types/node@24.10.0) - '@inquirer/password': 4.0.22(@types/node@24.10.0) - '@inquirer/rawlist': 4.1.10(@types/node@24.10.0) - '@inquirer/search': 3.2.1(@types/node@24.10.0) - '@inquirer/select': 4.4.1(@types/node@24.10.0) + '@types/node': 24.10.1 + + '@inquirer/prompts@7.10.1(@types/node@24.10.1)': + dependencies: + '@inquirer/checkbox': 4.3.2(@types/node@24.10.1) + '@inquirer/confirm': 5.1.21(@types/node@24.10.1) + '@inquirer/editor': 4.2.23(@types/node@24.10.1) + '@inquirer/expand': 4.0.23(@types/node@24.10.1) + '@inquirer/input': 4.3.1(@types/node@24.10.1) + '@inquirer/number': 3.0.23(@types/node@24.10.1) + '@inquirer/password': 4.0.23(@types/node@24.10.1) + '@inquirer/rawlist': 4.1.11(@types/node@24.10.1) + '@inquirer/search': 3.2.2(@types/node@24.10.1) + '@inquirer/select': 4.4.2(@types/node@24.10.1) optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/rawlist@4.1.10(@types/node@24.10.0)': + '@inquirer/rawlist@4.1.11(@types/node@24.10.1)': dependencies: - '@inquirer/core': 10.3.1(@types/node@24.10.0) - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/core': 10.3.2(@types/node@24.10.1) + '@inquirer/type': 3.0.10(@types/node@24.10.1) yoctocolors-cjs: 2.1.3 optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/search@3.2.1(@types/node@24.10.0)': + '@inquirer/search@3.2.2(@types/node@24.10.1)': dependencies: - '@inquirer/core': 10.3.1(@types/node@24.10.0) + '@inquirer/core': 10.3.2(@types/node@24.10.1) '@inquirer/figures': 1.0.15 - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/type': 3.0.10(@types/node@24.10.1) yoctocolors-cjs: 2.1.3 optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/select@4.4.1(@types/node@24.10.0)': + '@inquirer/select@4.4.2(@types/node@24.10.1)': dependencies: '@inquirer/ansi': 1.0.2 - '@inquirer/core': 10.3.1(@types/node@24.10.0) + '@inquirer/core': 10.3.2(@types/node@24.10.1) '@inquirer/figures': 1.0.15 - '@inquirer/type': 3.0.10(@types/node@24.10.0) + '@inquirer/type': 3.0.10(@types/node@24.10.1) yoctocolors-cjs: 2.1.3 optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 - '@inquirer/type@3.0.10(@types/node@24.10.0)': + '@inquirer/type@3.0.10(@types/node@24.10.1)': optionalDependencies: - '@types/node': 24.10.0 + '@types/node': 24.10.1 '@isaacs/balanced-match@4.0.1': {} @@ -3305,22 +3305,22 @@ snapshots: wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 - '@napi-rs/cli@3.4.1(@emnapi/runtime@1.7.0)(@types/node@24.10.0)': + '@napi-rs/cli@3.4.1(@emnapi/runtime@1.7.1)(@types/node@24.10.1)': dependencies: - '@inquirer/prompts': 7.10.0(@types/node@24.10.0) + '@inquirer/prompts': 7.10.1(@types/node@24.10.1) '@napi-rs/cross-toolchain': 1.0.3 '@napi-rs/wasm-tools': 1.0.1 '@octokit/rest': 22.0.1 clipanion: 4.0.0-rc.4(typanion@3.14.0) colorette: 2.0.20 debug: 4.4.3 - emnapi: 1.7.0 - es-toolkit: 1.41.0 - js-yaml: 4.1.0 + emnapi: 1.7.1 + es-toolkit: 1.42.0 + js-yaml: 4.1.1 semver: 7.7.3 typanion: 3.14.0 optionalDependencies: - '@emnapi/runtime': 1.7.0 + '@emnapi/runtime': 1.7.1 transitivePeerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64' - '@napi-rs/cross-toolchain-arm64-target-armv7' @@ -3488,15 +3488,15 @@ snapshots: '@napi-rs/wasm-runtime@0.2.12': dependencies: - '@emnapi/core': 1.7.0 - '@emnapi/runtime': 1.7.0 + '@emnapi/core': 1.7.1 + '@emnapi/runtime': 1.7.1 '@tybys/wasm-util': 0.10.1 optional: true '@napi-rs/wasm-runtime@1.0.7': dependencies: - '@emnapi/core': 1.7.0 - '@emnapi/runtime': 1.7.0 + '@emnapi/core': 1.7.1 + '@emnapi/runtime': 1.7.1 '@tybys/wasm-util': 0.10.1 optional: true @@ -3636,8 +3636,8 @@ snapshots: dependencies: '@octokit/auth-token': 6.0.0 '@octokit/graphql': 9.0.3 - '@octokit/request': 10.0.6 - '@octokit/request-error': 7.0.2 + '@octokit/request': 10.0.7 + '@octokit/request-error': 7.1.0 '@octokit/types': 16.0.0 before-after-hook: 4.0.0 universal-user-agent: 7.0.3 @@ -3649,7 +3649,7 @@ snapshots: '@octokit/graphql@9.0.3': dependencies: - '@octokit/request': 10.0.6 + '@octokit/request': 10.0.7 '@octokit/types': 16.0.0 universal-user-agent: 7.0.3 @@ -3669,14 +3669,14 @@ snapshots: '@octokit/core': 7.0.6 '@octokit/types': 16.0.0 - '@octokit/request-error@7.0.2': + '@octokit/request-error@7.1.0': dependencies: '@octokit/types': 16.0.0 - '@octokit/request@10.0.6': + '@octokit/request@10.0.7': dependencies: '@octokit/endpoint': 11.0.2 - '@octokit/request-error': 7.0.2 + '@octokit/request-error': 7.1.0 '@octokit/types': 16.0.0 fast-content-type-parse: 3.0.0 universal-user-agent: 7.0.3 @@ -3722,9 +3722,9 @@ snapshots: dependencies: '@secretlint/resolver': 10.2.2 '@secretlint/types': 10.2.2 - '@textlint/linter-formatter': 15.3.0 - '@textlint/module-interop': 15.3.0 - '@textlint/types': 15.3.0 + '@textlint/linter-formatter': 15.4.0 + '@textlint/module-interop': 15.4.0 + '@textlint/types': 15.4.0 chalk: 5.6.2 debug: 4.4.3 pluralize: 8.0.0 @@ -3743,7 +3743,7 @@ snapshots: '@secretlint/source-creator': 10.2.2 '@secretlint/types': 10.2.2 debug: 4.4.3 - p-map: 7.0.3 + p-map: 7.0.4 transitivePeerDependencies: - supports-color @@ -3753,7 +3753,7 @@ snapshots: '@secretlint/secretlint-formatter-sarif@10.2.2': dependencies: - node-sarif-builder: 3.2.0 + node-sarif-builder: 3.3.0 '@secretlint/secretlint-rule-no-dotenv@10.2.2': dependencies: @@ -3770,18 +3770,18 @@ snapshots: '@sindresorhus/merge-streams@2.3.0': {} - '@textlint/ast-node-types@15.3.0': {} + '@textlint/ast-node-types@15.4.0': {} - '@textlint/linter-formatter@15.3.0': + '@textlint/linter-formatter@15.4.0': dependencies: '@azu/format-text': 1.0.2 '@azu/style-format': 1.0.1 - '@textlint/module-interop': 15.3.0 - '@textlint/resolver': 15.3.0 - '@textlint/types': 15.3.0 + '@textlint/module-interop': 15.4.0 + '@textlint/resolver': 15.4.0 + '@textlint/types': 15.4.0 chalk: 4.1.2 debug: 4.4.3 - js-yaml: 3.14.1 + js-yaml: 3.14.2 lodash: 4.17.21 pluralize: 2.0.0 string-width: 4.2.3 @@ -3791,13 +3791,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@textlint/module-interop@15.3.0': {} + '@textlint/module-interop@15.4.0': {} - '@textlint/resolver@15.3.0': {} + '@textlint/resolver@15.4.0': {} - '@textlint/types@15.3.0': + '@textlint/types@15.4.0': dependencies: - '@textlint/ast-node-types': 15.3.0 + '@textlint/ast-node-types': 15.4.0 '@tybys/wasm-util@0.10.1': dependencies: @@ -3811,7 +3811,7 @@ snapshots: '@types/json5@0.0.29': {} - '@types/node@24.10.0': + '@types/node@24.10.1': dependencies: undici-types: 7.16.0 @@ -3928,10 +3928,10 @@ snapshots: '@vscode/vsce-sign-alpine-x64@2.0.6': optional: true - '@vscode/vsce-sign-darwin-arm64@2.0.2': + '@vscode/vsce-sign-darwin-arm64@2.0.6': optional: true - '@vscode/vsce-sign-darwin-x64@2.0.2': + '@vscode/vsce-sign-darwin-x64@2.0.6': optional: true '@vscode/vsce-sign-linux-arm64@2.0.6': @@ -3949,12 +3949,12 @@ snapshots: '@vscode/vsce-sign-win32-x64@2.0.6': optional: true - '@vscode/vsce-sign@2.0.8': + '@vscode/vsce-sign@2.0.9': optionalDependencies: '@vscode/vsce-sign-alpine-arm64': 2.0.6 '@vscode/vsce-sign-alpine-x64': 2.0.6 - '@vscode/vsce-sign-darwin-arm64': 2.0.2 - '@vscode/vsce-sign-darwin-x64': 2.0.2 + '@vscode/vsce-sign-darwin-arm64': 2.0.6 + '@vscode/vsce-sign-darwin-x64': 2.0.6 '@vscode/vsce-sign-linux-arm': 2.0.6 '@vscode/vsce-sign-linux-arm64': 2.0.6 '@vscode/vsce-sign-linux-x64': 2.0.6 @@ -3968,13 +3968,13 @@ snapshots: '@secretlint/secretlint-formatter-sarif': 10.2.2 '@secretlint/secretlint-rule-no-dotenv': 10.2.2 '@secretlint/secretlint-rule-preset-recommend': 10.2.2 - '@vscode/vsce-sign': 2.0.8 + '@vscode/vsce-sign': 2.0.9 azure-devops-node-api: 12.5.0 chalk: 4.1.2 cheerio: 1.1.2 cockatiel: 3.2.1 commander: 12.1.0 - form-data: 4.0.4 + form-data: 4.0.5 glob: 11.0.3 hosted-git-info: 4.1.0 jsonc-parser: 3.3.1 @@ -4292,12 +4292,12 @@ snapshots: deep-is@0.1.4: {} - default-browser-id@5.0.0: {} + default-browser-id@5.0.1: {} - default-browser@5.2.1: + default-browser@5.4.0: dependencies: bundle-name: 4.1.0 - default-browser-id: 5.0.0 + default-browser-id: 5.0.1 define-data-property@1.1.4: dependencies: @@ -4356,7 +4356,7 @@ snapshots: dependencies: version-range: 4.15.0 - emnapi@1.7.0: {} + emnapi@1.7.1: {} emoji-regex@8.0.0: {} @@ -4460,7 +4460,7 @@ snapshots: is-date-object: 1.1.0 is-symbol: 1.1.1 - es-toolkit@1.41.0: {} + es-toolkit@1.42.0: {} esbuild@0.27.0: optionalDependencies: @@ -4696,7 +4696,7 @@ snapshots: cross-spawn: 7.0.6 signal-exit: 4.1.0 - form-data@4.0.4: + form-data@4.0.5: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 @@ -5027,12 +5027,12 @@ snapshots: js-tokens@4.0.0: {} - js-yaml@3.14.1: + js-yaml@3.14.2: dependencies: argparse: 1.0.10 esprima: 4.0.1 - js-yaml@4.1.0: + js-yaml@4.1.1: dependencies: argparse: 2.0.1 @@ -5193,14 +5193,14 @@ snapshots: mute-stream@0.0.8: {} - mute-stream@3.0.0: {} + mute-stream@2.0.0: {} napi-build-utils@2.0.0: optional: true natural-compare@1.4.0: {} - node-abi@3.80.0: + node-abi@3.85.0: dependencies: semver: 7.7.3 optional: true @@ -5211,7 +5211,7 @@ snapshots: node-gyp-build@4.8.4: optional: true - node-sarif-builder@3.2.0: + node-sarif-builder@3.3.0: dependencies: '@types/sarif': 2.1.7 fs-extra: 11.3.2 @@ -5279,7 +5279,7 @@ snapshots: open@10.2.0: dependencies: - default-browser: 5.2.1 + default-browser: 5.4.0 define-lazy-prop: 3.0.0 is-inside-container: 1.0.0 wsl-utils: 0.1.0 @@ -5321,7 +5321,7 @@ snapshots: dependencies: p-limit: 3.1.0 - p-map@7.0.3: {} + p-map@7.0.4: {} package-json-from-dist@1.0.1: {} @@ -5389,7 +5389,7 @@ snapshots: minimist: 1.2.8 mkdirp-classic: 0.5.3 napi-build-utils: 2.0.0 - node-abi: 3.80.0 + node-abi: 3.85.0 pump: 3.0.3 rc: 1.2.8 simple-get: 4.0.1 @@ -5420,7 +5420,7 @@ snapshots: rc-config-loader@4.1.3: dependencies: debug: 4.4.3 - js-yaml: 4.1.0 + js-yaml: 4.1.1 json5: 2.2.3 require-from-string: 2.0.2 transitivePeerDependencies: diff --git a/extensions/VSCode/src/extension.ts b/extensions/VSCode/src/extension.ts index ce5362ca..4ae3ea93 100644 --- a/extensions/VSCode/src/extension.ts +++ b/extensions/VSCode/src/extension.ts @@ -385,30 +385,45 @@ export const activate = (context: vscode.ExtensionContext) => { (ignore_text_document_change = false), ); } - // Update the cursor position if provided. - let line = current_update.cursor_position; - if (line !== undefined) { - const editor = get_text_editor(doc); - if (editor) { - ignore_selection_change = true; + + // Update the cursor and scroll position if + // provided. + const editor = get_text_editor(doc); + let scroll_line = current_update.scroll_position; + if (scroll_line !== undefined && editor) { + ignore_selection_change = true; + const scroll_position = new vscode.Position( // The VSCode line is zero-based; the // CodeMirror line is one-based. - line -= 1; - const position = new vscode.Position( - line, - line, - ); - editor.selections = [ - new vscode.Selection( - position, - position, - ), - ]; - editor.revealRange( - new vscode.Range(position, position), - TextEditorRevealType.InCenter, - ); - } + scroll_line - 1, + 0, + ); + editor.revealRange( + new vscode.Range( + scroll_position, + scroll_position, + ), + // This is still not the top of the + // viewport, but a bit below it. + TextEditorRevealType.AtTop, + ); + } + + let cursor_line = current_update.cursor_position; + if (cursor_line !== undefined && editor) { + ignore_selection_change = true; + const cursor_position = new vscode.Position( + // The VSCode line is zero-based; the + // CodeMirror line is one-based. + cursor_line - 1, + 0, + ); + editor.selections = [ + new vscode.Selection( + cursor_position, + cursor_position, + ), + ]; } sendResult(id); break; @@ -550,7 +565,7 @@ const format_struct = (complex_data_structure: any): string => const sendResult = (id: number, result: string | null = null) => { assert(codeChatEditorServer); console_log( - `CodeChat Editor extension: sending result ${id}, ${format_struct(result)}.`, + `CodeChat Editor extension: sending Result(id = ${id}, ${format_struct(result)}).`, ); codeChatEditorServer.sendResult(id, result); }; @@ -595,22 +610,22 @@ const send_update = (this_is_dirty: boolean) => { // CodeMirror // [Text.line](https://codemirror.net/docs/ref/#state.Text.line) // is 1-based. - const current_line = ate.selection.active.line + 1; + const cursor_position = ate.selection.active.line + 1; + const scroll_position = ate.visibleRanges[0].start.line + 1; const file_path = ate.document.fileName; - const cursor_position = current_line; // Send contents only if necessary. const option_contents = is_dirty ? ate.document.getText() : null; is_dirty = false; console_log( - `CodeChat Editor extension: sending Update(${file_path}, ${cursor_position}, ${format_struct(cursor_position)})`, + `CodeChat Editor extension: sending Update(${file_path}, ${cursor_position}, ${scroll_position}, ${format_struct(option_contents)})`, ); await codeChatEditorServer!.sendMessageUpdatePlain( file_path, option_contents, cursor_position, - null, + scroll_position, ); } }, 300); diff --git a/server/Cargo.lock b/server/Cargo.lock index e0a40f43..78c10c6c 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -156,9 +156,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.11.0" +version = "4.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a597b77b5c6d6a1e1097fddde329a83665e25c5437c696a3a9a4aa514a614dea" +checksum = "2233f53f6cb18ae038ce1f0713ca0c72ca0c4b71fe9aaeb59924ce2c89c6dd85" dependencies = [ "actix-codec", "actix-http", @@ -191,7 +191,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "smallvec", - "socket2 0.5.10", + "socket2 0.6.1", "time", "tracing", "url", @@ -324,22 +324,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -604,9 +604,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" dependencies = [ "serde", ] @@ -651,9 +651,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.45" +version = "1.2.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35900b6c8d709fb1d854671ae27aeaa9eec2f8b01b364e1619a40da3e6fe2afe" +checksum = "b97463e1064cb1b1c1384ad0a0b9c8abd0988e2a91f52606c80ef14aadb63e36" dependencies = [ "find-msvc-tools", "jobserver", @@ -746,7 +746,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "codechat-editor-server" -version = "0.1.40" +version = "0.1.41" dependencies = [ "actix-files", "actix-http", @@ -946,9 +946,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "typenum", @@ -1264,9 +1264,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" [[package]] name = "flate2" @@ -1435,9 +1435,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.9" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -1566,7 +1566,7 @@ dependencies = [ [[package]] name = "htmd" version = "0.3.2" -source = "git+https://github.com/bjones1/htmd.git?branch=fix-faithful-serialization#d7e755a6c4d12a9c670bdd9236d1cea69818bcf5" +source = "git+https://github.com/bjones1/htmd.git?branch=fix-faithful-serialization#e13d5a5ed195163c60b0c59974fc5bb521bdd70b" dependencies = [ "html5ever", "markup5ever_rcdom", @@ -1655,9 +1655,9 @@ checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" [[package]] name = "hyper" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ "atomic-waker", "bytes", @@ -1693,9 +1693,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" +checksum = "52e9a2a24dc5c6821e71a7030e1e14b7b632acac55c40e9d2e082c621261bb56" dependencies = [ "base64", "bytes", diff --git a/server/Cargo.toml b/server/Cargo.toml index bd85b385..8e9dd85c 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -32,7 +32,7 @@ license = "GPL-3.0-only" name = "codechat-editor-server" readme = "../README.md" repository = "https://github.com/bjones1/CodeChat_Editor" -version = "0.1.40" +version = "0.1.41" # This library allows other packages to use core CodeChat Editor features. [lib] diff --git a/server/src/ide/filewatcher.rs b/server/src/ide/filewatcher.rs index 042717f8..159c3f16 100644 --- a/server/src/ide/filewatcher.rs +++ b/server/src/ide/filewatcher.rs @@ -1109,7 +1109,7 @@ mod tests { dest.push("test2.py"); fs::rename(file_path, dest.as_path()).unwrap(); // Wait for the filewatcher to debounce this file write. - sleep(Duration::from_secs(2)).await; + sleep(Duration::from_secs(3)).await; let m = get_message(&mut to_client_rx).await; assert_eq!(m.id, INITIAL_IDE_MESSAGE_ID + 2.0 * MESSAGE_ID_INCREMENT); assert!(matches!(m.message, EditorMessageContents::Closed)); diff --git a/server/src/main.rs b/server/src/main.rs index 85236dd7..276002a3 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -127,10 +127,7 @@ impl Cli { let ping_addr = fix_addr(addr); loop { // Look for a ping/pong response from the server. - match minreq::get(format!("http://{ping_addr}/ping")) - .with_timeout(3) - .send() - { + match minreq::get(format!("http://{ping_addr}/ping")).send() { Ok(response) => { let status_code = response.status_code; let body = response.as_str().unwrap_or("Non-text body"); diff --git a/server/src/processing.rs b/server/src/processing.rs index 79757a11..48423d6b 100644 --- a/server/src/processing.rs +++ b/server/src/processing.rs @@ -533,9 +533,7 @@ impl HtmlToMarkdownWrapped { } fn convert(&self, html: &str) -> std::io::Result { - println!("Before:\n{html}"); let converted = self.html_to_markdown.convert(html)?; - println!("Unwrapped:\n{converted}"); Ok( format_text(&converted, &self.word_wrap_config, |_, _, _| Ok(None)) .map_err(std::io::Error::other)? diff --git a/server/src/translation.rs b/server/src/translation.rs index d4d1ec1f..c947a113 100644 --- a/server/src/translation.rs +++ b/server/src/translation.rs @@ -21,7 +21,7 @@ /// CodeChat Server. The Server forwards messages from one client to the other, /// translating as necessary (for example, between source code and the Editor /// format). This module implements the protocol for this forwarding and -/// translation logic; the actuation translation algoritms are implemented in +/// translation logic; the actuation translation algorithms are implemented in /// the processing module. /// /// Overview diff --git a/server/src/webserver.rs b/server/src/webserver.rs index c178db35..35809b5f 100644 --- a/server/src/webserver.rs +++ b/server/src/webserver.rs @@ -269,14 +269,10 @@ pub struct UpdateMessageContents { /// The contents of this file. #[serde(skip_serializing_if = "Option::is_none")] pub contents: Option, - /// The current cursor position in the file, where 0 = before the first - /// character in the file and contents.length() = after the last character - /// in the file. TODO: Selections are not yet supported. TODO: how to get a - /// cursor location from within a doc block in the Client? + /// The line in the file where the cursor is located. TODO: Selections are not yet supported. #[serde(skip_serializing_if = "Option::is_none")] pub cursor_position: Option, - /// The normalized vertical scroll position in the file, where 0 = top and 1 - /// = bottom. + /// The line at the top of the screen. #[serde(skip_serializing_if = "Option::is_none")] pub scroll_position: Option, } @@ -389,11 +385,28 @@ const MATHJAX_TAGS: &str = concatdoc!(