From a911d39178540078c8ff5bc880418478d7433c40 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 27 Feb 2022 03:01:13 +0000 Subject: CTAN sync 202202270301 --- support/texlab/CHANGELOG.md | 15 + support/texlab/Cargo.lock | 688 +++++++++------------ support/texlab/Cargo.toml | 55 +- support/texlab/README.md | 6 +- support/texlab/docs/previewing.md | 2 +- support/texlab/src/citation.rs | 4 +- support/texlab/src/config.rs | 4 +- support/texlab/src/diagnostics/bibtex.rs | 10 +- support/texlab/src/diagnostics/build_log.rs | 4 +- support/texlab/src/diagnostics/chktex.rs | 6 +- support/texlab/src/diagnostics/debouncer.rs | 4 +- support/texlab/src/diagnostics/latex.rs | 6 +- support/texlab/src/features/build.rs | 6 +- support/texlab/src/features/completion.rs | 5 +- support/texlab/src/features/completion/util.rs | 2 +- support/texlab/src/features/cursor.rs | 4 +- support/texlab/src/features/highlight/label.rs | 12 +- support/texlab/src/features/lsp_kinds.rs | 100 +-- support/texlab/src/server.rs | 97 +-- support/texlab/src/syntax/latex/analysis.rs | 3 +- .../texlab/src/syntax/latex/analysis/command.rs | 12 + .../src/syntax/latex/analysis/explicit_link.rs | 8 +- support/texlab/src/syntax/latex/cst.rs | 2 +- support/texlab/src/syntax/latex/kind.rs | 1 + support/texlab/src/syntax/latex/lexer.rs | 14 +- support/texlab/src/syntax/latex/parser.rs | 31 +- ...xlab__syntax__latex__lexer__tests__comment.snap | 3 +- ...b__syntax__latex__lexer__tests__line_break.snap | 20 + ...parser__tests__command_definition_optional.snap | 30 + ...parser__tests__label_definition_line_break.snap | 21 + support/texlab/src/workspace/api.rs | 7 +- support/texlab/src/workspace/children_expand.rs | 8 +- support/texlab/src/workspace/parent_expand.rs | 8 +- support/texlab/src/workspace/storage.rs | 11 +- support/texlab/src/workspace/watch.rs | 31 +- support/texlab/tests/integration/completion.rs | 21 + support/texlab/tests/integration/issues.rs | 20 + ...gration__completion__latex__multi_line_key.snap | 51 ++ support/texlab/texlab.pdf | Bin 88770 -> 82720 bytes 39 files changed, 754 insertions(+), 578 deletions(-) create mode 100644 support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__line_break.snap create mode 100644 support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__command_definition_optional.snap create mode 100644 support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__label_definition_line_break.snap create mode 100644 support/texlab/tests/integration/snapshots/integration__completion__latex__multi_line_key.snap (limited to 'support/texlab') diff --git a/support/texlab/CHANGELOG.md b/support/texlab/CHANGELOG.md index 13b1cc799c..4f436c33b4 100644 --- a/support/texlab/CHANGELOG.md +++ b/support/texlab/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.3.2] - 26.02.2022 + +### Fixed + +- Parse command definitions with optional arguments correctly +- Fix detection of command definitions in completion ([latex-lsp/texlab-vscode#618](https://github.com/latex-lsp/texlab-vscode/issues/618)) +- Watch aux directory by default for changes ([#563](https://github.com/latex-lsp/texlab/issues/563)) +- Do not allow multi-line keys in the grammar ([#559](https://github.com/latex-lsp/texlab/issues/559)) +- Use `textEdit` property for snippets ([#558](https://github.com/latex-lsp/texlab/issues/558)) +- Allow simple commands as text argument for most commands ([#557](https://github.com/latex-lsp/texlab/issues/557)) +- Treat `\renewcommand` as an environment definition ([#556](https://github.com/latex-lsp/texlab/issues/556)) +- Do not return `null` from forward search request +- Make directory path in `\import` optional ([#540](https://github.com/latex-lsp/texlab/issues/540)) +- Do not spam workspace/configuration requests ([#533](https://github.com/latex-lsp/texlab/issues/533)) + ## [3.3.1] - 10.11.2021 ### Fixed diff --git a/support/texlab/Cargo.lock b/support/texlab/Cargo.lock index b5815c3ff4..a6ffc4530d 100644 --- a/support/texlab/Cargo.lock +++ b/support/texlab/Cargo.lock @@ -16,13 +16,13 @@ checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" [[package]] name = "ahash" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.4", "once_cell", - "version_check 0.9.3", + "version_check", ] [[package]] @@ -36,9 +36,9 @@ dependencies = [ [[package]] name = "ansi_term" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ "winapi", ] @@ -51,9 +51,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" [[package]] name = "anyhow" -version = "1.0.45" +version = "1.0.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" +checksum = "7a99269dff3bc004caa411f38845c20303f1e393ca2bd6581576fa3a7f59577d" [[package]] name = "atty" @@ -74,9 +74,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "beef" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6736e2428df2ca2848d846c43e88745121a6654696e349ce0054a420815a7409" +checksum = "bed554bd50246729a1ec158d08aa3235d1b69d94ad120ebe187e28894787e736" [[package]] name = "bibutils-sys" @@ -89,15 +89,15 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "0.19.5" +version = "0.19.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8942c8d352ae1838c9dda0b0ca2ab657696ef2232a20147cf1b30ae1a9cb4321" +checksum = "55f93d0ef3363c364d5976646a38f04cf67cfe1d4c8d160cdea02cab2c116b33" dependencies = [ "funty", "radium", @@ -105,15 +105,6 @@ dependencies = [ "wyz", ] -[[package]] -name = "buf-min" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6ae7069aad07c7cdefe6a22a671f00650728bd2331a4cc62e1e5d0becdf9ca4" -dependencies = [ - "bytes 0.5.6", -] - [[package]] name = "byteorder" version = "1.4.3" @@ -122,15 +113,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - -[[package]] -name = "bytes" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "cancellation" @@ -140,9 +125,9 @@ checksum = "f7a879c84c21f354f13535f87ad119ac3be22ebb9097b552a0af6a78f86628c4" [[package]] name = "cc" -version = "1.0.68" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" [[package]] name = "cervine" @@ -171,16 +156,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chashmap" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff41a3c2c1e39921b9003de14bf0439c7b63a9039637c291e1a64925d8ddfa45" -dependencies = [ - "owning_ref", - "parking_lot 0.4.8", -] - [[package]] name = "chrono" version = "0.4.19" @@ -198,7 +173,7 @@ dependencies = [ [[package]] name = "citeproc" version = "0.0.1" -source = "git+https://github.com/cormacrelf/citeproc-rs?rev=5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3#5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3" +source = "git+https://github.com/cormacrelf/citeproc-rs?rev=2ab195a1e6f84f0ff284813ece61dc62096abbfe#2ab195a1e6f84f0ff284813ece61dc62096abbfe" dependencies = [ "cfg-if 0.1.10", "citeproc-db", @@ -208,12 +183,10 @@ dependencies = [ "fnv", "indexmap", "log", - "parking_lot 0.11.1", - "rand 0.7.3", - "rayon", + "parking_lot 0.11.2", + "rand", "salsa", "serde", - "serde_derive", "string-interner", "thiserror", ] @@ -221,7 +194,7 @@ dependencies = [ [[package]] name = "citeproc-db" version = "0.1.0" -source = "git+https://github.com/cormacrelf/citeproc-rs?rev=5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3#5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3" +source = "git+https://github.com/cormacrelf/citeproc-rs?rev=2ab195a1e6f84f0ff284813ece61dc62096abbfe#2ab195a1e6f84f0ff284813ece61dc62096abbfe" dependencies = [ "cfg-if 0.1.10", "citeproc-io", @@ -238,7 +211,7 @@ dependencies = [ [[package]] name = "citeproc-io" version = "0.1.0" -source = "git+https://github.com/cormacrelf/citeproc-rs?rev=5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3#5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3" +source = "git+https://github.com/cormacrelf/citeproc-rs?rev=2ab195a1e6f84f0ff284813ece61dc62096abbfe#2ab195a1e6f84f0ff284813ece61dc62096abbfe" dependencies = [ "cervine", "csl", @@ -248,8 +221,9 @@ dependencies = [ "lazy-transform-str", "log", "markup5ever_rcdom", - "nom 6.1.2", + "nom", "once_cell", + "percent-encoding", "phf", "regex", "serde", @@ -259,13 +233,13 @@ dependencies = [ "ucd-trie", "unic-segment", "unic-ucd-category", - "v_htmlescape", + "url", ] [[package]] name = "citeproc-proc" version = "0.1.0" -source = "git+https://github.com/cormacrelf/citeproc-rs?rev=5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3#5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3" +source = "git+https://github.com/cormacrelf/citeproc-rs?rev=2ab195a1e6f84f0ff284813ece61dc62096abbfe#2ab195a1e6f84f0ff284813ece61dc62096abbfe" dependencies = [ "bitflags", "cfg-if 0.1.10", @@ -278,13 +252,12 @@ dependencies = [ "lazy_static", "lexical-sort", "log", - "nom 6.1.2", + "nom", "petgraph 0.5.1", - "rayon", "salsa", "serde", "serde_derive", - "smallvec 1.6.1", + "smallvec", "string-interner", "strum", "unic-segment", @@ -293,9 +266,9 @@ dependencies = [ [[package]] name = "clap" -version = "2.33.3" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", @@ -308,23 +281,23 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.0" +version = "4.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d47c1b11006b87e492b53b313bb699ce60e16613c4dddaa91f8f7c220ab2fa" +checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062" dependencies = [ - "bytes 1.0.1", + "bytes", "memchr", ] [[package]] name = "console" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" +checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31" dependencies = [ "encode_unicode", - "lazy_static", "libc", + "once_cell", "terminal_size", "winapi", ] @@ -337,42 +310,42 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "crossbeam-channel" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.5", + "crossbeam-utils 0.8.6", ] [[package]] name = "crossbeam-deque" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", - "crossbeam-utils 0.8.5", + "crossbeam-utils 0.8.6", ] [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.5", + "crossbeam-utils 0.8.6", "lazy_static", "memoffset", "scopeguard", @@ -390,9 +363,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" dependencies = [ "cfg-if 1.0.0", "lazy_static", @@ -401,14 +374,14 @@ dependencies = [ [[package]] name = "csl" version = "0.0.1" -source = "git+https://github.com/cormacrelf/citeproc-rs?rev=5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3#5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3" +source = "git+https://github.com/cormacrelf/citeproc-rs?rev=2ab195a1e6f84f0ff284813ece61dc62096abbfe#2ab195a1e6f84f0ff284813ece61dc62096abbfe" dependencies = [ "chrono", "fnv", "log", - "nom 6.1.2", + "nom", "roxmltree", - "semver", + "semver 0.11.0", "serde", "smartstring", "string_cache", @@ -426,16 +399,27 @@ checksum = "032b71bfa953cd1eb921ac105edb854a94ac038ee1d3da8948a70f22eca40ac1" dependencies = [ "fxhash", "lasso", - "parking_lot 0.11.1", + "parking_lot 0.11.2", "text-size", "triomphe", ] +[[package]] +name = "dashmap" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0834a35a3fce649144119e18da2a4d8ed12ef3862f47183fd46f625d072d96c" +dependencies = [ + "cfg-if 1.0.0", + "num_cpus", + "parking_lot 0.12.0", +] + [[package]] name = "derive_more" -version = "0.99.16" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2", @@ -444,12 +428,6 @@ dependencies = [ "syn", ] -[[package]] -name = "dtoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" - [[package]] name = "either" version = "1.6.1" @@ -464,9 +442,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.29" +version = "0.8.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a74ea89a0a1b98f6332de42c95baff457ada66d1cb4030f9ff151b2041a1c746" +checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" dependencies = [ "cfg-if 1.0.0", ] @@ -480,6 +458,15 @@ dependencies = [ "encoding_rs", ] +[[package]] +name = "fastrand" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "779d043b6a0b90cc4c0ed7ee380a6504394cee7efd7db050e3774eee387324b2" +dependencies = [ + "instant", +] + [[package]] name = "fern" version = "0.6.0" @@ -491,9 +478,9 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" +checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" dependencies = [ "cfg-if 1.0.0", "libc", @@ -509,9 +496,9 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" [[package]] name = "fixedbitset" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e" +checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" [[package]] name = "flate2" @@ -543,19 +530,13 @@ dependencies = [ [[package]] name = "fsevent-sys" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c0e564d24da983c053beff1bb7178e237501206840a3e6bf4e267b9e8ae734a" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" dependencies = [ "libc", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "funty" version = "1.1.0" @@ -603,9 +584,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", "libc", @@ -633,7 +614,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.4", + "ahash 0.7.6", ] [[package]] @@ -647,9 +628,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] @@ -695,12 +676,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.6.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" +checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ "autocfg", - "hashbrown 0.9.1", + "hashbrown 0.11.2", ] [[package]] @@ -711,18 +692,18 @@ checksum = "990980c3d268c9b99df35e813eca2b8d1ee08606f6d2bb325edbd0b0c68f9ffe" [[package]] name = "indoc" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a75aeaaef0ce18b58056d306c27b07436fbb34b8816c53094b76dd81803136" +checksum = "e7906a9fababaeacb774f72410e497a1d18de916322e33797bb2cd29baa23c9e" dependencies = [ "unindent", ] [[package]] name = "inotify" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b031475cb1b103ee221afb806a23d35e0570bf7271d7588762ceba8127ed43b3" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" dependencies = [ "bitflags", "inotify-sys", @@ -740,24 +721,23 @@ dependencies = [ [[package]] name = "insta" -version = "1.8.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15226a375927344c78d39dc6b49e2d5562a5b0705e26a589093c6792e52eed8e" +checksum = "f4c0c443f6dceb3a1cb7607c87501aa91e4b9c976044f725c2a74ca2152c91a4" dependencies = [ "console", - "lazy_static", + "once_cell", "serde", "serde_json", "serde_yaml", "similar", - "uuid", ] [[package]] name = "instant" -version = "0.1.9" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", ] @@ -773,18 +753,18 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" dependencies = [ "either", ] [[package]] name = "itoa" -version = "0.4.7" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "jni" @@ -806,6 +786,26 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +[[package]] +name = "kqueue" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058a107a784f8be94c7d35c1300f4facced2e93d2fbe5b1452b44e905ddca4a9" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" +dependencies = [ + "bitflags", + "libc", +] + [[package]] name = "lasso" version = "0.5.1" @@ -843,9 +843,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.97" +version = "0.2.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" +checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9" [[package]] name = "linked-hash-map" @@ -855,9 +855,9 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" +checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" dependencies = [ "scopeguard", ] @@ -909,9 +909,9 @@ dependencies = [ [[package]] name = "lsp-types" -version = "0.90.0" +version = "0.92.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7404037aab080771c90b0a499836d9d8a10336ecd07badf969567b65c6d51a1" +checksum = "e8a69d4142d51b208c9fc3cea68b1a7fcef30354e7aa6ccad07250fd8430fc76" dependencies = [ "bitflags", "serde", @@ -954,27 +954,21 @@ dependencies = [ [[package]] name = "matches" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" - -[[package]] -name = "maybe-uninit" -version = "2.0.0" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memoffset" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ "autocfg", ] @@ -991,9 +985,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -1026,16 +1020,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" -[[package]] -name = "nom" -version = "4.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" -dependencies = [ - "memchr", - "version_check 0.1.5", -] - [[package]] name = "nom" version = "6.1.2" @@ -1045,20 +1029,21 @@ dependencies = [ "bitvec", "funty", "memchr", - "version_check 0.9.3", + "version_check", ] [[package]] name = "notify" -version = "5.0.0-pre.10" +version = "5.0.0-pre.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f18203a26893ca1d3526cf58084025d5639f91c44f8b70ab3b724f60e819a0" +checksum = "245d358380e2352c2d020e8ee62baac09b3420f1f6c012a31326cfced4ad487d" dependencies = [ "bitflags", "crossbeam-channel", "filetime", "fsevent-sys", "inotify", + "kqueue", "libc", "mio", "walkdir", @@ -1095,9 +1080,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", @@ -1105,9 +1090,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" [[package]] name = "oorandom" @@ -1115,60 +1100,52 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" -[[package]] -name = "owning_ref" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" -dependencies = [ - "stable_deref_trait", -] - [[package]] name = "parking_lot" -version = "0.4.8" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ - "owning_ref", - "parking_lot_core 0.2.14", + "instant", + "lock_api", + "parking_lot_core 0.8.5", ] [[package]] name = "parking_lot" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" dependencies = [ - "instant", "lock_api", - "parking_lot_core 0.8.3", + "parking_lot_core 0.9.1", ] [[package]] name = "parking_lot_core" -version = "0.2.14" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ + "cfg-if 1.0.0", + "instant", "libc", - "rand 0.4.6", - "smallvec 0.6.14", + "redox_syscall", + "smallvec", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.8.3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954" dependencies = [ "cfg-if 1.0.0", - "instant", "libc", "redox_syscall", - "smallvec 1.6.1", - "winapi", + "smallvec", + "windows-sys", ] [[package]] @@ -1202,7 +1179,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ - "fixedbitset 0.4.0", + "fixedbitset 0.4.1", "indexmap", ] @@ -1234,7 +1211,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" dependencies = [ "phf_shared", - "rand 0.7.3", + "rand", ] [[package]] @@ -1262,9 +1239,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "precomputed-hash" @@ -1282,7 +1259,7 @@ dependencies = [ "proc-macro2", "quote", "syn", - "version_check 0.9.3", + "version_check", ] [[package]] @@ -1293,7 +1270,7 @@ checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", - "version_check 0.9.3", + "version_check", ] [[package]] @@ -1304,18 +1281,18 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" dependencies = [ "proc-macro2", ] @@ -1326,19 +1303,6 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - [[package]] name = "rand" version = "0.7.3" @@ -1347,24 +1311,12 @@ checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom 0.1.16", "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_chacha", + "rand_core", + "rand_hc", "rand_pcg", ] -[[package]] -name = "rand" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.3", - "rand_hc 0.3.1", -] - [[package]] name = "rand_chacha" version = "0.2.2" @@ -1372,34 +1324,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.3", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.5.1" @@ -1409,31 +1336,13 @@ dependencies = [ "getrandom 0.1.16", ] -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom 0.2.3", -] - [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core 0.6.3", + "rand_core", ] [[package]] @@ -1442,7 +1351,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" dependencies = [ - "rand_core 0.5.1", + "rand_core", ] [[package]] @@ -1465,25 +1374,16 @@ checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ "crossbeam-channel", "crossbeam-deque", - "crossbeam-utils 0.8.5", + "crossbeam-utils 0.8.6", "lazy_static", "num_cpus", ] -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ "bitflags", ] @@ -1531,18 +1431,18 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.4", ] [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "salsa" @@ -1555,10 +1455,10 @@ dependencies = [ "lock_api", "log", "oorandom", - "parking_lot 0.11.1", + "parking_lot 0.11.2", "rustc-hash", "salsa-macros", - "smallvec 1.6.1", + "smallvec", ] [[package]] @@ -1598,6 +1498,12 @@ dependencies = [ "serde", ] +[[package]] +name = "semver" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" + [[package]] name = "semver-parser" version = "0.10.2" @@ -1609,18 +1515,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -1629,9 +1535,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.69" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e466864e431129c7e0d3476b92f20458e5879919a0596c6472738d9fa2d342f8" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa", "ryu", @@ -1651,48 +1557,39 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.17" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15654ed4ab61726bf918a39cb8d98a2e2995b002387807fa6ba58fdf7f59bb23" +checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0" dependencies = [ - "dtoa", - "linked-hash-map", + "indexmap", + "ryu", "serde", "yaml-rust", ] [[package]] name = "similar" -version = "1.3.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad1d488a557b235fc46dae55512ffbfc429d2482b08b4d9435ab07384ca8aec" +checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3" [[package]] name = "siphasher" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbce6d4507c7e4a3962091436e56e95290cb71fa302d0d270e32130b75fbff27" +checksum = "a86232ab60fa71287d7f2ddae4a7073f6b7aac33631c3015abb556f08c6d0a3e" [[package]] name = "smallvec" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "smallvec" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "smartstring" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ada87540bf8ef4cf8a1789deb175626829bb59b1fefd816cf7f7f55efcdbae9" +checksum = "31aa6a31c0c2b21327ce875f7e8952322acfcfd0c27569a6e18a647281352c9b" dependencies = [ "serde", "static_assertions", @@ -1732,12 +1629,13 @@ dependencies = [ [[package]] name = "string_cache" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ddb1139b5353f96e429e1a5e19fbaf663bddedaa06d1dbd49f82e352601209a" +checksum = "923f0f39b6267d37d23ce71ae7235602134b250ace715dd2c90421998ddac0c6" dependencies = [ "lazy_static", "new_debug_unreachable", + "parking_lot 0.11.2", "phf_shared", "precomputed-hash", "serde", @@ -1769,9 +1667,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "structopt" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c" +checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" dependencies = [ "clap", "lazy_static", @@ -1811,9 +1709,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.73" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2", "quote", @@ -1828,13 +1726,13 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if 1.0.0", + "fastrand", "libc", - "rand 0.8.4", "redox_syscall", "remove_dir_all", "winapi", @@ -1863,20 +1761,20 @@ dependencies = [ [[package]] name = "texlab" -version = "3.3.1" +version = "3.3.2" dependencies = [ "anyhow", "bibutils-sys", "byteorder", "cancellation", "cfg-if 1.0.0", - "chashmap", "citeproc", "citeproc-db", "citeproc-io", "crossbeam-channel", "csl", "cstree", + "dashmap", "derive_more", "encoding_rs", "encoding_rs_io", @@ -1887,7 +1785,7 @@ dependencies = [ "html2md", "indoc", "insta", - "itertools 0.10.1", + "itertools 0.10.3", "log", "logos", "lsp-server", @@ -1930,18 +1828,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.25" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.25" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -1979,9 +1877,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.2.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] @@ -2004,9 +1902,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bddb80ec09585c58022a2c55e6e7c11e713d9bb26895f1b56cd945c4040c54" +checksum = "c45e322b26410d7260e00f64234810c2f17d7ece356182af4df8f7ff07890f09" dependencies = [ "memoffset", "serde", @@ -2015,9 +1913,9 @@ dependencies = [ [[package]] name = "typed-builder" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a46ee5bd706ff79131be9c94e7edcb82b703c487766a114434e5790361cf08c5" +checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c" dependencies = [ "proc-macro2", "quote", @@ -2094,12 +1992,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" -dependencies = [ - "matches", -] +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" @@ -2112,15 +2007,15 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" [[package]] name = "unicode-width" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] name = "unicode-xid" @@ -2130,9 +2025,9 @@ checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "unindent" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7" +checksum = "514672a55d7380da379785a4d70ca8386c8883ff7eaae877be4d2081cebe73d8" [[package]] name = "url" @@ -2165,39 +2060,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.3", -] - -[[package]] -name = "v_escape" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039a44473286eb84e4e74f90165feff67c802dbeced7ee4c5b00d719b0d0475e" -dependencies = [ - "buf-min", - "v_escape_derive", -] - -[[package]] -name = "v_escape_derive" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c860ad1273f4eee7006cee05db20c9e60e5d24cba024a32e1094aa8e574f3668" -dependencies = [ - "nom 4.2.3", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "v_htmlescape" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7c2a33ed7cf0dc1b42bcf39e01b6512f9df08f09e1cd8a49d9dc49a6a9482" -dependencies = [ - "cfg-if 1.0.0", - "v_escape", + "getrandom 0.2.4", ] [[package]] @@ -2208,15 +2071,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - -[[package]] -name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" @@ -2272,6 +2129,49 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" + +[[package]] +name = "windows_i686_gnu" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" + +[[package]] +name = "windows_i686_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" + [[package]] name = "wyz" version = "0.2.0" @@ -2280,9 +2180,9 @@ checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" [[package]] name = "xml5ever" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1b52e6e8614d4a58b8e70cf51ec0cc21b256ad8206708bcff8139b5bbd6a59" +checksum = "9234163818fd8e2418fcde330655e757900d4236acd8cc70fef345ef91f6d865" dependencies = [ "log", "mac", diff --git a/support/texlab/Cargo.toml b/support/texlab/Cargo.toml index cf99f7b387..ad6a333479 100644 --- a/support/texlab/Cargo.toml +++ b/support/texlab/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "texlab" description = "LaTeX Language Server" -version = "3.3.1" +version = "3.3.2" license = "GPL-3.0" readme = "README.md" authors = [ @@ -9,7 +9,8 @@ authors = [ "Patrick Förster ", ] edition = "2018" -homepage = "https://texlab.netlify.app" +homepage = "https://github.com/latex-lsp/texlab" +resolver = "2" [lib] doctest = false @@ -29,54 +30,54 @@ citation = [ semantic = [] [dependencies] -anyhow = "1.0.45" -bibutils-sys = { version="0.1.1", optional=true } +anyhow = "1.0.54" +bibutils-sys = { version = "0.1.1", optional = true } byteorder = "1.4.3" cancellation = "0.1" cfg-if = "1.0.0" -chashmap = "2.2.2" -citeproc = { git="https://github.com/cormacrelf/citeproc-rs", rev="5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3", optional=true } -citeproc-db = { git="https://github.com/cormacrelf/citeproc-rs", rev="5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3", optional=true } -citeproc-io = { git="https://github.com/cormacrelf/citeproc-rs", rev="5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3", optional=true } -csl = { git="https://github.com/cormacrelf/citeproc-rs", rev="5252fbd8d2046a5a7d5cdcee6c6cb39bd0f1a7f3", optional=true } -crossbeam-channel = "0.5.1" +citeproc = { git = "https://github.com/cormacrelf/citeproc-rs", rev = "2ab195a1e6f84f0ff284813ece61dc62096abbfe", optional = true } +citeproc-db = { git = "https://github.com/cormacrelf/citeproc-rs", rev = "2ab195a1e6f84f0ff284813ece61dc62096abbfe", optional = true } +citeproc-io = { git = "https://github.com/cormacrelf/citeproc-rs", rev = "2ab195a1e6f84f0ff284813ece61dc62096abbfe", optional = true } +csl = { git = "https://github.com/cormacrelf/citeproc-rs", rev = "2ab195a1e6f84f0ff284813ece61dc62096abbfe", optional = true } +crossbeam-channel = "0.5.2" cstree = "0.6.1" -derive_more = "0.99.16" -encoding_rs = "0.8.29" +dashmap = "5.1.0" +derive_more = "0.99.17" +encoding_rs = "0.8.30" encoding_rs_io = "0.1.7" flate2 = "1.0.22" fern = "0.6" -fnv = { version="1.0", optional=true } -fuzzy-matcher = { version="0.3.7", optional=true } -html2md = { version="0.2.13", optional=true } +fnv = { version = "1.0", optional = true } +fuzzy-matcher = { version = "0.3.7", optional = true } +html2md = { version = "0.2.13", optional = true } itertools = "0.10.1" log = "0.4.14" logos = "0.12.0" lsp-server = "0.5" -lsp-types = "0.90.0" +lsp-types = "0.92.0" multimap = "0.8.3" -notify = "5.0.0-pre.10" -once_cell = "1.8.0" +notify = "5.0.0-pre.13" +once_cell = "1.9.0" petgraph = "0.6.0" rayon = "1.5.1" regex = "1.5.4" rustc-hash = "1.1.0" -serde = "1.0.130" -serde_json = "1.0.69" +serde = "1.0.136" +serde_json = "1.0.79" serde_repr = "0.1.7" -smol_str = { version="0.1.21", features=["serde"] } +smol_str = { version = "0.1.21", features = ["serde"] } structopt = "0.3" -tempfile = "3.2.0" +tempfile = "3.3.0" threadpool = "1.8.1" titlecase = "1.1.0" url = "2.2.2" -uuid = { version="0.8.2", features=["v4"] } +uuid = { version = "0.8.2", features = ["v4"] } [dev-dependencies] -indoc = "1.0.3" -insta = "1.8.0" -typed-builder = "0.9.1" -unindent = "0.1.7" +indoc = "1.0.4" +insta = { version = "1.12.0", features = ["backtrace"] } +typed-builder = "0.10.0" +unindent = "0.1.8" [build-dependencies] diff --git a/support/texlab/README.md b/support/texlab/README.md index 57351b677b..dc637ae4a9 100644 --- a/support/texlab/README.md +++ b/support/texlab/README.md @@ -1,6 +1,6 @@ [![CI](https://github.com/latex-lsp/texlab/workflows/CI/badge.svg)](https://github.com/latex-lsp/texlab/actions) [![Coverage](https://codecov.io/gh/latex-lsp/texlab/branch/master/graph/badge.svg)](https://codecov.io/gh/latex-lsp/texlab) -[![Rust](https://img.shields.io/badge/rustc-1.51%2B-blue)](https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html) +[![Rust](https://img.shields.io/badge/rustc-1.53%2B-blue)](https://blog.rust-lang.org/2021/06/17/Rust-1.53.0.html) [![GitHub release](https://img.shields.io/github/release/latex-lsp/texlab?label=github)](https://github.com/latex-lsp/texlab/releases) [![CTAN](https://img.shields.io/ctan/v/texlab)](https://ctan.org/pkg/texlab) @@ -9,6 +9,8 @@ [![NixOS Unstable](https://repology.org/badge/version-for-repo/nix_unstable/texlab.svg?header=nixos%20unstable)](https://nixos.org/nixos/packages.html?channel=nixpkgs-unstable&query=texlab) [![Homebrew](https://repology.org/badge/version-for-repo/homebrew/texlab.svg?header=homebrew)](https://formulae.brew.sh/formula/texlab) [![Scoop](https://repology.org/badge/version-for-repo/scoop/texlab.svg?header=scoop)](https://scoop.sh/) +[![FreeBSD](https://repology.org/badge/version-for-repo/freebsd/texlab.svg?header=freebsd)](https://www.freshports.org/devel/texlab) +[![NetBSD](https://repology.org/badge/version-for-repo/pkgsrc_current/texlab.svg?header=netbsd)](https://pkgsrc.se/print/texlab) # TexLab @@ -40,7 +42,7 @@ On Windows, you may need to install [Microsoft Visual C++ Redistributable for Vi You will need to install the following dependencies to compile the server: -- A recent, stable version of [Rust](https://rustup.rs/) (>= 1.51) +- A recent, stable version of [Rust](https://rustup.rs/) (>= 1.53) Then run the following command in the project folder: diff --git a/support/texlab/docs/previewing.md b/support/texlab/docs/previewing.md index 0d9f35293c..fbf6679760 100644 --- a/support/texlab/docs/previewing.md +++ b/support/texlab/docs/previewing.md @@ -129,7 +129,7 @@ set synctex true set synctex-editor-command "code -g %{input}:%{line}" ``` -You can execute the search by pressing `Alt+Click` in the PDF document. +You can execute the search by pressing `Ctrl+Click` in the PDF document. --- diff --git a/support/texlab/src/citation.rs b/support/texlab/src/citation.rs index 96a5a2eccf..5be86561c9 100644 --- a/support/texlab/src/citation.rs +++ b/support/texlab/src/citation.rs @@ -97,12 +97,12 @@ fn generate_bibliography(reference: Reference) -> Option { }) .ok()?; let cite = Cite::basic(&reference.id); - let cluster_id = processor.new_cluster("texlab"); + let cluster_id = processor.cluster_id("texlab"); processor.insert_reference(reference); processor.insert_cites(cluster_id, &[cite]); processor .set_cluster_order(&[ClusterPosition { - id: cluster_id, + id: Some(cluster_id), note: Some(1), }]) .unwrap(); diff --git a/support/texlab/src/config.rs b/support/texlab/src/config.rs index 5690bee091..5e9703ef3a 100644 --- a/support/texlab/src/config.rs +++ b/support/texlab/src/config.rs @@ -17,9 +17,7 @@ pub fn register_config_capability( client_capabilities: &Mutex, ) { let client_capabilities = client_capabilities.lock().unwrap(); - if !client_capabilities.has_pull_configuration_support() - && client_capabilities.has_push_configuration_support() - { + if client_capabilities.has_push_configuration_support() { drop(client_capabilities); let reg = Registration { id: "pull-config".to_string(), diff --git a/support/texlab/src/diagnostics/bibtex.rs b/support/texlab/src/diagnostics/bibtex.rs index d90bde0c8d..8c93c6f925 100644 --- a/support/texlab/src/diagnostics/bibtex.rs +++ b/support/texlab/src/diagnostics/bibtex.rs @@ -41,7 +41,7 @@ fn analyze_entry( range: document .line_index .line_col_lsp_range(entry.ty()?.text_range()), - severity: Some(DiagnosticSeverity::Error), + severity: Some(DiagnosticSeverity::ERROR), code: Some(NumberOrString::Number(4)), code_description: None, source: Some("texlab".to_string()), @@ -61,7 +61,7 @@ fn analyze_entry( range: document .line_index .line_col_lsp_range(entry.left_delimiter()?.text_range()), - severity: Some(DiagnosticSeverity::Error), + severity: Some(DiagnosticSeverity::ERROR), code: Some(NumberOrString::Number(5)), code_description: None, source: Some("texlab".to_string()), @@ -81,7 +81,7 @@ fn analyze_entry( range: document .line_index .line_col_lsp_range(entry.right_delimiter()?.text_range()), - severity: Some(DiagnosticSeverity::Error), + severity: Some(DiagnosticSeverity::ERROR), code: Some(NumberOrString::Number(6)), code_description: None, source: Some("texlab".to_string()), @@ -110,7 +110,7 @@ fn analyze_field( range: document .line_index .line_col_lsp_range(TextRange::empty(field.name()?.text_range().end())), - severity: Some(DiagnosticSeverity::Error), + severity: Some(DiagnosticSeverity::ERROR), code: Some(NumberOrString::Number(7)), code_description: None, source: Some("texlab".to_string()), @@ -130,7 +130,7 @@ fn analyze_field( range: document.line_index.line_col_lsp_range(TextRange::empty( field.equality_sign()?.text_range().end(), )), - severity: Some(DiagnosticSeverity::Error), + severity: Some(DiagnosticSeverity::ERROR), code: Some(NumberOrString::Number(8)), code_description: None, source: Some("texlab".to_string()), diff --git a/support/texlab/src/diagnostics/build_log.rs b/support/texlab/src/diagnostics/build_log.rs index ede3a873a8..01579cbd0b 100644 --- a/support/texlab/src/diagnostics/build_log.rs +++ b/support/texlab/src/diagnostics/build_log.rs @@ -32,8 +32,8 @@ pub fn analyze_build_log_static( for error in &parse.errors { let pos = Position::new(error.line.unwrap_or(0), 0); let severity = match error.level { - BuildErrorLevel::Error => DiagnosticSeverity::Error, - BuildErrorLevel::Warning => DiagnosticSeverity::Warning, + BuildErrorLevel::Error => DiagnosticSeverity::ERROR, + BuildErrorLevel::Warning => DiagnosticSeverity::WARNING, }; let range = Range::new(pos, pos); let diagnostic = Diagnostic { diff --git a/support/texlab/src/diagnostics/chktex.rs b/support/texlab/src/diagnostics/chktex.rs index 897887c473..1786644d97 100644 --- a/support/texlab/src/diagnostics/chktex.rs +++ b/support/texlab/src/diagnostics/chktex.rs @@ -83,9 +83,9 @@ fn lint(text: &str, current_dir: &Path) -> io::Result> { let message = captures[6].into(); let range = Range::new_simple(line, character, line, character + digit); let severity = match kind { - "Message" => DiagnosticSeverity::Information, - "Warning" => DiagnosticSeverity::Warning, - _ => DiagnosticSeverity::Error, + "Message" => DiagnosticSeverity::INFORMATION, + "Warning" => DiagnosticSeverity::WARNING, + _ => DiagnosticSeverity::ERROR, }; diagnostics.push(Diagnostic { diff --git a/support/texlab/src/diagnostics/debouncer.rs b/support/texlab/src/diagnostics/debouncer.rs index 46bea80176..8c1cb63253 100644 --- a/support/texlab/src/diagnostics/debouncer.rs +++ b/support/texlab/src/diagnostics/debouncer.rs @@ -4,8 +4,8 @@ use std::{ time::{Duration, Instant}, }; -use chashmap::CHashMap; use crossbeam_channel::Sender; +use dashmap::DashMap; use crate::{Document, ServerContext, Uri, Workspace}; @@ -31,7 +31,7 @@ impl DiagnosticsDebouncer { let handle = thread::spawn(move || { let pool = threadpool::Builder::new().build(); - let last_task_time_by_uri: Arc, Instant>> = Arc::default(); + let last_task_time_by_uri: Arc, Instant>> = Arc::default(); while let Ok(DiagnosticsMessage::Analyze { workspace, document, diff --git a/support/texlab/src/diagnostics/latex.rs b/support/texlab/src/diagnostics/latex.rs index 012e9b399f..72048da93d 100644 --- a/support/texlab/src/diagnostics/latex.rs +++ b/support/texlab/src/diagnostics/latex.rs @@ -30,7 +30,7 @@ pub fn analyze_latex_static( Arc::clone(&document.uri), Diagnostic { range: document.line_index.line_col_lsp_range(node.text_range()), - severity: Some(DiagnosticSeverity::Error), + severity: Some(DiagnosticSeverity::ERROR), code: Some(NumberOrString::Number(1)), code_description: None, source: Some("texlab".to_string()), @@ -63,7 +63,7 @@ fn analyze_environment( Arc::clone(&document.uri), Diagnostic { range: document.line_index.line_col_lsp_range(name1.small_range()), - severity: Some(DiagnosticSeverity::Error), + severity: Some(DiagnosticSeverity::ERROR), code: Some(NumberOrString::Number(3)), code_description: None, source: Some("texlab".to_string()), @@ -115,7 +115,7 @@ fn analyze_curly_group( range: document .line_index .line_col_lsp_range(TextRange::empty(node.text_range().end())), - severity: Some(DiagnosticSeverity::Error), + severity: Some(DiagnosticSeverity::ERROR), code: Some(NumberOrString::Number(2)), code_description: None, source: Some("texlab".to_string()), diff --git a/support/texlab/src/features/build.rs b/support/texlab/src/features/build.rs index 6953698a29..5505b9fb70 100644 --- a/support/texlab/src/features/build.rs +++ b/support/texlab/src/features/build.rs @@ -8,8 +8,8 @@ use std::{ use anyhow::Result; use cancellation::CancellationToken; -use chashmap::CHashMap; use crossbeam_channel::Sender; +use dashmap::DashMap; use encoding_rs_io::DecodeReaderBytesBuilder; use lsp_types::{ notification::{LogMessage, Progress}, @@ -101,7 +101,7 @@ impl<'a> Drop for ProgressReporter<'a> { #[derive(Default)] pub struct BuildEngine { lock: Mutex<()>, - pub positions_by_uri: CHashMap, Position>, + pub positions_by_uri: DashMap, Position>, } impl BuildEngine { @@ -233,7 +233,7 @@ fn capture_output( &lsp_sender, LogMessageParams { message, - typ: lsp_types::MessageType::Log, + typ: lsp_types::MessageType::LOG, }, ) .unwrap(); diff --git a/support/texlab/src/features/completion.rs b/support/texlab/src/features/completion.rs index cb6a66f3cd..2a3f4ea9af 100644 --- a/support/texlab/src/features/completion.rs +++ b/support/texlab/src/features/completion.rs @@ -326,14 +326,15 @@ fn convert_internal_items( .and_then(|cap| cap.snippet_support) == Some(true) { + let text_edit = TextEdit::new(range, "begin{$1}\n\t$0\n\\end{$1}".into()); CompletionItem { kind: Some(adjust_kind( &context.request, Structure::Snippet.completion_kind(), )), data: Some(serde_json::to_value(CompletionItemData::CommandSnippet).unwrap()), - insert_text: Some("begin{$1}\n\t$0\n\\end{$1}".into()), - insert_text_format: Some(InsertTextFormat::Snippet), + text_edit: Some(CompletionTextEdit::Edit(text_edit)), + insert_text_format: Some(InsertTextFormat::SNIPPET), ..CompletionItem::new_simple("begin".into(), component_detail(&[])) } } else { diff --git a/support/texlab/src/features/completion/util.rs b/support/texlab/src/features/completion/util.rs index 296d6d25d9..5c4d83e4e9 100644 --- a/support/texlab/src/features/completion/util.rs +++ b/support/texlab/src/features/completion/util.rs @@ -62,5 +62,5 @@ pub fn adjust_kind( return kind; } } - CompletionItemKind::Text + CompletionItemKind::TEXT } diff --git a/support/texlab/src/features/cursor.rs b/support/texlab/src/features/cursor.rs index d8db0f2aa8..d1de067091 100644 --- a/support/texlab/src/features/cursor.rs +++ b/support/texlab/src/features/cursor.rs @@ -46,7 +46,9 @@ impl Cursor { return Some(Self::Latex(left)); } - if right.kind() == latex::WHITESPACE && right.parent().kind() == latex::KEY { + if matches!(right.kind(), latex::WHITESPACE | latex::LINE_BREAK) + && right.parent().kind() == latex::KEY + { return Some(Self::Latex(right)); } diff --git a/support/texlab/src/features/highlight/label.rs b/support/texlab/src/features/highlight/label.rs index 9694993033..9394378c09 100644 --- a/support/texlab/src/features/highlight/label.rs +++ b/support/texlab/src/features/highlight/label.rs @@ -31,7 +31,7 @@ pub fn find_label_highlights( highlights.push(DocumentHighlight { range, - kind: Some(DocumentHighlightKind::Write), + kind: Some(DocumentHighlightKind::WRITE), }); } else if let Some(label) = latex::LabelReference::cast(node) { for label_name in label @@ -46,7 +46,7 @@ pub fn find_label_highlights( highlights.push(DocumentHighlight { range, - kind: Some(DocumentHighlightKind::Read), + kind: Some(DocumentHighlightKind::READ), }); } } else if let Some(label) = latex::LabelReferenceRange::cast(node) { @@ -61,7 +61,7 @@ pub fn find_label_highlights( highlights.push(DocumentHighlight { range, - kind: Some(DocumentHighlightKind::Read), + kind: Some(DocumentHighlightKind::READ), }); } @@ -76,7 +76,7 @@ pub fn find_label_highlights( highlights.push(DocumentHighlight { range, - kind: Some(DocumentHighlightKind::Read), + kind: Some(DocumentHighlightKind::READ), }); } } @@ -141,11 +141,11 @@ mod tests { let expected_highlights = vec![ DocumentHighlight { range: Range::new_simple(0, 7, 0, 10), - kind: Some(DocumentHighlightKind::Write), + kind: Some(DocumentHighlightKind::WRITE), }, DocumentHighlight { range: Range::new_simple(1, 5, 1, 8), - kind: Some(DocumentHighlightKind::Read), + kind: Some(DocumentHighlightKind::READ), }, ]; diff --git a/support/texlab/src/features/lsp_kinds.rs b/support/texlab/src/features/lsp_kinds.rs index fbfc50cace..82706b5aee 100644 --- a/support/texlab/src/features/lsp_kinds.rs +++ b/support/texlab/src/features/lsp_kinds.rs @@ -30,64 +30,64 @@ pub enum Structure { impl Structure { pub fn completion_kind(self) -> CompletionItemKind { match self { - Self::Command => CompletionItemKind::Function, - Self::Snippet => CompletionItemKind::Snippet, - Self::Environment => CompletionItemKind::Enum, - Self::Section => CompletionItemKind::Module, - Self::Float => CompletionItemKind::Method, - Self::Theorem => CompletionItemKind::Variable, - Self::Equation => CompletionItemKind::Constant, - Self::Item => CompletionItemKind::EnumMember, - Self::Label => CompletionItemKind::Constructor, - Self::Folder => CompletionItemKind::Folder, - Self::File => CompletionItemKind::File, - Self::PgfLibrary => CompletionItemKind::Property, - Self::TikzLibrary => CompletionItemKind::Property, - Self::Color => CompletionItemKind::Color, - Self::ColorModel => CompletionItemKind::Color, - Self::Package => CompletionItemKind::Class, - Self::Class => CompletionItemKind::Class, - Self::Entry(BibtexEntryTypeCategory::Misc) => CompletionItemKind::Interface, - Self::Entry(BibtexEntryTypeCategory::String) => CompletionItemKind::Text, - Self::Entry(BibtexEntryTypeCategory::Article) => CompletionItemKind::Event, - Self::Entry(BibtexEntryTypeCategory::Book) => CompletionItemKind::Struct, - Self::Entry(BibtexEntryTypeCategory::Collection) => CompletionItemKind::TypeParameter, - Self::Entry(BibtexEntryTypeCategory::Part) => CompletionItemKind::Operator, - Self::Entry(BibtexEntryTypeCategory::Thesis) => CompletionItemKind::Unit, - Self::Field => CompletionItemKind::Field, - Self::Argument => CompletionItemKind::Value, - Self::GlossaryEntry => CompletionItemKind::Keyword, + Self::Command => CompletionItemKind::FUNCTION, + Self::Snippet => CompletionItemKind::SNIPPET, + Self::Environment => CompletionItemKind::ENUM, + Self::Section => CompletionItemKind::MODULE, + Self::Float => CompletionItemKind::METHOD, + Self::Theorem => CompletionItemKind::VARIABLE, + Self::Equation => CompletionItemKind::CONSTANT, + Self::Item => CompletionItemKind::ENUM_MEMBER, + Self::Label => CompletionItemKind::CONSTRUCTOR, + Self::Folder => CompletionItemKind::FOLDER, + Self::File => CompletionItemKind::FILE, + Self::PgfLibrary => CompletionItemKind::PROPERTY, + Self::TikzLibrary => CompletionItemKind::PROPERTY, + Self::Color => CompletionItemKind::COLOR, + Self::ColorModel => CompletionItemKind::COLOR, + Self::Package => CompletionItemKind::CLASS, + Self::Class => CompletionItemKind::CLASS, + Self::Entry(BibtexEntryTypeCategory::Misc) => CompletionItemKind::INTERFACE, + Self::Entry(BibtexEntryTypeCategory::String) => CompletionItemKind::TEXT, + Self::Entry(BibtexEntryTypeCategory::Article) => CompletionItemKind::EVENT, + Self::Entry(BibtexEntryTypeCategory::Book) => CompletionItemKind::STRUCT, + Self::Entry(BibtexEntryTypeCategory::Collection) => CompletionItemKind::TYPE_PARAMETER, + Self::Entry(BibtexEntryTypeCategory::Part) => CompletionItemKind::OPERATOR, + Self::Entry(BibtexEntryTypeCategory::Thesis) => CompletionItemKind::UNIT, + Self::Field => CompletionItemKind::FIELD, + Self::Argument => CompletionItemKind::VALUE, + Self::GlossaryEntry => CompletionItemKind::KEYWORD, } } pub fn symbol_kind(self) -> SymbolKind { match self { - Self::Command => SymbolKind::Function, + Self::Command => SymbolKind::FUNCTION, Self::Snippet => unimplemented!(), - Self::Environment => SymbolKind::Enum, - Self::Section => SymbolKind::Module, - Self::Float => SymbolKind::Method, - Self::Theorem => SymbolKind::Variable, - Self::Equation => SymbolKind::Constant, - Self::Item => SymbolKind::EnumMember, - Self::Label => SymbolKind::Constructor, - Self::Folder => SymbolKind::Namespace, - Self::File => SymbolKind::File, - Self::PgfLibrary => SymbolKind::Property, - Self::TikzLibrary => SymbolKind::Property, + Self::Environment => SymbolKind::ENUM, + Self::Section => SymbolKind::MODULE, + Self::Float => SymbolKind::METHOD, + Self::Theorem => SymbolKind::VARIABLE, + Self::Equation => SymbolKind::CONSTANT, + Self::Item => SymbolKind::ENUM_MEMBER, + Self::Label => SymbolKind::CONSTRUCTOR, + Self::Folder => SymbolKind::NAMESPACE, + Self::File => SymbolKind::FILE, + Self::PgfLibrary => SymbolKind::PROPERTY, + Self::TikzLibrary => SymbolKind::PROPERTY, Self::Color => unimplemented!(), Self::ColorModel => unimplemented!(), - Self::Package => SymbolKind::Class, - Self::Class => SymbolKind::Class, - Self::Entry(BibtexEntryTypeCategory::Misc) => SymbolKind::Interface, - Self::Entry(BibtexEntryTypeCategory::String) => SymbolKind::String, - Self::Entry(BibtexEntryTypeCategory::Article) => SymbolKind::Event, - Self::Entry(BibtexEntryTypeCategory::Book) => SymbolKind::Struct, - Self::Entry(BibtexEntryTypeCategory::Collection) => SymbolKind::TypeParameter, - Self::Entry(BibtexEntryTypeCategory::Part) => SymbolKind::Operator, - Self::Entry(BibtexEntryTypeCategory::Thesis) => SymbolKind::Object, - Self::Field => SymbolKind::Field, - Self::Argument => SymbolKind::Number, + Self::Package => SymbolKind::CLASS, + Self::Class => SymbolKind::CLASS, + Self::Entry(BibtexEntryTypeCategory::Misc) => SymbolKind::INTERFACE, + Self::Entry(BibtexEntryTypeCategory::String) => SymbolKind::STRING, + Self::Entry(BibtexEntryTypeCategory::Article) => SymbolKind::EVENT, + Self::Entry(BibtexEntryTypeCategory::Book) => SymbolKind::STRUCT, + Self::Entry(BibtexEntryTypeCategory::Collection) => SymbolKind::TYPE_PARAMETER, + Self::Entry(BibtexEntryTypeCategory::Part) => SymbolKind::OPERATOR, + Self::Entry(BibtexEntryTypeCategory::Thesis) => SymbolKind::OBJECT, + Self::Field => SymbolKind::FIELD, + Self::Argument => SymbolKind::NUMBER, Self::GlossaryEntry => unimplemented!(), } } diff --git a/support/texlab/src/server.rs b/support/texlab/src/server.rs index 000118a9a2..2521faba09 100644 --- a/support/texlab/src/server.rs +++ b/support/texlab/src/server.rs @@ -20,6 +20,7 @@ use lsp_types::{ *, }; use notification::DidCloseTextDocument; +use notify::RecursiveMode; use request::{ Completion, DocumentHighlightRequest, DocumentSymbolRequest, HoverRequest, ResolveCompletionItem, WorkspaceSymbol, @@ -39,10 +40,11 @@ use crate::{ find_all_references, find_document_highlights, find_document_links, find_document_symbols, find_foldings, find_hover, find_workspace_symbols, format_source_code, goto_definition, prepare_rename_all, rename_all, BuildEngine, BuildParams, BuildResult, BuildStatus, - FeatureRequest, ForwardSearchResult, + FeatureRequest, ForwardSearchResult, ForwardSearchStatus, }, - req_queue::{IncomingData, ReqQueue}, - Document, DocumentLanguage, LineIndexExt, ServerContext, Uri, Workspace, WorkspaceSource, + req_queue::{self, IncomingData, ReqQueue}, + ClientCapabilitiesExt, Document, DocumentLanguage, LineIndexExt, ServerContext, Uri, Workspace, + WorkspaceSource, }; pub struct Server { @@ -92,7 +94,7 @@ impl Server { text_document_sync: Some(TextDocumentSyncCapability::Options( TextDocumentSyncOptions { open_close: Some(true), - change: Some(TextDocumentSyncKind::Incremental), + change: Some(TextDocumentSyncKind::INCREMENTAL), will_save: None, will_save_wait_until: None, save: Some(TextDocumentSyncSaveOptions::SaveOptions(SaveOptions { @@ -179,22 +181,9 @@ impl Server { let workspace = Arc::clone(&self.workspace); self.pool.execute(move || { register_config_capability(&req_queue, &sender, &context.client_capabilities); - pull_config( - &req_queue, - &sender, - &context.options, - &context.client_capabilities.lock().unwrap(), - ); - - for document in workspace.documents() { - workspace.open( - Arc::clone(&document.uri), - document.text.clone(), - document.language(), - WorkspaceSource::Client, - ); - } + pull_and_reparse_all(req_queue, sender, context, workspace); }); + Ok(()) } @@ -235,7 +224,27 @@ impl Server { } fn did_change_configuration(&self, params: DidChangeConfigurationParams) -> Result<()> { - push_config(&self.context.options, params.settings); + let client_capabilities = { self.context.client_capabilities.lock().unwrap().clone() }; + if client_capabilities.has_pull_configuration_support() { + let req_queue = Arc::clone(&self.req_queue); + let sender = self.connection.sender.clone(); + let context = Arc::clone(&self.context); + let workspace = Arc::clone(&self.workspace); + self.pool.execute(move || { + pull_and_reparse_all(req_queue, sender, context, workspace); + }); + } else { + push_config(&self.context.options, params.settings); + if let Some(path) = { self.context.options.read().unwrap().aux_directory.clone() } { + let _ = self.workspace.watch(path, RecursiveMode::NonRecursive); + } + + let workspace = Arc::clone(&self.workspace); + self.pool.execute(move || { + reparse_all(workspace.as_ref()); + }); + } + Ok(()) } @@ -394,14 +403,6 @@ impl Server { } fn feature_request

