diff --git a/vim/bundle/LanguageClient-neovim/.circleci/config.yml b/vim/bundle/LanguageClient-neovim/.circleci/config.yml index c9101d1..fd72c11 100644 --- a/vim/bundle/LanguageClient-neovim/.circleci/config.yml +++ b/vim/bundle/LanguageClient-neovim/.circleci/config.yml @@ -5,41 +5,17 @@ general: - /binary-.*/ jobs: - lint: - docker: - - image: circleci/rust:latest - steps: - - checkout - - run: | - rustup component add clippy - cargo clippy --all -- --deny warnings - format: - docker: - - image: circleci/rust:latest - steps: - - checkout - - run: cargo fmt -- --check build: docker: - image: autozimu/languageclientneovim steps: - checkout - run: make ci - deploy: - docker: - - image: autozimu/rust-cross-for-macos - steps: - - checkout - - run: | - cargo build --target=x86_64-apple-darwin --release - github-release upload --user autozimu --repo LanguageClient-neovim --tag test --name languageclient-x86_64-apple-darwin --file $CARGO_TARGET_DIR/x86_64-apple-darwin/release/languageclient workflows: version: 2 dev: jobs: - - format - - lint - build # vim: tabstop=2 diff --git a/vim/bundle/LanguageClient-neovim/CHANGELOG.md b/vim/bundle/LanguageClient-neovim/CHANGELOG.md index d6ce502..cef15a5 100644 --- a/vim/bundle/LanguageClient-neovim/CHANGELOG.md +++ b/vim/bundle/LanguageClient-neovim/CHANGELOG.md @@ -4,6 +4,26 @@ 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/). +## [0.1.160] + +### Fixed +- Fix issue with Sorbet sending an extra field on the messages it sends (#1115) + +## [0.1.159] + +### Added +- Add support for disabling/enabling server-specific extensions (#1072) +- Add support for custom codelens highlight group (#1100) +- Add support for clangd's textDocument/switchSourceHeader (#1109) +- Add configuration for hover window margin size (#1111) +- Add support to skip setting buffer omnifunc (#1079). +- Add support of setting languageclient binary path (#1020). +- Support file watching scenario of writing via rename (#1054). + +### Fixed +- Bump lsp-types to 0.83 to fix issue with workspaceSymbolProvider definition (#1114) +- Fix rust-analyzer test codelens action (#1104) + ## [0.1.158] ### Added diff --git a/vim/bundle/LanguageClient-neovim/Cargo.lock b/vim/bundle/LanguageClient-neovim/Cargo.lock index a815bc8..94ab47f 100644 --- a/vim/bundle/LanguageClient-neovim/Cargo.lock +++ b/vim/bundle/LanguageClient-neovim/Cargo.lock @@ -1,1234 +1,1137 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "adler32" -version = "1.0.3" +name = "adler" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" [[package]] name = "aho-corasick" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "ansi_term" -version = "0.11.0" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" dependencies = [ - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr", ] -[[package]] -name = "antidote" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "anyhow" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b" [[package]] name = "arc-swap" -version = "0.3.11" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" [[package]] name = "arrayref" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "atty" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" [[package]] name = "autocfg" -version = "0.1.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" [[package]] name = "base64" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" [[package]] name = "base64" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "bitflags" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "blake2b_simd" version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" dependencies = [ - "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayref", + "arrayvec", + "constant_time_eq", ] -[[package]] -name = "cc" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "cfg-if" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "chrono" -version = "0.4.7" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" dependencies = [ - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer", + "num-traits", + "time", ] [[package]] name = "clap" -version = "2.33.0" +version = "2.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" +dependencies = [ + "bitflags", + "textwrap", + "unicode-width", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" dependencies = [ - "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", ] [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "crc32fast" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", ] [[package]] name = "crossbeam" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", ] [[package]] name = "crossbeam-channel" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ee0cc8804d5393478d743b035099520087a5186f3b93fa58cec08fa62407b6" dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" dependencies = [ - "crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-epoch", + "crossbeam-utils", + "maybe-uninit", ] [[package]] name = "crossbeam-epoch" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "cfg-if", + "crossbeam-utils", + "lazy_static", + "maybe-uninit", + "memoffset", + "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "crossbeam-utils", + "maybe-uninit", ] [[package]] name = "crossbeam-utils" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "cfg-if", + "lazy_static", ] [[package]] name = "derivative" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "diff" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" [[package]] name = "dirs" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "dirs-sys 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "dirs-sys", ] [[package]] name = "dirs-sys" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "redox_users", + "winapi 0.3.9", ] [[package]] name = "dtoa" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" [[package]] name = "either" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" [[package]] name = "filetime" -version = "0.2.5" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "affc17579b132fc2461adf7c575cc6e8b134ebca52c51f5411388965227dc695" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.9", ] [[package]] name = "flate2" -version = "1.0.11" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68c90b0fc46cf89d227cc78b40e494ff81287a92dd07631e5af0d06fe3cf885e" dependencies = [ - "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "crc32fast", + "libc", + "miniz_oxide", ] [[package]] name = "fnv" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fsevent" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fsevent-sys 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "fsevent-sys", ] [[package]] name = "fsevent-sys" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" dependencies = [ - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "fuchsia-zircon" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "fuchsia-zircon-sys", ] [[package]] name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" [[package]] name = "getrandom" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "wasi", ] [[package]] name = "glob" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "heck" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "humantime" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" dependencies = [ - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error", ] [[package]] name = "idna" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", + "unicode-bidi", + "unicode-normalization", ] [[package]] name = "inotify" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "inotify-sys", + "libc", ] [[package]] name = "inotify-sys" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" dependencies = [ - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "iovec" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" dependencies = [ - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "itertools" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" dependencies = [ - "either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "either", ] [[package]] name = "itoa" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" [[package]] name = "json-patch" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f995a3c8f2bc3dd52a18a583e90f9ec109c047fa1603a853e46bcda14d2e279d" dependencies = [ - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", - "treediff 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_json", + "treediff", ] [[package]] name = "jsonrpc-core" -version = "12.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0745a6379e3edc893c84ec203589790774e4247420033e71a76d3ab4687991fa" dependencies = [ - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", + "log", + "serde", + "serde_derive", + "serde_json", ] [[package]] name = "kernel32-sys" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8", + "winapi-build", ] [[package]] name = "languageclient" -version = "0.1.158" -dependencies = [ - "anyhow 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "derivative 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "json-patch 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-core 12.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "log4rs 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lsp-types 0.74.2 (registry+https://github.com/rust-lang/crates.io-index)", - "maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "notify 4.0.12 (registry+https://github.com/rust-lang/crates.io-index)", - "pathdiff 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", - "shellexpand 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +version = "0.1.160" +dependencies = [ + "anyhow", + "clap", + "crossbeam", + "derivative", + "diff", + "glob", + "itertools", + "json-patch", + "jsonrpc-core", + "lazy_static", + "log", + "log4rs", + "lsp-types", + "maplit", + "notify", + "pathdiff", + "regex", + "serde", + "serde_derive", + "serde_json", + "shellexpand", + "thiserror", + "url", ] [[package]] name = "lazy_static" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" [[package]] name = "libc" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7d4bd64732af4bf3a67f367c27df8520ad7e230c5817b8ff485864d80242b9" [[package]] name = "linked-hash-map" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" + +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] [[package]] name = "log" -version = "0.4.8" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "serde", ] [[package]] name = "log-mdc" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7" [[package]] name = "log4rs" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "arc-swap 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "log-mdc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde-value 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", - "thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4d8e6e1d5f89acca713132acc6034f30bad09b961d1338161bdb71c08f6e4fa" +dependencies = [ + "arc-swap", + "chrono", + "flate2", + "fnv", + "humantime", + "libc", + "log", + "log-mdc", + "parking_lot", + "serde", + "serde-value", + "serde_derive", + "serde_json", + "serde_yaml", + "thread-id", + "typemap", + "winapi 0.3.9", ] [[package]] name = "lsp-types" -version = "0.74.2" +version = "0.83.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e0bd4b95038f2c23bda332ba0ca684e8dda765db1f9bdb63dc4c3e01f3b456" dependencies = [ - "base64 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_repr 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.12.3", + "bitflags", + "serde", + "serde_json", + "serde_repr", + "url", ] [[package]] name = "maplit" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "matches" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] -name = "memchr" -version = "2.2.1" +name = "maybe-uninit" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] -name = "memoffset" -version = "0.5.3" +name = "memchr" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" [[package]] -name = "miniz-sys" -version = "0.1.12" +name = "memoffset" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f" dependencies = [ - "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", ] [[package]] name = "miniz_oxide" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" dependencies = [ - "adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "adler", ] [[package]] name = "mio" -version = "0.6.19" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", ] [[package]] name = "mio-extras" -version = "2.0.5" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" dependencies = [ - "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazycell", + "log", + "mio", + "slab", ] [[package]] name = "miow" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", ] [[package]] name = "net2" -version = "0.2.33" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "winapi 0.3.9", ] [[package]] name = "notify" -version = "4.0.12" +version = "4.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "filetime 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "fsevent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fsevent-sys 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "inotify 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "filetime", + "fsevent", + "fsevent-sys", + "inotify", + "libc", + "mio", + "mio-extras", + "walkdir", + "winapi 0.3.9", ] [[package]] name = "num-integer" -version = "0.1.41" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", + "num-traits", ] [[package]] name = "num-traits" -version = "0.2.8" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", ] [[package]] name = "ordered-float" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579" dependencies = [ - "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits", ] [[package]] -name = "pathdiff" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "percent-encoding" -version = "2.1.0" +name = "parking_lot" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +dependencies = [ + "lock_api", + "parking_lot_core", +] [[package]] -name = "proc-macro2" -version = "0.4.30" +name = "parking_lot_core" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "cloudabi", + "libc", + "redox_syscall", + "smallvec", + "winapi 0.3.9", ] [[package]] -name = "proc-macro2" -version = "1.0.1" +name = "pathdiff" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "877630b3de15c0b64cc52f659345724fbf6bdad9bd9566699fc53688f3c34a34" [[package]] -name = "quick-error" -version = "1.2.2" +name = "percent-encoding" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] -name = "quote" -version = "0.6.13" +name = "proc-macro2" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" -version = "1.0.2" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_users" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" dependencies = [ - "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", + "redox_syscall", + "rust-argon2", ] [[package]] name = "regex" -version = "1.2.1" +version = "1.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" dependencies = [ - "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", ] [[package]] name = "regex-syntax" -version = "0.6.11" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" [[package]] name = "rust-argon2" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" dependencies = [ - "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.11.0", + "blake2b_simd", + "constant_time_eq", + "crossbeam-utils", ] [[package]] name = "ryu" -version = "1.0.0" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] name = "same-file" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util", ] [[package]] name = "scopeguard" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.99" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" dependencies = [ - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive", ] [[package]] name = "serde-value" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a65a7291a8a568adcae4c10a677ebcedbc6c9cec91c054dee2ce40b0e3290eb" dependencies = [ - "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "ordered-float", + "serde", ] [[package]] name = "serde_derive" -version = "1.0.99" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "serde_json" -version = "1.0.40" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3433e879a558dde8b5e8feb2a04899cf34fdde1fafb894687e52105fc1162ac3" dependencies = [ - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa", + "ryu", + "serde", ] [[package]] name = "serde_repr" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc6b7951b17b051f3210b063f12cc17320e2fe30ae05b0fe2a3abb068551c76" dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "serde_yaml" -version = "0.8.9" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3e2dd40a7cdc18ca80db804b7f461a39bb721160a85c9a1fa30134bf3c02a5" dependencies = [ - "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "dtoa", + "linked-hash-map", + "serde", + "yaml-rust", ] [[package]] name = "shellexpand" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2b22262a9aaf9464d356f656fea420634f78c881c5eebd5ef5e66d8b9bc603" dependencies = [ - "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "dirs", ] [[package]] name = "slab" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "structopt" -version = "0.2.18" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "structopt-derive" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f" [[package]] name = "syn" -version = "1.0.11" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb7f4c519df8c117855e19dd8cc851e89eb746fe7a73f0157e0d95fdec5369b0" dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width", ] [[package]] name = "thiserror" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" dependencies = [ - "thiserror-impl 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "thread-id" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" dependencies = [ - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "redox_syscall", + "winapi 0.3.9", ] [[package]] name = "thread_local" -version = "0.3.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" dependencies = [ - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", ] [[package]] name = "time" -version = "0.1.42" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ - "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", + "winapi 0.3.9", ] +[[package]] +name = "tinyvec" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" + [[package]] name = "traitobject" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" [[package]] name = "treediff" version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "761e8d5ad7ce14bb82b7e61ccc0ca961005a275a060b9644a2431aa11553c2ff" dependencies = [ - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json", ] [[package]] name = "typemap" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" dependencies = [ - "unsafe-any 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unsafe-any", ] [[package]] name = "unicode-bidi" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.8" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" dependencies = [ - "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicode-width" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicode-xid" -version = "0.1.0" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" [[package]] name = "unicode-xid" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "unsafe-any" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" dependencies = [ - "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "traitobject", ] [[package]] name = "url" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" dependencies = [ - "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "idna", + "matches", + "percent-encoding", + "serde", ] -[[package]] -name = "vec_map" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "walkdir" -version = "2.2.9" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ - "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "same-file", + "winapi 0.3.9", + "winapi-util", ] [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "winapi" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9", ] [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "ws2_32-sys" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8", + "winapi-build", ] [[package]] name = "yaml-rust" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39f0c922f1a334134dc2f7a8b67dc5d25f0735263feec974345ff706bcf20b0d" dependencies = [ - "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[metadata] -"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c" -"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" -"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -"checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" -"checksum anyhow 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb70cc08ec97ca5450e6eba421deeea5f172c0fc61f78b5357b2a8e8be195f" -"checksum arc-swap 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "bc4662175ead9cd84451d5c35070517777949a2ed84551764129cedb88384841" -"checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" -"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" -"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" -"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" -"checksum base64 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42" -"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" -"checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" -"checksum cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "b548a4ee81fccb95919d4e22cfea83c7693ebfd78f0495493178db20b3139da7" -"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" -"checksum chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "77d81f58b7301084de3b958691458a53c3f7e0b1d702f77e550b6a88e3a88abe" -"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" -"checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -"checksum crossbeam 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" -"checksum crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c" -"checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" -"checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" -"checksum crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfd6515864a82d2f877b42813d4553292c6659498c9a2aa31bab5a15243c2700" -"checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" -"checksum derivative 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" -"checksum diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3c2b69f912779fbb121ceb775d74d51e915af17aaebc38d28a592843a2dd0a3a" -"checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" -"checksum dirs-sys 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" -"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" -"checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b" -"checksum filetime 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2f8c63033fcba1f51ef744505b3cad42510432b904c062afa67ad7ece008429d" -"checksum flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "2adaffba6388640136149e18ed080b77a78611c1e1d6de75aedcdf78df5d4682" -"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" -"checksum fsevent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" -"checksum fsevent-sys 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" -"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869" -"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" -"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" -"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" -"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" -"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" -"checksum inotify 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40b54539f3910d6f84fbf9a643efd6e3aa6e4f001426c0329576128255994718" -"checksum inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" -"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" -"checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358" -"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" -"checksum json-patch 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f995a3c8f2bc3dd52a18a583e90f9ec109c047fa1603a853e46bcda14d2e279d" -"checksum jsonrpc-core 12.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "288dca7f9713710a29e485076b9340156cb701edb46a881f5d0c31aa4f5b9143" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" -"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" -"checksum libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)" = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" -"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" -"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -"checksum log-mdc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7" -"checksum log4rs 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "100052474df98158c0738a7d3f4249c99978490178b5f9f68cd835ac57adbd1b" -"checksum lsp-types 0.74.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b360754e89e0e13c114245131382ba921d4ff1efabb918e549422938aaa8d392" -"checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" -"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" -"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" -"checksum miniz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9e3ae51cea1576ceba0dde3d484d30e6e5b86dee0b2d412fe3a16a15c98202" -"checksum miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7108aff85b876d06f22503dcce091e29f76733b2bfdd91eebce81f5e68203a10" -"checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" -"checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" -"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" -"checksum notify 4.0.12 (registry+https://github.com/rust-lang/crates.io-index)" = "3572d71f13ea8ed41867accd971fd564aa75934cf7a1fae03ddb8c74a8a49943" -"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" -"checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" -"checksum ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" -"checksum pathdiff 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a3bf70094d203e07844da868b634207e71bfab254fe713171fae9a6e751ccf31" -"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -"checksum proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c5c2380ae88876faae57698be9e9775e3544decad214599c3a6266cca6ac802" -"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" -"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" -"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" -"checksum regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88c3d9193984285d544df4a30c23a4e62ead42edf70a4452ceb76dac1ce05c26" -"checksum regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b143cceb2ca5e56d5671988ef8b15615733e7ee16cd348e064333b251b89343f" -"checksum rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" -"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" -"checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" -"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f" -"checksum serde-value 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7a663f873dedc4eac1a559d4c6bc0d0b2c34dc5ac4702e105014b8281489e44f" -"checksum serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "cb4dc18c61206b08dc98216c98faa0232f4337e1e1b8574551d5bad29ea1b425" -"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" -"checksum serde_repr 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "cd02c7587ec314570041b2754829f84d873ced14a96d1fd1823531e11db40573" -"checksum serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "38b08a9a90e5260fe01c6480ec7c811606df6d3a660415808c3c3fa8ed95b582" -"checksum shellexpand 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2b22262a9aaf9464d356f656fea420634f78c881c5eebd5ef5e66d8b9bc603" -"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" -"checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" -"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -"checksum structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "16c2cdbf9cc375f15d1b4141bc48aeef444806655cd0e904207edc8d68d86ed7" -"checksum structopt-derive 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "53010261a84b37689f9ed7d395165029f9cc7abb9f56bbfe86bee2597ed25107" -"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -"checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" -"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum thiserror 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "b13f926965ad00595dd129fa12823b04bbf866e9085ab0a5f2b05b850fbfc344" -"checksum thiserror-impl 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "893582086c2f98cde18f906265a65b5030a074b1046c674ae898be6519a7f479" -"checksum thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" -"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" -"checksum treediff 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "761e8d5ad7ce14bb82b7e61ccc0ca961005a275a060b9644a2431aa11553c2ff" -"checksum typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" -"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" -"checksum unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1967f4cdfc355b37fd76d2a954fb2ed3871034eb4f26d60537d88795cfc332a9" -"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" -"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" -"checksum unsafe-any 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" -"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" -"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" -"checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" -"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -"checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" + "linked-hash-map", +] diff --git a/vim/bundle/LanguageClient-neovim/Cargo.toml b/vim/bundle/LanguageClient-neovim/Cargo.toml index b649c89..25d4a82 100644 --- a/vim/bundle/LanguageClient-neovim/Cargo.toml +++ b/vim/bundle/LanguageClient-neovim/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "languageclient" -version = "0.1.158" +version = "0.1.160" authors = ["Junfeng Li "] description = "Language Server Protocol (LSP) support for vim and neovim" publish = false @@ -17,18 +17,18 @@ pre-release-hook = ["cargo", "build"] tag-name = "{{version}}" [dependencies] -itertools = "0.8" +itertools = "0.9" log = "0.4" log4rs = "0" -structopt = "0" +clap = { version = "2", default-features = false } maplit = "1" serde = "1" serde_derive = "1" serde_json = "1" json-patch = "0.2" crossbeam = "0.7.3" -jsonrpc-core = "12" -lsp-types = { version = "0.74.2", features = ["proposed"] } +jsonrpc-core = "15" +lsp-types = { version = "0.83", features = ["proposed"] } url = "2" pathdiff = "0" diff = "0" @@ -37,5 +37,6 @@ glob = "0" notify = "4" shellexpand = "2.0.0" derivative = "2.1.1" -anyhow = "1.0.31" -thiserror = "1.0.19" +anyhow = "1.0.32" +thiserror = "1.0.20" +lazy_static = "1.4.0" diff --git a/vim/bundle/LanguageClient-neovim/Makefile b/vim/bundle/LanguageClient-neovim/Makefile index 08a57c2..b9ba39d 100644 --- a/vim/bundle/LanguageClient-neovim/Makefile +++ b/vim/bundle/LanguageClient-neovim/Makefile @@ -2,11 +2,12 @@ all: release dev: build fmt clippy vint -ci: vint python-lint test integration-test - cargo fmt -- --check +ci: vim-lint python-lint check-fmt-and-clippy test integration-test -check: +check-fmt-and-clippy: cargo check + cargo fmt -- --check + cargo clippy -- --deny warnings build: cargo build @@ -17,7 +18,7 @@ fmt: clippy: cargo clippy -vint: +vim-lint: vint autoload plugin release: @@ -60,7 +61,7 @@ clean: cargo clean rm -rf bin/languageclient -DATE := $(shell date +%F) +DATE := $(shell date --utc +%F) build-docker-image: ci/Dockerfile docker build \ diff --git a/vim/bundle/LanguageClient-neovim/TODO.md b/vim/bundle/LanguageClient-neovim/TODO.md index c4b34a1..a0214ca 100644 --- a/vim/bundle/LanguageClient-neovim/TODO.md +++ b/vim/bundle/LanguageClient-neovim/TODO.md @@ -1,3 +1,4 @@ +- Better support for one-off usages, i.e., scripts without proper project setup. - Structured, independent, reproducible tests. - More integration tests. - Check server capabilities before calling RPC API. diff --git a/vim/bundle/LanguageClient-neovim/autoload/LanguageClient.vim b/vim/bundle/LanguageClient-neovim/autoload/LanguageClient.vim index 7b566e5..e13ed24 100644 --- a/vim/bundle/LanguageClient-neovim/autoload/LanguageClient.vim +++ b/vim/bundle/LanguageClient-neovim/autoload/LanguageClient.vim @@ -392,14 +392,14 @@ function! s:OpenHoverPreview(bufname, lines, filetype) abort call s:CloseFloatingHover() let pos = getpos('.') - + let l:hoverMarginSize = s:GetVar('LanguageClient_hoverMarginSize', 1) " Calculate width and height and give margin to lines let width = 0 for index in range(len(lines)) let line = lines[index] if line !=# '' " Give a left margin - let line = ' ' . line + let line = repeat(' ', l:hoverMarginSize) . line endif let lw = strdisplaywidth(line) if lw > width @@ -409,8 +409,9 @@ function! s:OpenHoverPreview(bufname, lines, filetype) abort endfor " Give margin - let width += 1 - let lines = [''] + lines + [''] + let width += l:hoverMarginSize + let l:topBottom = repeat([''], l:hoverMarginSize) + let lines = l:topBottom + lines + l:topBottom let height = len(lines) " Calculate anchor @@ -641,6 +642,11 @@ endfunction let s:root = expand(':p:h:h') function! LanguageClient#binaryPath() abort + let l:path = s:GetVar('LanguageClient_binaryPath') + if l:path isnot v:null + return l:path + endif + let l:filename = 'languageclient' if has('win32') let l:filename .= '.exe' @@ -803,6 +809,15 @@ function! LanguageClient#findLocations(...) abort return LanguageClient#Call('languageClient/findLocations', l:params, l:Callback) endfunction +function! LanguageClient#textDocument_switchSourceHeader(...) abort + let l:Callback = get(a:000, 1, v:null) + let l:params = { + \ 'filename': LSP#filename(), + \ } + call extend(l:params, get(a:000, 0, {})) + return LanguageClient#Call('textDocument/switchSourceHeader', l:params, l:Callback) +endfunction + function! LanguageClient#textDocument_definition(...) abort let l:params = { \ 'method': 'textDocument/definition', @@ -1050,6 +1065,22 @@ function! LanguageClient#setLoggingLevel(level) abort return LanguageClient#Call('languageClient/setLoggingLevel', l:params, v:null) endfunction +function! LanguageClient#diagnosticsPrevious() abort + let l:params = { + \ 'filename': LSP#filename(), + \ 'position': LSP#position(), + \ } + return LanguageClient#Notify('languageClient/diagnosticsPrevious', l:params) +endfunction + +function! LanguageClient#diagnosticsNext() abort + let l:params = { + \ 'filename': LSP#filename(), + \ 'position': LSP#position(), + \ } + return LanguageClient#Notify('languageClient/diagnosticsNext', l:params) +endfunction + function! LanguageClient#setDiagnosticsList(diagnosticsList) abort let l:params = { \ 'diagnosticsList': a:diagnosticsList, diff --git a/vim/bundle/LanguageClient-neovim/build.rs b/vim/bundle/LanguageClient-neovim/build.rs deleted file mode 100644 index 6c0de07..0000000 --- a/vim/bundle/LanguageClient-neovim/build.rs +++ /dev/null @@ -1,9 +0,0 @@ -use std::fs::read_to_string; - -fn main() { - let git_hash = option_env!("TRAVIS_COMMIT") - .map(|s| s.into()) - .unwrap_or_else(|| read_to_string(".git/refs/heads/next").unwrap_or_default()); - - println!("cargo:rustc-env=GIT_HASH={}", git_hash); -} diff --git a/vim/bundle/LanguageClient-neovim/ci/Dockerfile b/vim/bundle/LanguageClient-neovim/ci/Dockerfile index e10f631..0df6a32 100644 --- a/vim/bundle/LanguageClient-neovim/ci/Dockerfile +++ b/vim/bundle/LanguageClient-neovim/ci/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.41-slim +FROM rust:1.46-slim RUN apt-get update \ && apt-get install --yes --no-install-recommends neovim curl git python3-pip python3-pytest mypy flake8 npm make \ @@ -7,11 +7,7 @@ RUN apt-get update \ RUN python3 -m pip install neovim vim-vint -RUN npm install -g javascript-typescript-langserver@2.5.5 - -RUN rustup component add rustfmt rls rust-analysis rust-src \ - && rustc --version \ - && rls --version +RUN rustup component add rustfmt clippy && rustup show RUN curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-linux -o /usr/local/bin/rust-analyzer \ && chmod +x /usr/local/bin/rust-analyzer diff --git a/vim/bundle/LanguageClient-neovim/doc/LanguageClient.txt b/vim/bundle/LanguageClient-neovim/doc/LanguageClient.txt index 9188920..91457d9 100644 --- a/vim/bundle/LanguageClient-neovim/doc/LanguageClient.txt +++ b/vim/bundle/LanguageClient-neovim/doc/LanguageClient.txt @@ -36,14 +36,20 @@ like to map these functions to shortcuts, for example: > nnoremap gd :call LanguageClient#textDocument_definition() nnoremap :call LanguageClient#textDocument_rename() +You can also use slightly cleaner Plug mappings instead of the full function name: > + + nmap K (lcn-hover) + nmap gd (lcn-definition) + nmap (lcn-rename) + You can apply these mappings only for buffers with supported filetypes with a simple function: > function LC_maps() if has_key(g:LanguageClient_serverCommands, &filetype) - nnoremap K :call LanguageClient#textDocument_hover() - nnoremap gd :call LanguageClient#textDocument_definition() - nnoremap :call LanguageClient#textDocument_rename() + nmap K (lcn-hover) + nmap gd (lcn-definition) + nmap (lcn-rename) endif endfunction @@ -375,7 +381,7 @@ When the value is set to 1, |LanguageClient#textDocument_hover()| opens documentation in a floating window instead of preview. This variable is effective only when the floating window feature is supported. Check by running > - :echomsg exists('nvim_open_win') + :echomsg exists('*nvim_open_win') Default: 1 when a floating window is supported, otherwise 0 Valid Options: 1 | 0 @@ -414,7 +420,14 @@ Maximum severity to show diagnostic messages. Default: "Hint" Valid options: "Error" | "Warning" | "Information" | "Hint" -2.31 g:LanguageClient_echoProjectRoot *g:LanguageClient_echoProjectRoot* +2.31 g:LanguageClient_diagnosticsIgnoreSources *g:LanguageClient_diagnosticsIgnoreSources* + +Does not show the diagnostics message which has the source specified by this +options. + +Default: "[]" + +2.32 g:LanguageClient_echoProjectRoot *g:LanguageClient_echoProjectRoot* Whether to echo messages in vim of the form: "Project root: /home/user/myproject" when the root of a project is detected using g:LanguageClient_rootMarkers. @@ -422,7 +435,7 @@ the root of a project is detected using g:LanguageClient_rootMarkers. Default: 1 to display the messages Valid options: 1 | 0 -2.32 g:LanguageClient_semanticHighlightMaps *g:LanguageClient_semanticHighlightMaps* +2.33 g:LanguageClient_semanticHighlightMaps *g:LanguageClient_semanticHighlightMaps* String to list/map map. Defines the mapping of semantic highlighting "scopes" to highlight groups. This depends on the LSP server supporting the proposed @@ -523,14 +536,14 @@ Example configuration for eclipse.jdt.ls: highlight! JavaMemberVariable ctermfg=White cterm=italic guifg=White gui=italic -2.33 g:LanguageClient_applyCompletionAdditionalTextEdits *g:LanguageClient_applyCompletionAdditionalTextEdits* +2.34 g:LanguageClient_applyCompletionAdditionalTextEdits *g:LanguageClient_applyCompletionAdditionalTextEdits* Indicates whether completionItem additional text edits should be applied. Default: 1 Valid options: 1 | 0 -2.34 g:LanguageClient_preferredMarkupKind *g:LanguageClient_preferredMarkupKind* +2.35 g:LanguageClient_preferredMarkupKind *g:LanguageClient_preferredMarkupKind* Sets the preferred markup kind. This value is sent to the server and is normally used to decide whether to send plaintext or markdown in things like @@ -556,26 +569,94 @@ Example setting 3. Set the preferred markup kind to `markdown` ``` let g:LanguageClient_preferredMarkupKind: ['markdown'] + ``` -This setting may have no effect of the server decides not to honour it. +This setting may have no effect if the server decides not to honour it. Default: v:null Valid options: Array -2.35 g:LanguageClient_floatingWindowStyle *g:LanguageClient_floatingWindowStyle* +2.36 g:LanguageClient_floatingWindowStyle *g:LanguageClient_floatingWindowStyle* Style of opened Neovim floating window. Default: 'minimal' Valid options: 'minimal' -2.36 g:LanguageClient_hideVirtualTextsOnInsert *g:LanguageClient_hideVirtualTextsOnInsert* +2.37 g:LanguageClient_hideVirtualTextsOnInsert *g:LanguageClient_hideVirtualTextsOnInsert* Hides all virtual texts for the current buffer while editing in insert mode. Default: 0 Valid options: 1 | 0 +2.38 g:LanguageClient_setOmnifunc *g:LanguageClient_setOmnifunc* + +Whether set buffer omnifunc to 'LanguageClient#complete'. + +Default: v:true +Valid options: v:true | v:false + +2.39 g:LanguageClient_binaryPath *g:LanguageClient_binaryPath* + +Full path to languageclient binary. + +Default: 'bin/languageclient' relative to plugin root. +Valid options: String + +2.40 g:LanguageClient_enableExtensions *g:LanguageClient_enableExtensions* + +LanguageClient-neovim provides extensions for some language servers, such as gopls or rust-analyzer. +These extensions can be turned on or off, and they are configurable per language (not per language +server). + +An example of the extensions provided is running Rust or Go tests in a vim terminal. This takes +advantage of the commands provided by rust-analyzer or gopls (respectively) and executes those +commands in a vim terminal. + +Example config: + ``` + let g:LanguageClient_enableExtensions = { + \ 'go': v:false, + \ 'rust': v:true, + \ } + ``` +In this example we explicitly disable extensions for the filetype `go`, and enable them for `rust`. +Filetypes not included in this config will also have their extensions disabled, unless you +explicitly enable them like we did for `rust`. + +The default value for this config, or the absence of this config, enables extensions for all filetypes. + +Default: v:null + +2.41 g:LanguageClient_codeLensHighlightGroup *g:LanguageClient_codeLensHighlightGroup* + +Highlight group to be used for code lens. + +Default: 'Comment' + +2.42 g:LanguageClient_hoverMarginSize *g:LanguageClient_hoverMarginSize* + +When using floating windows to open hover previews (for more information see +|g:LanguageClient_useFloatingHover|), this setting controls whether and how +big of a margin to draw around the contents of the hover. + +Having some margin looks nice, so the default is 1. + +Floating windows don't have a true way to set padding/margin on them, so the +strategy used is to add one line above and below the language server's raw +hover response, and one space character before the start of every non-empty +line in the hover response. + +Having a space in front of the hover content can cause some syntax +highlighters to mess up (because e.g., they have a regex expecting a syntax +construct to be anchored to the start of a line). To turn off adding this +margin, set this setting to 0. Example: +> + let g:LanguageClient_hoverMarginSize = 0 +< +Default: 1 + ============================================================================== 3. Commands *LanguageClientCommands* @@ -905,6 +986,21 @@ Signature: LanguageClient#debugInfo(...) Print out debug info. +*LanguageClient#diagnosticsNext* +Signature: LanguageClient#diagnosticsNext() + +Moves the cursor to the next diagnostic in the buffer, relative to the current cursor position. + +*LanguageClient#diagnosticsPrevious* +Signature: LanguageClient#diagnosticsPrevious() + +Moves the cursor to the previous diagnostic in the buffer, relative to the current cursor position. + +*LanguageClient#textDocument_switchSourceHeader* +Signature: LanguageClient#textDocument_switchSourceHeader(...) + +Calls clangd's `textDocument/switchSourceHeader` extension request. + ============================================================================== 5. Mappings *LanguageClientMappings* @@ -959,6 +1055,12 @@ Calls LanguageClient_textDocument_formatting. *(lcn-format-sync)* Calls LanguageClient_textDocument_formatting_sync. +*(lcn-diagnostics-next)* +Calls LanguageClient_diagnosticsNext. + +*(lcn-diagnostics-prev)* +Calls LanguageClient_diagnosticsPrevious. + ============================================================================== 6. Events *LanguageClientEvents* diff --git a/vim/bundle/LanguageClient-neovim/install.ps1 b/vim/bundle/LanguageClient-neovim/install.ps1 index f3a8cd9..1728b2b 100755 --- a/vim/bundle/LanguageClient-neovim/install.ps1 +++ b/vim/bundle/LanguageClient-neovim/install.ps1 @@ -1,6 +1,6 @@ #!/usr/bin/env pwsh -$version = '0.1.158' +$version = '0.1.160' $name = 'languageclient' $url = "https://github.com/autozimu/LanguageClient-neovim/releases/download/$version/$name-$version-" diff --git a/vim/bundle/LanguageClient-neovim/install.sh b/vim/bundle/LanguageClient-neovim/install.sh index e201373..7eada7e 100755 --- a/vim/bundle/LanguageClient-neovim/install.sh +++ b/vim/bundle/LanguageClient-neovim/install.sh @@ -6,7 +6,7 @@ set -o nounset # error when referencing undefined variable set -o errexit # exit when command fails -version=0.1.158 +version=0.1.160 name=languageclient arch=$(uname -sm) @@ -22,7 +22,7 @@ try_wget() { } download() { - echo "Tring download bin/${name} ${version}..." + echo "Trying download bin/${name} ${version}..." url=https://github.com/autozimu/LanguageClient-neovim/releases/download/$version/${1} if (try_curl "$url" || try_wget "$url"); then chmod a+x bin/$name diff --git a/vim/bundle/LanguageClient-neovim/plugin/LanguageClient.vim b/vim/bundle/LanguageClient-neovim/plugin/LanguageClient.vim index ef31a25..9095f6c 100644 --- a/vim/bundle/LanguageClient-neovim/plugin/LanguageClient.vim +++ b/vim/bundle/LanguageClient-neovim/plugin/LanguageClient.vim @@ -50,6 +50,10 @@ function! LanguageClient_textDocument_formatting(...) return call('LanguageClient#textDocument_formatting', a:000) endfunction +function! LanguageClient_textDocument_formatting_sync(...) + return call('LanguageClient#textDocument_formatting_sync', a:000) +endfunction + function! LanguageClient_textDocument_rangeFormatting(...) return call('LanguageClient#textDocument_rangeFormatting', a:000) endfunction @@ -106,6 +110,14 @@ function! LanguageClient_statusLine(...) return call('LanguageClient#statusLine', a:000) endfunction +function! LanguageClient_diagnosticsPrevious(...) + return call('LanguageClient#diagnosticsPrevious', a:000) +endfunction + +function! LanguageClient_diagnosticsNext(...) + return call('LanguageClient#diagnosticsNext', a:000) +endfunction + function! LanguageClient_statusLineDiagnosticsCounts(...) return call('LanguageClient#statusLineDiagnosticsCounts', a:000) endfunction @@ -134,6 +146,10 @@ function! LanguageClient_explainErrorAtPoint(...) return call('LanguageClient#explainErrorAtPoint', a:000) endfunction +function! LanguageClient_textDocument_switchSourceHeader(...) + return call('LanguageClient#textDocument_switchSourceHeader', a:000) +endfunction + command! -nargs=* LanguageClientStart :call LanguageClient#startServer() command! LanguageClientStop :call LanguageClient#exit() @@ -174,4 +190,6 @@ augroup languageClient nnoremap (lcn-explain-error) :call LanguageClient_explainErrorAtPoint() nnoremap (lcn-format) :call LanguageClient_textDocument_formatting() nnoremap (lcn-format-sync) :call LanguageClient_textDocument_formatting_sync() + nnoremap (lcn-diagnostics-next) :call LanguageClient_diagnosticsNext() + nnoremap (lcn-diagnostics-prev) :call LanguageClient_diagnosticsPrevious() augroup END diff --git a/vim/bundle/LanguageClient-neovim/rust-toolchain b/vim/bundle/LanguageClient-neovim/rust-toolchain new file mode 100644 index 0000000..0a3db35 --- /dev/null +++ b/vim/bundle/LanguageClient-neovim/rust-toolchain @@ -0,0 +1 @@ +1.46.0 diff --git a/vim/bundle/LanguageClient-neovim/shell.nix b/vim/bundle/LanguageClient-neovim/shell.nix index bbda153..23da20c 100644 --- a/vim/bundle/LanguageClient-neovim/shell.nix +++ b/vim/bundle/LanguageClient-neovim/shell.nix @@ -9,9 +9,10 @@ pkgs.mkShell { git mypy neovim - cargo - rust-analyzer + rustup + rust-analyzer # For integration tests. tmux + vim # For manual tests. vim-vint (with python37Packages; [ flake8 diff --git a/vim/bundle/LanguageClient-neovim/src/extensions/clangd.rs b/vim/bundle/LanguageClient-neovim/src/extensions/clangd.rs new file mode 100644 index 0000000..368c930 --- /dev/null +++ b/vim/bundle/LanguageClient-neovim/src/extensions/clangd.rs @@ -0,0 +1,35 @@ +use crate::{language_client::LanguageClient, utils::ToUrl}; +use anyhow::Result; +use jsonrpc_core::Value; +use lsp_types::{request::Request, TextDocumentIdentifier}; + +pub mod request { + use lsp_types::{request::Request, TextDocumentIdentifier}; + + pub enum SwitchSourceHeader {} + + impl Request for SwitchSourceHeader { + type Params = TextDocumentIdentifier; + type Result = String; + const METHOD: &'static str = "textDocument/switchSourceHeader"; + } +} + +impl LanguageClient { + pub fn text_document_switch_source_header(&self, params: &Value) -> Result { + let filename = self.vim()?.get_filename(params)?; + let language_id = self.vim()?.get_language_id(&filename, &Value::Null)?; + let params = TextDocumentIdentifier { + uri: filename.to_url()?, + }; + + let response: String = self + .get_client(&Some(language_id))? + .call(request::SwitchSourceHeader::METHOD, params)?; + + let path = std::path::Path::new(&response); + self.vim()?.edit(&None, path)?; + + Ok(Value::Null) + } +} diff --git a/vim/bundle/LanguageClient-neovim/src/extensions/gopls.rs b/vim/bundle/LanguageClient-neovim/src/extensions/gopls.rs new file mode 100644 index 0000000..b2b8a91 --- /dev/null +++ b/vim/bundle/LanguageClient-neovim/src/extensions/gopls.rs @@ -0,0 +1,89 @@ +use crate::language_client::LanguageClient; +use anyhow::Result; +use lsp_types::Command; +use serde::Deserialize; +use serde_json::Value; + +pub mod command { + pub const TEST: &str = "test"; + pub const GENERATE: &str = "generate"; +} + +impl LanguageClient { + pub fn handle_gopls_command(&self, cmd: &Command) -> Result { + match cmd.command.as_str() { + command::TEST => { + if let Some(args) = &cmd.arguments { + if let Some(file) = args.get(0) { + let file = String::deserialize(file)?; + let path = parse_package_path(file.as_str()).unwrap_or("./...".into()); + let run = >>::deserialize( + args.get(1).unwrap_or(&Value::Null), + )?; + + let bench = >>::deserialize( + args.get(2).unwrap_or(&Value::Null), + )?; + + let run = run.unwrap_or_default(); + let bench = bench.unwrap_or_default(); + + if run.len() > 0 { + let cmd = format!("term go test -run '{}' {}", run.join("|"), path); + self.vim()?.command(cmd)?; + } else if bench.len() > 0 { + let cmd = format!("term go test -bench '{}' {}", bench.join("|"), path); + self.vim()?.command(cmd)?; + } else { + self.vim()?.echoerr("No tests to run")?; + } + } + } + } + command::GENERATE => { + if let Some(arguments) = &cmd.arguments { + if let Some(package) = arguments.get(0) { + let package = String::deserialize(package)?; + let recursive = + bool::deserialize(arguments.get(1).unwrap_or(&Value::Bool(false)))?; + let cmd = match (package, recursive) { + (package, false) => format!("term go generate -x {}", package), + (_, true) => "term go generate -x ./...".into(), + }; + self.vim()?.command(cmd)?; + } + } + } + + _ => return Ok(false), + } + + Ok(true) + } +} + +fn parse_package_path(path: &str) -> Option { + let path = if path.starts_with("file://") { + path.strip_prefix("file://")? + } else { + path + }; + let path = std::path::PathBuf::from(path); + Some(path.parent()?.to_str()?.to_owned()) +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_parse_package_path() { + let folder = parse_package_path("file:///home/dev/someone/project/file.go"); + assert!(folder.is_some()); + assert_eq!("/home/dev/someone/project", folder.unwrap()); + + let folder = parse_package_path("/home/dev/someone/project/file.go"); + assert!(folder.is_some()); + assert_eq!("/home/dev/someone/project", folder.unwrap()); + } +} diff --git a/vim/bundle/LanguageClient-neovim/src/extensions/mod.rs b/vim/bundle/LanguageClient-neovim/src/extensions/mod.rs index 0310ed1..a5a9f98 100644 --- a/vim/bundle/LanguageClient-neovim/src/extensions/mod.rs +++ b/vim/bundle/LanguageClient-neovim/src/extensions/mod.rs @@ -1,2 +1,4 @@ +pub mod clangd; +pub mod gopls; pub mod java; pub mod rust_analyzer; diff --git a/vim/bundle/LanguageClient-neovim/src/extensions/rust_analyzer.rs b/vim/bundle/LanguageClient-neovim/src/extensions/rust_analyzer.rs index 4062940..fde8857 100644 --- a/vim/bundle/LanguageClient-neovim/src/extensions/rust_analyzer.rs +++ b/vim/bundle/LanguageClient-neovim/src/extensions/rust_analyzer.rs @@ -112,9 +112,11 @@ impl LanguageClient { Runnable::Bin(runnable) => { format!("term {} {}", runnable.bin, runnable.args.join(" ")) } - Runnable::Generic(runnable) => { - format!("term cargo {}", runnable.args.cargo_args.join(" ")) - } + Runnable::Generic(runnable) => format!( + "term cargo {} -- {}", + runnable.args.cargo_args.join(" "), + runnable.args.executable_args.join(" "), + ), }; self.vim()?.command(cmd.replace('"', ""))?; diff --git a/vim/bundle/LanguageClient-neovim/src/language_client.rs b/vim/bundle/LanguageClient-neovim/src/language_client.rs index 4146ff3..555c7ec 100644 --- a/vim/bundle/LanguageClient-neovim/src/language_client.rs +++ b/vim/bundle/LanguageClient-neovim/src/language_client.rs @@ -36,12 +36,12 @@ impl LanguageClient { // garbage collected as a result of another modification updating the hash map, while something was holding the lock pub fn get_client_update_mutex(&self, language_id: LanguageId) -> Result>> { let map_guard = self.clients_mutex.lock(); - let mut map = map_guard.or_else(|err| { - Err(anyhow!( + let mut map = map_guard.map_err(|err| { + anyhow!( "Failed to lock client creation for languageId {:?}: {:?}", language_id, err, - )) + ) })?; if !map.contains_key(&language_id) { map.insert(language_id.clone(), Arc::new(Mutex::new(()))); diff --git a/vim/bundle/LanguageClient-neovim/src/language_server_protocol.rs b/vim/bundle/LanguageClient-neovim/src/language_server_protocol.rs index 210f5e3..b65868e 100644 --- a/vim/bundle/LanguageClient-neovim/src/language_server_protocol.rs +++ b/vim/bundle/LanguageClient-neovim/src/language_server_protocol.rs @@ -1,4 +1,4 @@ -use crate::extensions::{java, rust_analyzer}; +use crate::extensions::java; use crate::language_client::LanguageClient; use crate::vim::{try_get, Mode}; use crate::{ @@ -10,29 +10,31 @@ use crate::{ vim_cmd_args_to_value, Canonicalize, Combine, ToUrl, }, viewport, + watcher::FSWatch, }; use anyhow::{anyhow, Context, Error, Result}; +use glob::glob; use itertools::Itertools; use jsonrpc_core::Value; use log::{debug, error, info, warn}; -use lsp_types::notification::Notification; use lsp_types::request::Request; +use lsp_types::{notification::Notification, PublishDiagnosticsClientCapabilities}; use lsp_types::{ - code_action_kind, ApplyWorkspaceEditParams, ApplyWorkspaceEditResponse, ClientCapabilities, - ClientInfo, CodeAction, CodeActionCapability, CodeActionContext, CodeActionKindLiteralSupport, - CodeActionLiteralSupport, CodeActionOrCommand, CodeActionParams, CodeActionResponse, CodeLens, - Command, CompletionCapability, CompletionItem, CompletionItemCapability, CompletionResponse, - CompletionTextEdit, Diagnostic, DiagnosticSeverity, DidChangeConfigurationParams, - DidChangeTextDocumentParams, DidChangeWatchedFilesParams, - DidChangeWatchedFilesRegistrationOptions, DidCloseTextDocumentParams, - DidOpenTextDocumentParams, DidSaveTextDocumentParams, DocumentChangeOperation, DocumentChanges, - DocumentFormattingParams, DocumentHighlight, DocumentHighlightKind, - DocumentRangeFormattingParams, DocumentSymbolParams, ExecuteCommandParams, FormattingOptions, - GenericCapability, GotoCapability, GotoDefinitionResponse, Hover, HoverCapability, - InitializeParams, InitializeResult, InitializedParams, Location, LogMessageParams, MarkupKind, - MessageType, NumberOrString, ParameterInformation, ParameterInformationSettings, - PartialResultParams, Position, ProgressParams, ProgressParamsValue, - PublishDiagnosticsCapability, PublishDiagnosticsParams, Range, ReferenceContext, + ApplyWorkspaceEditParams, ApplyWorkspaceEditResponse, ClientCapabilities, ClientInfo, + CodeAction, CodeActionCapability, CodeActionContext, CodeActionKind, + CodeActionKindLiteralSupport, CodeActionLiteralSupport, CodeActionOrCommand, CodeActionParams, + CodeActionResponse, CodeLens, Command, CompletionCapability, CompletionItem, + CompletionItemCapability, CompletionResponse, CompletionTextEdit, Diagnostic, + DiagnosticSeverity, DidChangeConfigurationParams, DidChangeTextDocumentParams, + DidChangeWatchedFilesParams, DidChangeWatchedFilesRegistrationOptions, + DidCloseTextDocumentParams, DidOpenTextDocumentParams, DidSaveTextDocumentParams, + DocumentChangeOperation, DocumentChanges, DocumentFormattingParams, DocumentHighlight, + DocumentHighlightKind, DocumentRangeFormattingParams, DocumentSymbolParams, + ExecuteCommandParams, FormattingOptions, GenericCapability, GotoCapability, + GotoDefinitionResponse, Hover, HoverCapability, InitializeParams, InitializeResult, + InitializedParams, Location, LogMessageParams, MarkupKind, MessageType, NumberOrString, + ParameterInformation, ParameterInformationSettings, PartialResultParams, Position, + ProgressParams, ProgressParamsValue, PublishDiagnosticsParams, Range, ReferenceContext, RegistrationParams, RenameParams, ResourceOp, SemanticHighlightingClientCapability, SemanticHighlightingParams, ShowMessageParams, ShowMessageRequestParams, SignatureHelp, SignatureHelpCapability, SignatureInformationSettings, SymbolInformation, @@ -42,7 +44,6 @@ use lsp_types::{ WorkspaceClientCapabilities, WorkspaceEdit, WorkspaceSymbolParams, }; use maplit::hashmap; -use notify::Watcher; use serde::de::Deserialize; use serde_json::json; use std::{ @@ -58,6 +59,12 @@ use std::{ time::{Duration, Instant}, }; +#[derive(PartialEq)] +pub enum Direction { + Next, + Previous, +} + impl LanguageClient { pub fn get_client(&self, language_id: &LanguageId) -> Result> { self.get(|state| state.clients.get(language_id).cloned())? @@ -160,6 +167,7 @@ impl LanguageClient { let ( diagnostics_signs_max, diagnostics_max_severity, + diagnostics_ignore_sources, document_highlight_display, selection_ui_auto_open, use_virtual_text, @@ -169,9 +177,12 @@ impl LanguageClient { apply_completion_text_edits, preferred_markup_kind, hide_virtual_texts_on_insert, + enable_extensions, + code_lens_hl_group, ): ( Option, String, + Vec, Value, u8, UseVirtualText, @@ -181,10 +192,13 @@ impl LanguageClient { u8, Option>, u8, + Option>, + String, ) = self.vim()?.eval( [ "get(g:, 'LanguageClient_diagnosticsSignsMax', v:null)", "get(g:, 'LanguageClient_diagnosticsMaxSeverity', 'Hint')", + "get(g:, 'LanguageClient_diagnosticsIgnoreSources', [])", "get(g:, 'LanguageClient_documentHighlightDisplay', {})", "!!s:GetVar('LanguageClient_selectionUI_autoOpen', 1)", "s:useVirtualText()", @@ -194,6 +208,8 @@ impl LanguageClient { "get(g:, 'LanguageClient_applyCompletionAdditionalTextEdits', 1)", "get(g:, 'LanguageClient_preferredMarkupKind', v:null)", "s:GetVar('LanguageClient_hideVirtualTextsOnInsert', 0)", + "get(g:, 'LanguageClient_enableExtensions', v:null)", + "get(g:, 'LanguageClient_codeLensHighlightGroup', 'Comment')", ] .as_ref(), )?; @@ -290,6 +306,7 @@ impl LanguageClient { )?; state.diagnostics_signs_max = diagnostics_signs_max; state.diagnostics_max_severity = diagnostics_max_severity; + state.diagnostics_ignore_sources = diagnostics_ignore_sources; state.document_highlight_display = serde_json::from_value( serde_json::to_value(&state.document_highlight_display)? .combine(&document_highlight_display), @@ -309,6 +326,8 @@ impl LanguageClient { state.server_stderr = server_stderr; state.is_nvim = is_nvim; state.preferred_markup_kind = preferred_markup_kind; + state.enable_extensions = enable_extensions; + state.code_lens_hl_group = code_lens_hl_group; Ok(()) })?; @@ -603,6 +622,45 @@ impl LanguageClient { Ok(position) } + // moves the cursor to the next or previous diagnostic, depending on the value of direction. + pub fn cycle_diagnostics(&self, params: &Value, direction: Direction) -> Result<()> { + let filename = self.vim()?.get_filename(params)?; + let pos = self.vim()?.get_position(params)?; + let mut diagnostics = self.get(|state| state.diagnostics.clone())?; + if let Some(diagnostics) = diagnostics.get_mut(&filename) { + if direction == Direction::Next { + diagnostics.sort_by_key(|edit| (edit.range.start.line, edit.range.start.character)); + } else { + diagnostics.sort_by_key(|edit| { + ( + -(edit.range.start.line as i64), + -(edit.range.start.character as i64), + ) + }); + } + + let (line, col) = (pos.line, pos.character); + if let Some((_, diagnostic)) = diagnostics.iter_mut().find_position(|it| { + let start = it.range.start; + if direction == Direction::Next { + start.line > line || (start.line == line && start.character > col) + } else { + start.line < line || (start.line == line && start.character < col) + } + }) { + let line = diagnostic.range.start.line + 1; + let col = diagnostic.range.start.character + 1; + let _: String = self.vim()?.rpcclient.call("cursor", json!([line, col]))?; + } else { + self.vim()?.echomsg("No diagnostics found")?; + } + } else { + self.vim()?.echomsg("No diagnostics found")?; + } + + Ok(()) + } + fn update_quickfixlist(&self) -> Result<()> { let diagnostics = self.get(|state| state.diagnostics.clone())?; let qflist: Vec<_> = diagnostics @@ -967,15 +1025,32 @@ impl LanguageClient { } fn try_handle_command_by_client(&self, cmd: &Command) -> Result { - match cmd.command.as_str() { - java::command::APPLY_WORKSPACE_EDIT => self.handle_java_command(cmd), - rust_analyzer::command::RUN - | rust_analyzer::command::RUN_SINGLE - | rust_analyzer::command::SHOW_REFERENCES - | rust_analyzer::command::SELECT_APPLY_SOURCE_CHANGE - | rust_analyzer::command::APPLY_SOURCE_CHANGE => self.handle_rust_analyzer_command(cmd), + let filetype: String = self.vim()?.eval("&filetype")?; + let enabled_extensions = self.get(|state| state.enable_extensions.clone())?; + if !enabled_extensions + .unwrap_or_default() + .get(&filetype) + .cloned() + .unwrap_or(true) + { + return Ok(false); + } - _ => Ok(false), + let capabilities = self.get(|state| state.capabilities.get(&filetype).cloned())?; + let server_name = capabilities + .unwrap_or_default() + .server_info + .unwrap_or_default() + .name; + + match server_name.as_str() { + "gopls" => self.handle_gopls_command(cmd), + "rust-analyzer" => self.handle_rust_analyzer_command(cmd), + _ => match cmd.command.as_str() { + // not sure which name java's language server advertises + java::command::APPLY_WORKSPACE_EDIT => self.handle_java_command(cmd), + _ => Ok(false), + }, } } @@ -1125,16 +1200,16 @@ impl LanguageClient { code_action_literal_support: Some(CodeActionLiteralSupport { code_action_kind: CodeActionKindLiteralSupport { value_set: [ - code_action_kind::QUICKFIX, - code_action_kind::REFACTOR, - code_action_kind::REFACTOR_EXTRACT, - code_action_kind::REFACTOR_INLINE, - code_action_kind::REFACTOR_REWRITE, - code_action_kind::SOURCE, - code_action_kind::SOURCE_ORGANIZE_IMPORTS, + CodeActionKind::QUICKFIX, + CodeActionKind::REFACTOR, + CodeActionKind::REFACTOR_EXTRACT, + CodeActionKind::REFACTOR_INLINE, + CodeActionKind::REFACTOR_REWRITE, + CodeActionKind::SOURCE, + CodeActionKind::SOURCE_ORGANIZE_IMPORTS, ] .iter() - .map(|x| x.to_string()) + .map(|kind| kind.as_str().to_owned()) .collect(), }, }), @@ -1142,6 +1217,7 @@ impl LanguageClient { }), signature_help: Some(SignatureHelpCapability { signature_information: Some(SignatureInformationSettings { + active_parameter_support: None, documentation_format: preferred_markup_kind.clone(), parameter_information: Some(ParameterInformationSettings { label_offset_support: Some(true), @@ -1165,9 +1241,9 @@ impl LanguageClient { link_support: Some(true), ..GotoCapability::default() }), - publish_diagnostics: Some(PublishDiagnosticsCapability { + publish_diagnostics: Some(PublishDiagnosticsClientCapabilities { related_information: Some(true), - ..PublishDiagnosticsCapability::default() + ..PublishDiagnosticsClientCapabilities::default() }), code_lens: Some(GenericCapability { dynamic_registration: Some(true), @@ -1197,10 +1273,11 @@ impl LanguageClient { }, )?; + let initialize_result = InitializeResult::deserialize(&result)?; self.update(|state| { state .capabilities - .insert(language_id.clone(), result.clone()); + .insert(language_id.clone(), initialize_result); Ok(()) })?; @@ -1507,7 +1584,7 @@ impl LanguageClient { .map(|action_or_command| match action_or_command { CodeActionOrCommand::Command(command) => CodeAction { title: command.title.clone(), - kind: Some(command.command.clone()), + kind: Some(command.command.clone().into()), diagnostics: None, edit: None, command: Some(command), @@ -1992,12 +2069,14 @@ impl LanguageClient { .map(|cl| match &cl.command { None => Err(anyhow!("no command, skipping")), Some(cmd) => Ok(CodeAction { - kind: Some(cmd.command.clone()), + kind: Some(cmd.command.clone().into()), title: cmd.title.clone(), command: cl.clone().command, diagnostics: None, edit: None, is_preferred: None, + disabled: None, + data: None, }), }) .filter(Result::is_ok) @@ -2072,9 +2151,7 @@ impl LanguageClient { if let Some(initialize_result) = capabilities.get(&language_id) { // XXX: the capabilities state field stores the initialize result, not the capabilities // themselves, so we need to deserialize to InitializeResult. - let initialize_result: InitializeResult = - serde_json::from_value(initialize_result.clone())?; - let capabilities = initialize_result.capabilities; + let capabilities = initialize_result.capabilities.clone(); if let Some(code_lens_provider) = capabilities.code_lens_provider { info!("Begin {}", lsp_types::request::CodeLensRequest::METHOD); @@ -2134,6 +2211,9 @@ impl LanguageClient { let filename = self.vim()?.get_filename(params)?; let language_id = self.vim()?.get_language_id(&filename, params)?; let text = self.vim()?.get_text(&filename)?; + let set_omnifunc: bool = self + .vim()? + .eval("s:GetVar('LanguageClient_setOmnifunc', v:true)")?; let text_document = TextDocumentItem { uri: filename.to_url()?, @@ -2153,8 +2233,10 @@ impl LanguageClient { DidOpenTextDocumentParams { text_document }, )?; - self.vim()? - .command("setlocal omnifunc=LanguageClient#complete")?; + if set_omnifunc { + self.vim()? + .command("setlocal omnifunc=LanguageClient#complete")?; + } let root = self.get(|state| state.roots.get(&language_id).cloned().unwrap_or_default())?; self.vim()?.rpcclient.notify( "setbufvar", @@ -2258,6 +2340,7 @@ impl LanguageClient { self.get_client(&Some(language_id))?.notify( lsp_types::notification::DidSaveTextDocument::METHOD, DidSaveTextDocumentParams { + text: None, text_document: TextDocumentIdentifier { uri }, }, )?; @@ -2313,10 +2396,16 @@ impl LanguageClient { let filename = filename.canonicalize(); let diagnostics_max_severity = self.get(|state| state.diagnostics_max_severity)?; + let ignore_sources = self.get(|state| state.diagnostics_ignore_sources.clone())?; let mut diagnostics = params .diagnostics .iter() .filter(|&diagnostic| { + if let Some(source) = &diagnostic.source { + if ignore_sources.contains(source) { + return false; + } + } diagnostic.severity.unwrap_or(DiagnosticSeverity::Hint) <= diagnostics_max_severity }) .map(Clone::clone) @@ -2703,7 +2792,7 @@ impl LanguageClient { if !self.get(|state| state.watchers.contains_key(language_id))? { let (watcher_tx, watcher_rx) = mpsc::channel(); // TODO: configurable duration. - let watcher = notify::watcher(watcher_tx, Duration::from_secs(2))?; + let watcher = FSWatch::new(watcher_tx, Duration::from_secs(2))?; self.update(|state| { state.watchers.insert(language_id.to_owned(), watcher); state.watcher_rxs.insert(language_id.to_owned(), watcher_rx); @@ -2714,13 +2803,25 @@ impl LanguageClient { self.update(|state| { if let Some(ref mut watcher) = state.watchers.get_mut(language_id) { for w in &opt.watchers { - let recursive_mode = if w.glob_pattern.ends_with("**") { - notify::RecursiveMode::Recursive - } else { - notify::RecursiveMode::NonRecursive - }; - watcher - .watch(w.glob_pattern.trim_end_matches("**"), recursive_mode)?; + info!("Watching glob pattern: {}", &w.glob_pattern); + for entry in glob(&w.glob_pattern)? { + match entry { + Ok(path) => { + if path.is_dir() { + watcher.watch_dir( + &path, + notify::RecursiveMode::Recursive, + )?; + } else { + watcher.watch_file(&path)?; + }; + info!("Start watching path {:?}", path); + } + Err(e) => { + warn!("Error globbing for {}: {}", w.glob_pattern, e) + } + } + } } } Ok(()) @@ -3222,6 +3323,11 @@ impl LanguageClient { let mut virtual_texts = vec![]; let use_virtual_text = self.get(|state| state.use_virtual_text.clone())?; + // code lens + if UseVirtualText::All == use_virtual_text || UseVirtualText::CodeLens == use_virtual_text { + virtual_texts.extend(self.virtual_texts_from_code_lenses(filename)?.into_iter()); + } + // diagnostics if UseVirtualText::All == use_virtual_text || UseVirtualText::Diagnostics == use_virtual_text @@ -3232,11 +3338,6 @@ impl LanguageClient { virtual_texts.extend(vt_diagnostics); } - // code lens - if UseVirtualText::All == use_virtual_text || UseVirtualText::CodeLens == use_virtual_text { - virtual_texts.extend(self.virtual_texts_from_code_lenses(filename)?.into_iter()); - } - self.vim()?.set_virtual_texts( bufnr, namespace_id, @@ -3284,6 +3385,7 @@ impl LanguageClient { let mut virtual_texts = vec![]; let code_lenses = self.get(|state| state.code_lens.get(filename).cloned().unwrap_or_default())?; + let code_lens_hl_group = self.get(|state| state.code_lens_hl_group.clone())?; for cl in code_lenses { if let Some(command) = cl.command { @@ -3300,7 +3402,7 @@ impl LanguageClient { None => virtual_texts.push(VirtualText { line, text, - hl_group: "Comment".into(), + hl_group: code_lens_hl_group.clone(), }), } } diff --git a/vim/bundle/LanguageClient-neovim/src/logger.rs b/vim/bundle/LanguageClient-neovim/src/logger.rs index 9821f3f..9a710ab 100644 --- a/vim/bundle/LanguageClient-neovim/src/logger.rs +++ b/vim/bundle/LanguageClient-neovim/src/logger.rs @@ -80,9 +80,8 @@ fn create_config(path: &Option, level: LevelFilter) -> Result { #[allow(clippy::write_literal)] writeln!( f, - "#######\nLanguageClient {} {}\n#######", + "#######\nLanguageClient {}\n#######", env!("CARGO_PKG_VERSION"), - env!("GIT_HASH") )?; } diff --git a/vim/bundle/LanguageClient-neovim/src/main.rs b/vim/bundle/LanguageClient-neovim/src/main.rs index 826be15..8ec72f9 100644 --- a/vim/bundle/LanguageClient-neovim/src/main.rs +++ b/vim/bundle/LanguageClient-neovim/src/main.rs @@ -10,24 +10,24 @@ mod utils; mod viewport; mod vim; mod vimext; +mod watcher; use anyhow::Result; use std::collections::HashMap; use std::sync::{Arc, Mutex}; -use structopt::StructOpt; use types::State; -#[derive(Debug, StructOpt)] -struct Arguments {} +#[macro_use] +extern crate clap; +#[macro_use] +extern crate lazy_static; fn main() -> Result<()> { - let version = format!("{} {}", env!("CARGO_PKG_VERSION"), env!("GIT_HASH")); - let args = Arguments::clap().version(version.as_str()); - let _ = args.get_matches(); + let _ = clap::app_from_crate!().get_matches(); let (tx, rx) = crossbeam::channel::unbounded(); let language_client = language_client::LanguageClient { - version, + version: env!("CARGO_PKG_VERSION").into(), state_mutex: Arc::new(Mutex::new(State::new(tx)?)), clients_mutex: Arc::new(Mutex::new(HashMap::new())), }; diff --git a/vim/bundle/LanguageClient-neovim/src/rpcclient.rs b/vim/bundle/LanguageClient-neovim/src/rpcclient.rs index 2703768..c3a0434 100644 --- a/vim/bundle/LanguageClient-neovim/src/rpcclient.rs +++ b/vim/bundle/LanguageClient-neovim/src/rpcclient.rs @@ -2,6 +2,7 @@ use crate::types::{Call, Id, LSError, LanguageId, RawMessage, ToInt, ToParams, T use anyhow::{anyhow, Result}; use crossbeam::channel::{bounded, unbounded, Receiver, Sender}; use log::*; +use regex::Regex; use serde::{de::DeserializeOwned, Serialize}; use std::io::Write; use std::str::FromStr; @@ -15,6 +16,13 @@ use std::{ const CONTENT_MODIFIED_ERROR_CODE: i64 = -32801; +lazy_static! { + // this regex is used to remove some additional fields that we get from some servers, namely: + // meta, sent by javascript-typescript-langserver and requestMethod, sent by Sorbet. + static ref RE_REMOVE_EXTRA_FIELDS: Regex = + Regex::new(r#",\s?"(?:meta|requestMethod)":(?:"\w+(/\w+)?"|\{\})"#).unwrap(); +} + #[derive(Serialize)] pub struct RpcClient { language_id: LanguageId, @@ -181,8 +189,9 @@ fn loop_read( continue; } info!("<= {:?} {}", language_id, message); - // FIXME: Remove extra `meta` property from javascript-typescript-langserver. - let s = message.replace(r#","meta":{}"#, ""); + // FIXME: Remove extra `meta` property from javascript-typescript-langserver and + // `requestMethod` sent by Sorbet. + let s = RE_REMOVE_EXTRA_FIELDS.replace(message, ""); let message = serde_json::from_str(&s); if let Err(ref err) = message { error!( @@ -240,3 +249,37 @@ fn loop_write( } Ok(()) } + +#[cfg(test)] +mod test { + use super::RE_REMOVE_EXTRA_FIELDS; + use crate::types::RawMessage; + + #[test] + // The library we're using for json-rpc doesn't accept extra fields in the structs used to + // deserialize the message. Sorbet (and possibly other servers) sends an extra field in it, so + // the client fails to deserialize that response. + // Our previous solution was to pin the dependency to jsonrpc-core to version 12, but is + // suboptimal, so we now try to remove the extra fields we know of from the response. + // + // See related issue: https://github.com/autozimu/LanguageClient-neovim/issues/892 + fn it_should_remove_extra_fields() { + // it removes the requestMethod field from Sorbet + let message = r#"{"jsonrpc":"2.0","id":1,"requestMethod":"initialize","result":0}"#; + let message = RE_REMOVE_EXTRA_FIELDS.replace(message, ""); + let result: Result = serde_json::from_str(&message); + assert!(result.is_ok()); + + let message = + r#"{"jsonrpc":"2.0","id":1,"requestMethod":"textDocument/definition","result":0}"#; + let message = RE_REMOVE_EXTRA_FIELDS.replace(message, ""); + let result: Result = serde_json::from_str(&message); + assert!(result.is_ok()); + + // it removes the meta field from javascript-typescript-langserver + let message = r#"{"jsonrpc":"2.0","id":1,"meta":{},"result":0}"#; + let message = RE_REMOVE_EXTRA_FIELDS.replace(message, ""); + let result: Result = serde_json::from_str(&message); + assert!(result.is_ok()); + } +} diff --git a/vim/bundle/LanguageClient-neovim/src/rpchandler.rs b/vim/bundle/LanguageClient-neovim/src/rpchandler.rs index 91117f1..0e8313f 100644 --- a/vim/bundle/LanguageClient-neovim/src/rpchandler.rs +++ b/vim/bundle/LanguageClient-neovim/src/rpchandler.rs @@ -1,4 +1,5 @@ -use crate::{language_client::LanguageClient, types::*}; +use crate::extensions::clangd; +use crate::{language_client::LanguageClient, language_server_protocol::Direction, types::*}; use anyhow::{anyhow, Result}; use log::*; use lsp_types::notification::{self, Notification}; @@ -118,6 +119,10 @@ impl LanguageClient { REQUEST_SEMANTIC_SCOPES => self.semantic_scopes(¶ms), REQUEST_SHOW_SEMANTIC_HL_SYMBOLS => self.semantic_highlight_symbols(¶ms), + clangd::request::SwitchSourceHeader::METHOD => { + self.text_document_switch_source_header(¶ms) + } + _ => { let language_id_target = if language_id.is_some() { // Message from language server. No handler found. @@ -196,6 +201,10 @@ impl LanguageClient { NOTIFICATION_RUST_BEGIN_BUILD => self.rust_handle_begin_build(¶ms)?, NOTIFICATION_RUST_DIAGNOSTICS_BEGIN => self.rust_handle_diagnostics_begin(¶ms)?, NOTIFICATION_RUST_DIAGNOSTICS_END => self.rust_handle_diagnostics_end(¶ms)?, + NOTIFICATION_DIAGNOSTICS_NEXT => self.cycle_diagnostics(¶ms, Direction::Next)?, + NOTIFICATION_DIAGNOSTICS_PREVIOUS => { + self.cycle_diagnostics(¶ms, Direction::Previous)? + } _ => { let language_id_target = if language_id.is_some() { diff --git a/vim/bundle/LanguageClient-neovim/src/types.rs b/vim/bundle/LanguageClient-neovim/src/types.rs index aaa6baa..7b15aea 100644 --- a/vim/bundle/LanguageClient-neovim/src/types.rs +++ b/vim/bundle/LanguageClient-neovim/src/types.rs @@ -5,6 +5,7 @@ use crate::{ language_client::LanguageClient, utils::{code_action_kind_as_str, ToUrl}, vim::Vim, + watcher::FSWatch, }; use anyhow::{anyhow, Result}; use jsonrpc_core::Params; @@ -12,8 +13,8 @@ use log::*; use lsp_types::{ CodeAction, CodeLens, Command, CompletionItem, CompletionTextEdit, Diagnostic, DiagnosticSeverity, DocumentHighlightKind, FileChangeType, FileEvent, Hover, HoverContents, - InsertTextFormat, Location, MarkedString, MarkupContent, MarkupKind, MessageType, - NumberOrString, Registration, SemanticHighlightingInformation, SymbolInformation, + InitializeResult, InsertTextFormat, Location, MarkedString, MarkupContent, MarkupKind, + MessageType, NumberOrString, Registration, SemanticHighlightingInformation, SymbolInformation, TextDocumentItem, TextDocumentPositionParams, TraceOption, Url, WorkspaceEdit, }; use maplit::hashmap; @@ -81,6 +82,8 @@ pub const NOTIFICATION_RUST_DIAGNOSTICS_BEGIN: &str = "rustDocument/diagnosticsB pub const NOTIFICATION_RUST_DIAGNOSTICS_END: &str = "rustDocument/diagnosticsEnd"; pub const NOTIFICATION_WINDOW_PROGRESS: &str = "window/progress"; pub const NOTIFICATION_LANGUAGE_STATUS: &str = "language/status"; +pub const NOTIFICATION_DIAGNOSTICS_NEXT: &str = "languageClient/diagnosticsNext"; +pub const NOTIFICATION_DIAGNOSTICS_PREVIOUS: &str = "languageClient/diagnosticsPrevious"; pub const VIM_SERVER_STATUS: &str = "g:LanguageClient_serverStatus"; pub const VIM_SERVER_STATUS_MESSAGE: &str = "g:LanguageClient_serverStatusMessage"; @@ -143,7 +146,7 @@ pub struct State { #[serde(skip_serializing)] pub vim: Vim, - pub capabilities: HashMap, + pub capabilities: HashMap, pub registrations: Vec, pub roots: HashMap, pub text_documents: HashMap, @@ -156,6 +159,7 @@ pub struct State { pub diagnostics: HashMap>, // filename => codeLens. pub code_lens: HashMap>, + pub code_lens_hl_group: String, #[serde(skip_serializing)] pub line_diagnostics: HashMap<(String, u64), String>, /// Active signs. @@ -169,7 +173,7 @@ pub struct State { pub document_highlight_source: Option, pub user_handlers: HashMap, #[serde(skip_serializing)] - pub watchers: HashMap, + pub watchers: HashMap, #[serde(skip_serializing)] pub watcher_rxs: HashMap>, @@ -192,6 +196,7 @@ pub struct State { pub diagnostics_display: HashMap, pub diagnostics_signs_max: Option, pub diagnostics_max_severity: DiagnosticSeverity, + pub diagnostics_ignore_sources: Vec, pub document_highlight_display: HashMap, pub window_log_message_level: MessageType, pub settings_path: Vec, @@ -205,6 +210,7 @@ pub struct State { pub use_virtual_text: UseVirtualText, pub hide_virtual_texts_on_insert: bool, pub echo_project_root: bool, + pub enable_extensions: Option>, pub server_stderr: Option, pub logger: Logger, @@ -272,6 +278,7 @@ impl State { diagnostics_display: DiagnosticsDisplay::default(), diagnostics_signs_max: None, diagnostics_max_severity: DiagnosticSeverity::Hint, + diagnostics_ignore_sources: vec![], document_highlight_display: DocumentHighlightDisplay::default(), window_log_message_level: MessageType::Warning, settings_path: vec![format!(".vim{}settings.json", std::path::MAIN_SEPARATOR)], @@ -287,6 +294,8 @@ impl State { echo_project_root: true, server_stderr: None, preferred_markup_kind: None, + enable_extensions: None, + code_lens_hl_group: "Comment".into(), logger, }) diff --git a/vim/bundle/LanguageClient-neovim/src/utils.rs b/vim/bundle/LanguageClient-neovim/src/utils.rs index 264339c..5d5cfe7 100644 --- a/vim/bundle/LanguageClient-neovim/src/utils.rs +++ b/vim/bundle/LanguageClient-neovim/src/utils.rs @@ -47,31 +47,33 @@ pub fn get_root_path<'a>( } match language_id { - "rust" => traverse_up(path, |dir| dir.join("Cargo.toml").exists()), - "php" => traverse_up(path, |dir| dir.join("composer.json").exists()), + "rust" => traverse_up(path, dir_has_one(&["Cargo.toml"])), + "php" => traverse_up(path, dir_has_one(&["composer.json"])), "javascript" | "typescript" | "javascript.jsx" | "typescript.tsx" => { - traverse_up(path, |dir| dir.join("package.json").exists()) + traverse_up(path, dir_has_one(&["package.json"])) } - "python" => traverse_up(path, |dir| { - dir.join("setup.py").exists() - || dir.join("Pipfile").exists() - || dir.join("requirements.txt").exists() - || dir.join("pyproject.toml").exists() - }), - "c" | "cpp" => traverse_up(path, |dir| dir.join("compile_commands.json").exists()), + "python" => traverse_up( + path, + dir_has_one(&["setup.py", "Pipfile", "requirements.txt", "pyproject.toml"]), + ), + "c" | "cpp" => traverse_up(path, dir_has_one(&["compile_commands.json"])), "cs" => traverse_up(path, is_dotnet_root), - "java" => traverse_up(path, |dir| { - dir.join(".project").exists() - || dir.join("pom.xml").exists() - || dir.join("build.gradle").exists() - }), - "scala" => traverse_up(path, |dir| dir.join("build.sbt").exists()), - "haskell" => traverse_up(path, |dir| dir.join("stack.yaml").exists()).or_else(|_| { + "java" => traverse_up( + path, + dir_has_one(&[ + "pom.xml", + "settings.gradle", + "settings.gradle.kts", + "WORKSPACE", + ]), + ), + "scala" => traverse_up(path, dir_has_one(&["build.sbt"])), + "haskell" => traverse_up(path, dir_has_one(&["stack.yaml"])).or_else(|_| { traverse_up(path, |dir| { dir_contains_file(dir, |f| has_extension(f, "cabal")) }) }), - "go" => traverse_up(path, |dir| dir.join("go.mod").exists()), + "go" => traverse_up(path, dir_has_one(&["go.mod"])), _ => Err(anyhow!("Unknown languageId: {}", language_id)), } .or_else(|_| { @@ -91,6 +93,10 @@ pub fn get_root_path<'a>( }) } +fn dir_has_one<'a>(files: &'a [&str]) -> impl Fn(&'a Path) -> bool { + move |dir| files.iter().any(|file| dir.join(file).exists()) +} + /// If iterating the directory fails (e.g. because it is not a directory), returns false; if a /// file cannot be inspected, that file is considered nonexistent. fn dir_contains_file(path: &Path, predicate: F) -> bool @@ -117,9 +123,9 @@ fn has_extension(path: &Path, ext: &str) -> bool { } } -fn traverse_up(path: &Path, predicate: F) -> Result<&Path> +fn traverse_up<'a, F>(path: &'a Path, predicate: F) -> Result<&'a Path> where - F: Fn(&Path) -> bool, + F: Fn(&'a Path) -> bool, { if predicate(path) { return Ok(path); @@ -161,7 +167,7 @@ impl + std::fmt::Debug> ToUrl for P { fn to_url(&self) -> Result { Url::from_file_path(self) .or_else(|_| Url::from_str(&self.as_ref().to_string_lossy())) - .or_else(|_| Err(anyhow!("Failed to convert ({:?}) to Url", self))) + .map_err(|_| anyhow!("Failed to convert ({:?}) to Url", self)) } } @@ -469,7 +475,7 @@ pub fn convert_to_vim_str(s: &str) -> String { /// Converts the kind of a `CodeAction` to a `&str`. pub fn code_action_kind_as_str(action: &CodeAction) -> &str { - match action.kind.as_ref().map(String::as_ref) { + match action.kind.as_ref().map(|k| k.as_str()) { None | Some("") => "action", Some(kind) => kind, } diff --git a/vim/bundle/LanguageClient-neovim/src/watcher.rs b/vim/bundle/LanguageClient-neovim/src/watcher.rs new file mode 100644 index 0000000..717f4f7 --- /dev/null +++ b/vim/bundle/LanguageClient-neovim/src/watcher.rs @@ -0,0 +1,330 @@ +use anyhow::{anyhow, Result}; +use notify::{DebouncedEvent, RecursiveMode, Watcher}; +use std::collections::{HashMap, HashSet}; +use std::path::{Path, PathBuf}; +use std::sync::mpsc; +use std::sync::{Arc, Mutex}; +use std::thread; +use std::time::Duration; + +// FSWatch has an outgoing channel on which it pushes events for any of the files or directories it +// is currently watching. Both directory and file watches are implemented using directory watches, +// in order to be able to catch write-via-rename tricks like Vim does on save. +// +// Thus, FSWatch has a number of directory watches in place. These are all non-recursive watches; +// recursive watches are connected directly to the FSWatch outgoing channel. +// There is one thread, with entry point fswatch_service(), that collects all notify events and +// filters out the ones that we're not interested in. Its incoming channel is attached to the +// notify::RecommendedWatcher, and the outgoing channel is the outgoing channel of FSWatch. + +struct DirWatch { + /// whether to also watch the directory itself + full_directory: bool, + files: HashSet, +} + +fn interested(dirs: &Arc>>, path: &Path) -> Result { + let dirs = dirs + .lock() + .map_err(|err| anyhow!("Failed to lock watcher: {:?}", err))?; + + if let Some(dw) = dirs.get(path) { + if dw.full_directory { + return Ok(true); + } + } + + if let Some(parent) = path.parent() { + if let Some(dw) = dirs.get(parent) { + if let Some(name) = path.file_name().and_then(|n| n.to_str()) { + return Ok(dw.files.contains(name)); + } + } + } + + Ok(false) +} + +fn fswatch_service( + rx: mpsc::Receiver, + tx: mpsc::Sender, + dirs: Arc>>, +) -> Result<()> { + let mut notice_remove = HashSet::new(); + + // Policy: + // - We never push through NoticeRemove events, since these may be spurious in the case of + // write-via-rename tricks, and if the remove was real we'll get a real Remove event later + // anyway. + // - When getting a different event, we always remove the path from notice_remove if + // applicable. (Even if we're not interested now, we may have been in the past, and we + // want to avoid memory leaks). + // - Then, if we're interested in a path, we handle and push through the event, possibly + // modified by the knowledge that we caught a NoticeRemove earlier. + for event in rx { + match &event { + DebouncedEvent::NoticeWrite(path) => { + notice_remove.remove(path); + if !interested(&dirs, path)? { + continue; + } + tx.send(event)?; + } + + DebouncedEvent::NoticeRemove(path) => { + if !interested(&dirs, path)? { + continue; + } + notice_remove.insert(path.to_owned()); + } + + DebouncedEvent::Create(path) => { + let interest = interested(&dirs, path)?; + // Detect and handle Vim's write-via-rename trick + if notice_remove.remove(path) { + if interest { + tx.send(DebouncedEvent::Write(path.to_owned()))?; + } + } else if interest { + tx.send(event)?; + } + } + + DebouncedEvent::Write(path) => { + notice_remove.remove(path); + if !interested(&dirs, path)? { + continue; + } + tx.send(event)?; + } + + DebouncedEvent::Chmod(path) => { + notice_remove.remove(path); + if !interested(&dirs, path)? { + continue; + } + tx.send(event)?; + } + + DebouncedEvent::Remove(path) => { + notice_remove.remove(path); + if !interested(&dirs, path)? { + continue; + } + tx.send(event)?; + } + + DebouncedEvent::Rename(from, to) => { + notice_remove.remove(from); + let interest_from = interested(&dirs, from)?; + let interest_to = interested(&dirs, to)?; + // TODO: is this the right behaviour? + if notice_remove.remove(to) && interest_to { + tx.send(DebouncedEvent::Remove(to.clone()))?; + } + if interest_from { + if interest_to { + tx.send(event)?; + } else { + tx.send(DebouncedEvent::Remove(from.to_owned()))?; + } + } else if interest_to { + tx.send(DebouncedEvent::Create(to.to_owned()))?; + } + } + + DebouncedEvent::Rescan => { + tx.send(event)?; + } + + DebouncedEvent::Error(_, optpath) => { + // TODO: is this the right behaviour? + if let Some(path) = optpath { + let interest = interested(&dirs, path)?; + if notice_remove.remove(path) && interest { + tx.send(DebouncedEvent::Remove(path.to_owned()))?; + } + if !interest { + continue; + } + } + tx.send(event)?; + } + } + } + + Ok(()) +} + +enum UnwatchInfo { + /// Recursive mode (directory is just the watched path itself) + Directory(RecursiveMode), + /// Directory and file + File(PathBuf, String), +} + +pub struct FSWatch { + dirs: Arc>>, + watcher: notify::RecommendedWatcher, + + // Used for recursive directory watches; is connected directly to the event sink. + recursive_watcher: Option, + event_sink: mpsc::Sender, + delay: Duration, + + unwatch_info: HashMap, +} + +impl FSWatch { + pub fn new(event_sink: mpsc::Sender, delay: Duration) -> Result { + let (funnel_tx, funnel_rx) = mpsc::channel(); + let dirs = Arc::new(Mutex::new(HashMap::new())); + let dirs_clone = dirs.clone(); + let event_sink_clone = event_sink.clone(); + thread::spawn(move || fswatch_service(funnel_rx, event_sink_clone, dirs_clone)); + let watcher = notify::watcher(funnel_tx, delay)?; + Ok(Self { + dirs, + watcher, + recursive_watcher: None, + event_sink, + delay, + unwatch_info: HashMap::new(), + }) + } + + /// 'path' must be a file, not a directory. + pub fn watch_file + std::fmt::Debug>(&mut self, path: P) -> Result<()> { + let err_msg = || Err(anyhow!("FSWatch::watch_file on an invalid path")); + + let dirname = if let Some(x) = path.as_ref().parent() { + x + } else { + return err_msg(); + }; + let name = if let Some(x) = path.as_ref().file_name().and_then(|n| n.to_str()) { + x + } else { + return err_msg(); + }; + + self.unwatch_info.insert( + path.as_ref().to_owned(), + UnwatchInfo::File(dirname.to_owned(), name.to_owned()), + ); + + let mut dirs = self + .dirs + .lock() + .map_err(|err| anyhow!("Failed to lock watcher: {:?}", err))?; + match dirs.get_mut(dirname) { + Some(dw) => { + dw.files.insert(name.to_string()); + Ok(()) + } + None => { + // watch first; if this throws an error, don't insert into the 'dirs' structure + self.watcher.watch(dirname, RecursiveMode::NonRecursive)?; + + let mut files = HashSet::new(); + files.insert(name.to_string()); + dirs.insert( + dirname.to_owned(), + DirWatch { + full_directory: false, + files, + }, + ); + Ok(()) + } + } + } + + /// 'path' must be a directory, not a file. + pub fn watch_dir + std::fmt::Debug>( + &mut self, + path: P, + recurse: RecursiveMode, + ) -> Result<()> { + self.unwatch_info + .insert(path.as_ref().to_owned(), UnwatchInfo::Directory(recurse)); + + match recurse { + RecursiveMode::Recursive => match &mut self.recursive_watcher { + Some(w) => { + w.watch(path, RecursiveMode::Recursive)?; + Ok(()) + } + None => { + let mut w = notify::watcher(self.event_sink.clone(), self.delay)?; + w.watch(path, RecursiveMode::Recursive)?; + self.recursive_watcher = Some(w); + Ok(()) + } + }, + + RecursiveMode::NonRecursive => { + let mut dirs = self + .dirs + .lock() + .map_err(|err| anyhow!("Failed to lock watcher: {:?}", err))?; + match dirs.get_mut(path.as_ref()) { + Some(dw) => { + dw.full_directory = true; + Ok(()) + } + None => { + // watch first; if this throws an error, don't insert into the 'dirs' structure + self.watcher.watch(&path, RecursiveMode::NonRecursive)?; + + dirs.insert( + path.as_ref().to_owned(), + DirWatch { + full_directory: true, + files: HashSet::new(), + }, + ); + Ok(()) + } + } + } + } + } + + pub fn unwatch>(&mut self, path: P) -> Result<()> { + let info = match self.unwatch_info.get(path.as_ref()) { + Some(info) => info, + None => return Err(anyhow!("FSWatch::unwatch on a non-watched path")), + }; + + let (key, filename): (&Path, Option<&str>) = match info { + UnwatchInfo::File(key, filename) => (&key, Some(filename)), + UnwatchInfo::Directory(RecursiveMode::NonRecursive) => (path.as_ref(), None), + UnwatchInfo::Directory(RecursiveMode::Recursive) => { + self.recursive_watcher + .as_mut() + .ok_or_else(|| anyhow!("Unexpected watcher state: not initialized"))? + .unwatch(path)?; + return Ok(()); + } + }; + + let mut dirs = self + .dirs + .lock() + .map_err(|err| anyhow!("Failed to lock watcher: {:?}", err))?; + let mut dw = dirs + .get_mut(key) + .ok_or_else(|| anyhow!("Unexpected watcher state: file not watched"))?; + match filename { + Some(filename) => { + dw.files.remove(filename); + } + None => { + dw.full_directory = false; + } + } + + Ok(()) + } +} diff --git a/vim/bundle/LanguageClient-neovim/tests/LanguageClient_test.py b/vim/bundle/LanguageClient-neovim/tests/LanguageClient_test.py index cba0c50..dc40d1d 100644 --- a/vim/bundle/LanguageClient-neovim/tests/LanguageClient_test.py +++ b/vim/bundle/LanguageClient-neovim/tests/LanguageClient_test.py @@ -56,7 +56,7 @@ def setup(nvim): def test_textDocument_definition(nvim): nvim.command("edit! {}".format(PATH_MAIN_RS)) - time.sleep(3) + time.sleep(10) nvim.funcs.cursor(3, 22) nvim.funcs.LanguageClient_textDocument_definition() time.sleep(3) @@ -130,7 +130,7 @@ def test_textDocument_documentSymbol(nvim): nvim.command("3lnext") - assert nvim.current.window.cursor == [8, 0] + assert nvim.current.window.cursor != [1, 1] def test_workspace_symbol(nvim):