diff --git a/CHANGELOG.md b/CHANGELOG.md index aa5992fc..2ee2399a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,23 +17,25 @@ CodeChat Editor. If not, see [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/). Changelog -========= +================================================================================ [Github master](https://github.com/bjones1/CodeChat_Editor) ------------------------------------------------------------ +-------------------------------------------------------------------------------- + * No changes. -Version 0.1.50 -- 2025-Feb-04 ------------------------------ +Version 0.1.50 -- 2025-Feb-05 +-------------------------------------------------------------------------------- * First and second-level heading underlines are now sized based on the heading's length, rather than fixed at 80 characters. * Update to latest version of CodeMirror, graphviz, ts-rs, pdfjs, notify-deboucer, dprint-markdown, Rust. Improved CodeMirror means removal of a patch to CodeMirror source. +* Replace old `win_partitions` crate which no longer builds. Version 0.1.49 -- 2025-Dec-29 ------------------------------ +-------------------------------------------------------------------------------- * Added instructional videos to manual. * Improve accessibility by using content sectioning tags. @@ -43,7 +45,7 @@ Version 0.1.49 -- 2025-Dec-29 form after a re-translation in the Client. Version 0.1.48 -- 2025-Dec-22 ------------------------------ +-------------------------------------------------------------------------------- * Re-translate Markdown documents as necessary. This causes math written in the Client to immediately be rendered, instead of needing to switch to the IDE and @@ -55,7 +57,7 @@ Version 0.1.48 -- 2025-Dec-22 the Client edits didn't update IDE text. Version 0.1.47 -- 2025-Dec-19 ------------------------------ +-------------------------------------------------------------------------------- * Fix errors in Client when editing a file with adjacent doc blocks. * Fix out of sync errors when the table of contents file is open. @@ -71,14 +73,14 @@ Version 0.1.47 -- 2025-Dec-19 [Loci](https://www.simcenter.msstate.edu/software/luke/loci/index.html) files. Version 0.1.46 -- 2025-Dec-15 ------------------------------ +-------------------------------------------------------------------------------- * Avoid spaces disappearing in Client when editing lists. * Improve speed of convert * Improve Client error reporting. Version 0.1.45 -- 2025-Dec-11 ------------------------------ +-------------------------------------------------------------------------------- * Fix loss of editing in the Client when in document-only mode. * Fix data corruption in the Client when in document-only mode and edits are @@ -88,7 +90,7 @@ Version 0.1.45 -- 2025-Dec-11 * Correctly translate table cells containing blocks from HTML to Markdown. Version 0.1.44 -- 2025-Dec-09 ------------------------------ +-------------------------------------------------------------------------------- * Update Graphviz to latest build; make Graphviz output a block element, not an inline element. @@ -101,13 +103,13 @@ Version 0.1.44 -- 2025-Dec-09 * Correct incorrect whitespace removal in Graphviz and Mermaid diagrams. Version 0.1.43 -- 2025-Dec-05 ------------------------------ +-------------------------------------------------------------------------------- * Fix cursor movement errors in the Client. * Prevent unnecessary saves of Client data to the IDE. Version 0.1.42 -- 2025-Dec-04 ------------------------------ +-------------------------------------------------------------------------------- * Drag and drop of images creates a mess; disable drop and drop for this reason. * Send sync data when doc blocks receive focus. @@ -122,7 +124,7 @@ Version 0.1.42 -- 2025-Dec-04 * Increase time errors messages are displayed in the Client. Version 0.1.41 -- 2025-Nov-17 ------------------------------ +-------------------------------------------------------------------------------- * Math now renders in the active doc block, as shown below. * Math is now protected from accidental edits in the Client: @@ -133,7 +135,7 @@ Version 0.1.41 -- 2025-Nov-17 * Remove unnecessary TinyMCE plugins. Version 0.1.40 -- 2025-Nov-11 ------------------------------ +-------------------------------------------------------------------------------- * File watcher now accepts new files from the Client. * Improved translation from HTML to Markdown. @@ -141,7 +143,7 @@ Version 0.1.40 -- 2025-Nov-11 * Add CodeMirror support for SQL and YAML. Version 0.1.39 -- 2025-Oct-23 ------------------------------ +-------------------------------------------------------------------------------- * Scroll viewport to center on cursor movement. * Significant improvements to test framework. @@ -149,7 +151,7 @@ Version 0.1.39 -- 2025-Oct-23 * Refactor IDE interface back into the Server. Version 0.1.38 -- 2025-Sep-24 ------------------------------ +-------------------------------------------------------------------------------- * Automatically find a free port for the Client, instead of requiring the user to specify it in the VSCode settings. @@ -160,14 +162,14 @@ Version 0.1.38 -- 2025-Sep-24 * Improved build process. Version 0.1.37 -- 2025-Sep-22 ------------------------------ +-------------------------------------------------------------------------------- * Fix: avoid loading the same file twice in a row when the user clicks on a link in the Client. * Improve VSCode connection with the Server. Version 0.1.36 -- 2025-Sep-17 ------------------------------ +-------------------------------------------------------------------------------- * The system continues to work after a PC goes to sleep then wakes back up; communication within previous versions fails after a sleep/wake up cycle. @@ -179,21 +181,21 @@ Version 0.1.36 -- 2025-Sep-17 * Remove the File entry from the HTML editor's main menu. Version 0.1.35 -- 2025-Sep-12 ------------------------------ +-------------------------------------------------------------------------------- * Embed the CodeChat Editor Server inside the VSCode extension, rather than running it as a standalone binary. * Fixes to the build process. Version 0.1.34 -- 2025-Sep-08 ------------------------------ +-------------------------------------------------------------------------------- * Make the Client text editable again. Improve handling of selections. * In VSCode, load a new file in the Client after a short delay, rather than immediately. This provides a more efficient process when changing files. Version 0.1.33 -- 2025-Sep-02 ------------------------------ +-------------------------------------------------------------------------------- * Change `` syntax, which now correctly translates from the Client to source code, avoiding data loss in previous versions. @@ -203,18 +205,18 @@ Version 0.1.33 -- 2025-Sep-02 * Correct a data loss bug when deleting multiple sequential doc blocks. Version 0.1.32 -- 2025-Sep-01 ------------------------------ +-------------------------------------------------------------------------------- * Improve tooling for VSCode extension. * Improve selection handling in the Client. Version 0.1.31 -- 2025-Aug-31 ------------------------------ +-------------------------------------------------------------------------------- * Correct EOL handling on Windows which caused data corruption. Version 0.1.30 -- 2025-Aug-30 ------------------------------ +-------------------------------------------------------------------------------- * Correct ordering of messages sent to and from the Framework to the Client. * Fix and improve test framework and error reporting. @@ -222,27 +224,27 @@ Version 0.1.30 -- 2025-Aug-30 * Update PDF viewer. Version 0.1.29 -- 2025-Aug-23 ------------------------------ +-------------------------------------------------------------------------------- * Fix bugs in PDF viewer. * Fix error when scrolling before a document is loaded. * Fix debug print statements. Version 0.1.28 -- 2025-Aug-13 ------------------------------ +-------------------------------------------------------------------------------- * Fix navigation in document-only mode. * Improve errors reporting in the VSCode extension. Version 0.1.27 -- 2025-Aug-05 ------------------------------ +-------------------------------------------------------------------------------- * Correctly handle document-only files. * Update to the MathJax 4.0.0 release. * Improve release process -- include release notes taken from the changelog. Earlier releases ----------------- +-------------------------------------------------------------------------------- * v0.1.26, 2025-Jul-31: * Additional data corruption fixes when applying edits. diff --git a/extensions/VSCode/Cargo.lock b/extensions/VSCode/Cargo.lock index de829a46..c673869d 100644 --- a/extensions/VSCode/Cargo.lock +++ b/extensions/VSCode/Cargo.lock @@ -603,7 +603,7 @@ dependencies = [ "url", "urlencoding", "webbrowser", - "win_partitions", + "windows", ] [[package]] @@ -634,12 +634,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "const-sha1" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb58b6451e8c2a812ad979ed1d83378caa5e927eef2622017a45f251457c2c9d" - [[package]] name = "convert_case" version = "0.10.0" @@ -3113,15 +3107,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "win_partitions" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47985fd1acfe37c5614374d0067e042e9518f3e78cd07684a620d7b9dd0dbc7" -dependencies = [ - "windows", -] - [[package]] name = "winapi" version = "0.3.9" @@ -3155,13 +3140,23 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.18.0" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68088239696c06152844eadc03d262f088932cce50c67e4ace86e19d95e976fe" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" dependencies = [ - "const-sha1", - "windows_gen", - "windows_macros", + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", ] [[package]] @@ -3177,6 +3172,17 @@ dependencies = [ "windows-strings", ] +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + [[package]] name = "windows-implement" version = "0.60.2" @@ -3205,6 +3211,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link", +] + [[package]] name = "windows-result" version = "0.4.1" @@ -3307,6 +3323,15 @@ dependencies = [ "windows_x86_64_msvc 0.53.1", ] +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -3343,12 +3368,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" -[[package]] -name = "windows_gen" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf583322dc423ee021035b358e535015f7fd163058a31e2d37b99a939141121d" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -3397,16 +3416,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" -[[package]] -name = "windows_macros" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58acfb8832e9f707f8997bd161e537a1c1f603e60a5bd9c3cf53484fdcc998f3" -dependencies = [ - "syn 1.0.109", - "windows_gen", -] - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" diff --git a/extensions/VSCode/pnpm-lock.yaml b/extensions/VSCode/pnpm-lock.yaml index e9702099..5487b26f 100644 --- a/extensions/VSCode/pnpm-lock.yaml +++ b/extensions/VSCode/pnpm-lock.yaml @@ -1253,8 +1253,8 @@ packages: ajv@8.17.1: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} - ansi-escapes@7.2.0: - resolution: {integrity: sha512-g6LhBsl+GBPRWGWsBtutpzBYuIIdBkLEvad5C/va/74Db018+5TZiyA26cZJAr3Rft5lprVqOIPxf5Vid6tqAw==} + ansi-escapes@7.3.0: + resolution: {integrity: sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==} engines: {node: '>=18'} ansi-regex@5.0.1: @@ -4091,7 +4091,7 @@ snapshots: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 - ansi-escapes@7.2.0: + ansi-escapes@7.3.0: dependencies: environment: 1.1.0 @@ -5833,7 +5833,7 @@ snapshots: terminal-link@4.0.0: dependencies: - ansi-escapes: 7.2.0 + ansi-escapes: 7.3.0 supports-hyperlinks: 3.2.0 text-table@0.2.0: {} diff --git a/server/Cargo.lock b/server/Cargo.lock index 9013e5ad..178c602a 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -804,7 +804,7 @@ dependencies = [ "url", "urlencoding", "webbrowser", - "win_partitions", + "windows", ] [[package]] @@ -829,12 +829,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "const-sha1" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb58b6451e8c2a812ad979ed1d83378caa5e927eef2622017a45f251457c2c9d" - [[package]] name = "const_format" version = "0.2.35" @@ -4332,15 +4326,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "win_partitions" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47985fd1acfe37c5614374d0067e042e9518f3e78cd07684a620d7b9dd0dbc7" -dependencies = [ - "windows", -] - [[package]] name = "winapi" version = "0.3.9" @@ -4374,13 +4359,23 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.18.0" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68088239696c06152844eadc03d262f088932cce50c67e4ace86e19d95e976fe" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" dependencies = [ - "const-sha1", - "windows_gen", - "windows_macros", + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", ] [[package]] @@ -4396,6 +4391,17 @@ dependencies = [ "windows-strings", ] +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + [[package]] name = "windows-implement" version = "0.60.2" @@ -4424,6 +4430,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link", +] + [[package]] name = "windows-result" version = "0.4.1" @@ -4526,6 +4542,15 @@ dependencies = [ "windows_x86_64_msvc 0.53.1", ] +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -4562,12 +4587,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" -[[package]] -name = "windows_gen" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf583322dc423ee021035b358e535015f7fd163058a31e2d37b99a939141121d" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -4616,16 +4635,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" -[[package]] -name = "windows_macros" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58acfb8832e9f707f8997bd161e537a1c1f603e60a5bd9c3cf53484fdcc998f3" -dependencies = [ - "syn 1.0.109", - "windows_gen", -] - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" diff --git a/server/Cargo.toml b/server/Cargo.toml index 823c3d17..ace8c98f 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -103,7 +103,7 @@ webbrowser = "1.0.5" # [Windows-only dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies). [target.'cfg(windows)'.dependencies] -win_partitions = "0.3.0" +windows = { version = "0.62", features = ["Win32_Storage_FileSystem"] } # ### Development-only dependencies [dev-dependencies] diff --git a/server/src/ide/filewatcher.rs b/server/src/ide/filewatcher.rs index 57d7e0d8..93b2829a 100644 --- a/server/src/ide/filewatcher.rs +++ b/server/src/ide/filewatcher.rs @@ -51,7 +51,7 @@ use tokio::{ }; use urlencoding; #[cfg(target_os = "windows")] -use win_partitions::win_api::get_logical_drive; +use windows::Win32::Storage::FileSystem::GetLogicalDrives; // ### Local use crate::{ @@ -305,6 +305,31 @@ async fn dir_listing(web_path: &str, dir_path: &Path) -> HttpResponse { .body(html_wrapper(&body)) } +/// Calls the [GetLogicalDrives](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getlogicaldrives) Windows API function +/// and returns a `Vector` of drive letters. +/// +/// Copied almost verbatim from the [win_partitions crate](https://docs.rs/crate/win_partitions/0.3.0/source/src/win_api.rs#144) when compilation errors broke the crate. +#[cfg(target_os = "windows")] +pub fn get_logical_drive() -> Result, std::io::Error> { + let bitmask = unsafe { GetLogicalDrives() }; + if bitmask == 0 { + Err(std::io::Error::last_os_error()) + } else { + let mut mask = 1; + let mut result: Vec = vec![]; + + for index in 1..26 { + if mask & bitmask == mask { + let char = std::char::from_u32(index + 64); + result.push(char.unwrap()); + } + mask <<= 1; + } + + Ok(result) + } +} + const FW: &str = "fw-"; /// `fsc` stands for "FileSystem Client", and provides the Client contents from