(&self, uri: Arc, params: P) -> Option> { - let req_queue = Arc::clone(&self.req_queue); - let sender = self.connection.sender.clone(); - let cx = Arc::clone(&self.context); - self.pool.execute(move || { - let client_capabilities = &cx.client_capabilities.lock().unwrap().clone(); - pull_config(&req_queue, &sender, &cx.options, &client_capabilities); - }); - Some(FeatureRequest { context: Arc::clone(&self.context), params, @@ -751,13 +752,13 @@ impl Server { token: &Arc, ) -> Result<()> { let uri = Arc::new(params.text_document.uri.clone().into()); - self.handle_feature_request( - id, - params, - uri, - token, - crate::features::execute_forward_search, - )?; + self.handle_feature_request(id, params, uri, token, |req, token| { + crate::features::execute_forward_search(req, token).unwrap_or_else(|| { + ForwardSearchResult { + status: ForwardSearchStatus::ERROR, + } + }) + })?; Ok(()) } @@ -854,6 +855,32 @@ impl Server { } } +fn pull_and_reparse_all( + req_queue: Arc>>, + sender: Sender, + context: Arc, + workspace: Arc, +) { + let client_capabilities = { context.client_capabilities.lock().unwrap().clone() }; + pull_config(&req_queue, &sender, &context.options, &client_capabilities); + if let Some(path) = { context.options.read().unwrap().aux_directory.clone() } { + let _ = workspace.watch(path, RecursiveMode::NonRecursive); + } + + reparse_all(workspace.as_ref()); +} + +fn reparse_all(workspace: &dyn Workspace) { + for document in workspace.documents() { + workspace.open( + Arc::clone(&document.uri), + document.text.clone(), + document.language(), + WorkspaceSource::Client, + ); + } +} + fn create_static_debouncer( manager: Arc>, conn: &Connection, diff --git a/support/texlab/src/syntax/latex/analysis.rs b/support/texlab/src/syntax/latex/analysis.rs index 063d8e95f3..2849ade1be 100644 --- a/support/texlab/src/syntax/latex/analysis.rs +++ b/support/texlab/src/syntax/latex/analysis.rs @@ -12,7 +12,7 @@ use crate::syntax::latex; pub use self::types::*; use self::{ - command::analyze_command, + command::{analyze_command, analyze_command_definition}, environment::analyze_begin, explicit_link::{analyze_import, analyze_include}, implicit_link::analyze_implicit_links, @@ -25,6 +25,7 @@ pub fn analyze(context: &mut LatexAnalyzerContext, root: &latex::SyntaxNode) { analyze_implicit_links(context); for node in root.descendants() { analyze_command(context, node) + .or_else(|| analyze_command_definition(context, node)) .or_else(|| analyze_begin(context, node)) .or_else(|| analyze_include(context, node)) .or_else(|| analyze_import(context, node)) diff --git a/support/texlab/src/syntax/latex/analysis/command.rs b/support/texlab/src/syntax/latex/analysis/command.rs index 9dea4d84ee..b8b3f0ef9a 100644 --- a/support/texlab/src/syntax/latex/analysis/command.rs +++ b/support/texlab/src/syntax/latex/analysis/command.rs @@ -10,3 +10,15 @@ pub fn analyze_command(context: &mut LatexAnalyzerContext, node: &latex::SyntaxN .insert(command.name()?.text().into()); Some(()) } + +pub fn analyze_command_definition( + context: &mut LatexAnalyzerContext, + node: &latex::SyntaxNode, +) -> Option<()> { + let definition = latex::CommandDefinition::cast(node)?; + context + .extras + .command_names + .insert(definition.name()?.command()?.text().into()); + Some(()) +} diff --git a/support/texlab/src/syntax/latex/analysis/explicit_link.rs b/support/texlab/src/syntax/latex/analysis/explicit_link.rs index f177354ac7..48f8d6b5ee 100644 --- a/support/texlab/src/syntax/latex/analysis/explicit_link.rs +++ b/support/texlab/src/syntax/latex/analysis/explicit_link.rs @@ -50,10 +50,10 @@ pub fn analyze_import(context: &mut LatexAnalyzerContext, node: &latex::SyntaxNo let import = latex::Import::cast(node)?; let mut targets = Vec::new(); - let directory = context - .base_uri - .join(&import.directory()?.key()?.to_string()) - .ok()?; + let directory = match import.directory().and_then(|dir| dir.key()) { + Some(dir) => Arc::new(context.base_uri.join(&dir.to_string()).ok()?.into()), + None => Arc::clone(&context.base_uri), + }; let file = import.file()?.key()?; let stem = file.to_string(); diff --git a/support/texlab/src/syntax/latex/cst.rs b/support/texlab/src/syntax/latex/cst.rs index a800236ebf..80c3375304 100644 --- a/support/texlab/src/syntax/latex/cst.rs +++ b/support/texlab/src/syntax/latex/cst.rs @@ -33,7 +33,7 @@ macro_rules! cst_node { let start = full_range.start(); let mut token = self.syntax().last_token(); while let Some(current) = token { - if !matches!(current.kind(), WHITESPACE | COMMENT) { + if !matches!(current.kind(), LINE_BREAK | WHITESPACE | COMMENT) { return TextRange::new(start, current.text_range().end()); } token = current.prev_token(); diff --git a/support/texlab/src/syntax/latex/kind.rs b/support/texlab/src/syntax/latex/kind.rs index 90b68145a7..410cd4fef7 100644 --- a/support/texlab/src/syntax/latex/kind.rs +++ b/support/texlab/src/syntax/latex/kind.rs @@ -5,6 +5,7 @@ pub enum SyntaxKind { ERROR = 0, MISSING, + LINE_BREAK, WHITESPACE, COMMENT, L_CURLY, diff --git a/support/texlab/src/syntax/latex/lexer.rs b/support/texlab/src/syntax/latex/lexer.rs index f697403577..4ea11bf377 100644 --- a/support/texlab/src/syntax/latex/lexer.rs +++ b/support/texlab/src/syntax/latex/lexer.rs @@ -6,8 +6,11 @@ use super::kind::SyntaxKind; #[allow(non_camel_case_types)] #[repr(u16)] enum Token { - #[regex(r"\s+")] - WHITESPACE = 2, + #[regex(r"[\r\n]+", priority = 2)] + LINE_BREAK = 2, + + #[regex(r"\s+", priority = 1)] + WHITESPACE, #[regex(r"%[^\r\n]*")] COMMENT, @@ -166,7 +169,7 @@ enum Token { #[regex(r"\\usepgflibrary|\\usetikzlibrary")] TIKZ_LIBRARY_IMPORT_NAME, - #[regex(r"\\newenvironment|\\newenvironment*")] + #[regex(r"\\newenvironment|\\newenvironment*|\\renewenvironment|\\renewenvironment*")] ENVIRONMENT_DEFINITION_NAME, } @@ -249,4 +252,9 @@ mod tests { fn test_invalid_parameter() { assert_debug_snapshot!(verify(r#"#"#)) } + + #[test] + fn test_line_break() { + assert_debug_snapshot!(verify("hello\nworld")); + } } diff --git a/support/texlab/src/syntax/latex/parser.rs b/support/texlab/src/syntax/latex/parser.rs index a7fe3342f8..fcca6771a2 100644 --- a/support/texlab/src/syntax/latex/parser.rs +++ b/support/texlab/src/syntax/latex/parser.rs @@ -74,7 +74,7 @@ impl<'a> Parser<'a> { fn trivia(&mut self) { while self .peek() - .filter(|&kind| matches!(kind, WHITESPACE | COMMENT)) + .filter(|&kind| matches!(kind, LINE_BREAK | WHITESPACE | COMMENT)) .is_some() { self.eat(); @@ -96,7 +96,7 @@ impl<'a> Parser<'a> { fn content(&mut self, context: ParserContext) { match self.peek().unwrap() { - WHITESPACE | COMMENT => self.eat(), + LINE_BREAK | WHITESPACE | COMMENT => self.eat(), L_CURLY if context.allow_environment => self.curly_group(), L_CURLY => self.curly_group_without_environments(), L_BRACK | L_PAREN => self.mixed_group(), @@ -162,7 +162,7 @@ impl<'a> Parser<'a> { while self .peek() .filter(|&kind| { - matches!(kind, WHITESPACE | COMMENT | WORD | COMMA) + matches!(kind, LINE_BREAK | WHITESPACE | COMMENT | WORD | COMMA) && (context.allow_comma || kind != COMMA) }) .is_some() @@ -211,6 +211,9 @@ impl<'a> Parser<'a> { Some(WORD) => { self.key(); } + Some(kind) if kind.is_command_name() => { + self.content(ParserContext::default()); + } Some(_) | None => { self.builder.token(MISSING.into(), ""); } @@ -225,7 +228,7 @@ impl<'a> Parser<'a> { while self .peek() - .filter(|&kind| matches!(kind, WHITESPACE | COMMENT | WORD | COMMA)) + .filter(|&kind| matches!(kind, LINE_BREAK | WHITESPACE | COMMENT | WORD | COMMA)) .is_some() { if self.peek() == Some(WORD) { @@ -340,6 +343,8 @@ impl<'a> Parser<'a> { { self.eat(); } + + self.trivia(); self.builder.finish_node(); } @@ -381,7 +386,7 @@ impl<'a> Parser<'a> { self.builder.start_node(KEY_VALUE_BODY.into()); while let Some(kind) = self.peek() { match kind { - WHITESPACE | COMMENT => self.eat(), + LINE_BREAK | WHITESPACE | COMMENT => self.eat(), WORD => { self.key_value_pair(); if self.peek() == Some(COMMA) { @@ -433,7 +438,7 @@ impl<'a> Parser<'a> { self.eat(); while let Some(kind) = self.peek() { match kind { - WHITESPACE | COMMENT => self.eat(), + LINE_BREAK | WHITESPACE | COMMENT => self.eat(), L_CURLY => self.curly_group(), L_BRACK | L_PAREN => self.mixed_group(), _ => break, @@ -932,6 +937,10 @@ impl<'a> Parser<'a> { if self.lexer.peek() == Some(L_BRACK) { self.brack_group_word(); + + if self.lexer.peek() == Some(L_BRACK) { + self.brack_group(); + } } if self.lexer.peek() == Some(L_CURLY) { @@ -1565,6 +1574,11 @@ mod tests { assert_debug_snapshot!(setup(r#"\newcommand[1]{\id}{#1}"#)); } + #[test] + fn test_command_definition_optional() { + assert_debug_snapshot!(setup(r#"\newcommand{\foo}[1][def]{#1}"#)); + } + #[test] fn test_command_definition_no_argc() { assert_debug_snapshot!(setup(r#"\newcommand{\foo}{foo}"#)); @@ -1708,4 +1722,9 @@ mod tests { r#"\DeclareAcronym{eg}{short = e.g,long = for example,tag = abbrev}"# )); } + + #[test] + fn test_label_definition_line_break() { + assert_debug_snapshot!(setup("\\label{hello\nworld}")); + } } diff --git a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__comment.snap b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__comment.snap index 2186c957c5..19db458200 100644 --- a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__comment.snap +++ b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__comment.snap @@ -1,5 +1,6 @@ --- source: src/syntax/latex/lexer.rs +assertion_line: 248 expression: "verify(\"hello %world\\r\\ntest %test\")" --- @@ -17,7 +18,7 @@ expression: "verify(\"hello %world\\r\\ntest %test\")" "%world", ), ( - WHITESPACE, + LINE_BREAK, "\r\n", ), ( diff --git a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__line_break.snap b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__line_break.snap new file mode 100644 index 0000000000..a8a392370e --- /dev/null +++ b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__lexer__tests__line_break.snap @@ -0,0 +1,20 @@ +--- +source: src/syntax/latex/lexer.rs +assertion_line: 258 +expression: "verify(\"hello\\nworld\")" + +--- +[ + ( + WORD, + "hello", + ), + ( + LINE_BREAK, + "\n", + ), + ( + WORD, + "world", + ), +] diff --git a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__command_definition_optional.snap b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__command_definition_optional.snap new file mode 100644 index 0000000000..66c263e49a --- /dev/null +++ b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__command_definition_optional.snap @@ -0,0 +1,30 @@ +--- +source: src/syntax/latex/parser.rs +assertion_line: 1579 +expression: "setup(r#\"\\newcommand{\\foo}[1][def]{#1}\"#)" + +--- +ROOT@0..29 + PREAMBLE@0..29 + COMMAND_DEFINITION@0..29 + COMMAND_DEFINITION_NAME@0..11 "\\newcommand" + CURLY_GROUP_COMMAND@11..17 + L_CURLY@11..12 "{" + GENERIC_COMMAND_NAME@12..16 "\\foo" + R_CURLY@16..17 "}" + BRACK_GROUP_WORD@17..20 + L_BRACK@17..18 "[" + KEY@18..19 + WORD@18..19 "1" + R_BRACK@19..20 "]" + BRACK_GROUP@20..25 + L_BRACK@20..21 "[" + TEXT@21..24 + WORD@21..24 "def" + R_BRACK@24..25 "]" + CURLY_GROUP@25..29 + L_CURLY@25..26 "{" + TEXT@26..28 + WORD@26..28 "#1" + R_CURLY@28..29 "}" + diff --git a/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__label_definition_line_break.snap b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__label_definition_line_break.snap new file mode 100644 index 0000000000..47187fabcd --- /dev/null +++ b/support/texlab/src/syntax/latex/snapshots/texlab__syntax__latex__parser__tests__label_definition_line_break.snap @@ -0,0 +1,21 @@ +--- +source: src/syntax/latex/parser.rs +assertion_line: 1719 +expression: "setup(\"\\\\label{hello\\nworld}\")" + +--- +ROOT@0..19 + PREAMBLE@0..19 + LABEL_DEFINITION@0..13 + LABEL_DEFINITION_NAME@0..6 "\\label" + CURLY_GROUP_WORD@6..13 + L_CURLY@6..7 "{" + KEY@7..13 + WORD@7..12 "hello" + LINE_BREAK@12..13 "\n" + MISSING@13..13 "" + TEXT@13..18 + WORD@13..18 "world" + ERROR@18..19 + R_CURLY@18..19 "}" + diff --git a/support/texlab/src/workspace/api.rs b/support/texlab/src/workspace/api.rs index 1ccd19d4e4..6a3c3d02c9 100644 --- a/support/texlab/src/workspace/api.rs +++ b/support/texlab/src/workspace/api.rs @@ -1,6 +1,7 @@ use std::{fs, path::PathBuf, sync::Arc}; use anyhow::Result; +use notify::RecursiveMode; use crate::{DocumentLanguage, Uri}; @@ -37,9 +38,9 @@ pub trait Workspace: Send + Sync { return Ok(self.get(&uri)); } - let data = fs::read(&path)?; - let text = String::from_utf8_lossy(&data).into_owned(); if let Some(language) = DocumentLanguage::by_path(&path) { + let data = fs::read(&path)?; + let text = String::from_utf8_lossy(&data).into_owned(); Ok(Some(self.open( uri, text, @@ -83,4 +84,6 @@ pub trait Workspace: Send + Sync { fn is_open(&self, uri: &Uri) -> bool; fn subset(&self, uri: Arc) -> Option; + + fn watch(&self, path: PathBuf, mode: RecursiveMode) -> Result<()>; } diff --git a/support/texlab/src/workspace/children_expand.rs b/support/texlab/src/workspace/children_expand.rs index 006e7b17e2..8fecf2d503 100644 --- a/support/texlab/src/workspace/children_expand.rs +++ b/support/texlab/src/workspace/children_expand.rs @@ -1,5 +1,7 @@ -use std::sync::Arc; +use std::{path::PathBuf, sync::Arc}; +use anyhow::Result; +use notify::RecursiveMode; use rayon::iter::{IntoParallelIterator, ParallelIterator}; use crate::{ @@ -89,4 +91,8 @@ impl Workspace for ChildrenExpander { fn subset(&self, uri: Arc) -> Option { self.workspace.subset(uri) } + + fn watch(&self, path: PathBuf, mode: RecursiveMode) -> Result<()> { + self.workspace.watch(path, mode) + } } diff --git a/support/texlab/src/workspace/parent_expand.rs b/support/texlab/src/workspace/parent_expand.rs index 33b0ca3c5e..0eef06ce92 100644 --- a/support/texlab/src/workspace/parent_expand.rs +++ b/support/texlab/src/workspace/parent_expand.rs @@ -1,5 +1,7 @@ -use std::{fs, sync::Arc}; +use std::{fs, path::PathBuf, sync::Arc}; +use anyhow::Result; +use notify::RecursiveMode; use rayon::iter::{IntoParallelIterator, ParallelIterator}; use rustc_hash::FxHashSet; @@ -96,6 +98,10 @@ where fn subset(&self, uri: Arc) -> Option { self.workspace.subset(uri) } + + fn watch(&self, path: PathBuf, mode: RecursiveMode) -> Result<()> { + self.workspace.watch(path, mode) + } } impl ParentExpander diff --git a/support/texlab/src/workspace/storage.rs b/support/texlab/src/workspace/storage.rs index 964535a718..5f067a16aa 100644 --- a/support/texlab/src/workspace/storage.rs +++ b/support/texlab/src/workspace/storage.rs @@ -1,5 +1,10 @@ -use std::sync::{Arc, Mutex}; +use std::{ + path::PathBuf, + sync::{Arc, Mutex}, +}; +use anyhow::Result; +use notify::RecursiveMode; use petgraph::{graphmap::UnGraphMap, visit::Dfs}; use rustc_hash::{FxHashMap, FxHashSet}; @@ -133,4 +138,8 @@ impl Workspace for Storage { Some(WorkspaceSubset { documents }) } + + fn watch(&self, _path: PathBuf, _mode: RecursiveMode) -> Result<()> { + Ok(()) + } } diff --git a/support/texlab/src/workspace/watch.rs b/support/texlab/src/workspace/watch.rs index 655872f603..4cc1834620 100644 --- a/support/texlab/src/workspace/watch.rs +++ b/support/texlab/src/workspace/watch.rs @@ -32,7 +32,7 @@ where } fn create_watcher(workspace: Arc) -> Result { - let watcher = Watcher::new_immediate(move |event: notify::Result| { + let watcher = notify::recommended_watcher(move |event: notify::Result| { if let Ok(event) = event { if event.kind.is_modify() { for path in event.paths { @@ -57,20 +57,11 @@ impl Workspace for DocumentWatcher { if document.uri.scheme() == "file" { if let Ok(mut path) = document.uri.to_file_path() { path.pop(); - let mut watched_paths = self.watched_paths.lock().unwrap(); - if !watched_paths.contains(&path) { - if let Err(why) = self - .watcher - .lock() - .unwrap() - .watch(&path, RecursiveMode::NonRecursive) - { - warn!( - "Failed to watch folder of document \"{}\": {}", - document.uri, why - ); - } - watched_paths.insert(path); + if let Err(why) = self.watch(path, RecursiveMode::NonRecursive) { + warn!( + "Failed to watch folder of document \"{}\": {}", + document.uri, why + ); } } } @@ -104,4 +95,14 @@ impl Workspace for DocumentWatcher { fn subset(&self, uri: Arc) -> Option { self.workspace.subset(uri) } + + fn watch(&self, path: PathBuf, mode: RecursiveMode) -> Result<()> { + let mut watched_paths = self.watched_paths.lock().unwrap(); + if !watched_paths.contains(&path) { + self.watcher.lock().unwrap().watch(&path, mode)?; + watched_paths.insert(path); + } + + Ok(()) + } } diff --git a/support/texlab/tests/integration/completion.rs b/support/texlab/tests/integration/completion.rs index 74e8269d67..eccc8162ba 100644 --- a/support/texlab/tests/integration/completion.rs +++ b/support/texlab/tests/integration/completion.rs @@ -793,4 +793,25 @@ mod latex { assert_json_snapshot!(complete_and_resolve(&server, uri, 4, 8)?); Ok(()) } + + #[test] + fn test_multi_line_key() -> Result<()> { + let server = ServerTester::launch_new_instance()?; + server.initialize(ClientCapabilities::default(), None)?; + let uri = server.open( + "main.tex", + r#" + \begin{verb + Velit tri-tip fig1n shoulder buffalo pariatur porkchop magna chuck sausage, + sed hamburger fatback ribeye biltong id lorem culpa cow, frankfurter + deserunt shortloin pancetta dolor et veniam aliqua andouille, pork fugiat eu + pig landjaeger proident aliquip voluptate. + "#, + "latex", + false, + )?; + + assert_json_snapshot!(complete_and_resolve(&server, uri, 0, 11)?); + Ok(()) + } } diff --git a/support/texlab/tests/integration/issues.rs b/support/texlab/tests/integration/issues.rs index b991d185d3..1fb66dc4a9 100644 --- a/support/texlab/tests/integration/issues.rs +++ b/support/texlab/tests/integration/issues.rs @@ -59,3 +59,23 @@ fn test_510_completion_with_unmatched_braces() -> Result<()> { Ok(()) } + +#[test] +#[cfg(feature = "completion")] +fn test_540_subimport_link() -> Result<()> { + let server = ServerTester::launch_new_instance()?; + server.initialize(ClientCapabilities::default(), None)?; + + server.open("stuff.tex", "\\usepackage{lipsum}", "latex", false)?; + let uri = server.open("main.tex", "\\subimport{}{stuff}\n\\lipsu", "latex", false)?; + + let success = server + .complete(uri, 1, 4)? + .items + .into_iter() + .any(|item| item.label == "lipsum"); + + assert!(success); + + Ok(()) +} diff --git a/support/texlab/tests/integration/snapshots/integration__completion__latex__multi_line_key.snap b/support/texlab/tests/integration/snapshots/integration__completion__latex__multi_line_key.snap new file mode 100644 index 0000000000..e22d12571b --- /dev/null +++ b/support/texlab/tests/integration/snapshots/integration__completion__latex__multi_line_key.snap @@ -0,0 +1,51 @@ +--- +source: tests/integration/completion.rs +assertion_line: 814 +expression: "complete_and_resolve(&server, uri, 0, 11)?" + +--- +{ + "isIncomplete": false, + "items": [ + { + "label": "verbatim", + "kind": 1, + "detail": "built-in", + "preselect": false, + "sortText": "00", + "textEdit": { + "range": { + "start": { + "line": 0, + "character": 7 + }, + "end": { + "line": 0, + "character": 11 + } + }, + "newText": "verbatim" + } + }, + { + "label": "verbatim*", + "kind": 1, + "detail": "built-in", + "preselect": false, + "sortText": "01", + "textEdit": { + "range": { + "start": { + "line": 0, + "character": 7 + }, + "end": { + "line": 0, + "character": 11 + } + }, + "newText": "verbatim*" + } + } + ] +} diff --git a/support/texlab/texlab.pdf b/support/texlab/texlab.pdf index 289c5f1951..162683cb47 100644 Binary files a/support/texlab/texlab.pdf and b/support/texlab/texlab.pdf differ -- cgit v1.2.3