Hello community, here is the log from the commit of package racer for openSUSE:Factory checked in at 2017-07-19 11:19:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/racer (Old) and /work/SRC/openSUSE:Factory/.racer.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "racer" Wed Jul 19 11:19:57 2017 rev:4 rq:502529 version:2.0.8 Changes: -------- --- /work/SRC/openSUSE:Factory/racer/racer.changes 2017-05-04 15:05:25.753762810 +0200 +++ /work/SRC/openSUSE:Factory/.racer.new/racer.changes 2017-07-19 11:19:57.925500956 +0200 @@ -1,0 +2,13 @@ +Fri Jun 9 09:19:22 UTC 2017 - [email protected] + +-Update to v2.0.8 + + Fix bug finding definitions where impl contains bang #717 + + Find definition for closures #697 + + Resolve types for tuple struct fields #722 + + Resolve types for let patterns #724 + + Fix completions for reference fields #723 +-Fixes from v2.0.7 + + Fix panic with macros called `impl*` #701 + + Relax semver specs + +------------------------------------------------------------------- Old: ---- racer-2.0.6.tar.gz New: ---- racer-2.0.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ racer.spec ++++++ --- /var/tmp/diff_new_pack.iVp3Vf/_old 2017-07-19 11:19:58.837372144 +0200 +++ /var/tmp/diff_new_pack.iVp3Vf/_new 2017-07-19 11:19:58.841371579 +0200 @@ -20,7 +20,7 @@ Name: racer -Version: 2.0.6 +Version: 2.0.8 Release: 0 Summary: Code completion for Rust License: MIT ++++++ racer-2.0.6.tar.gz -> racer-2.0.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/CHANGELOG.md new/racer-2.0.8/CHANGELOG.md --- old/racer-2.0.6/CHANGELOG.md 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/CHANGELOG.md 2017-06-01 19:09:49.000000000 +0200 @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 2.0.8 + +- Fix bug finding definitions where impl contains bang #717 +- Find definition for closures #697 +- Resolve types for tuple struct fields #722 +- Resolve types for let patterns #724 +- Fix completions for reference fields #723 + +## 2.0.7 + +- Fix panic with macros called `impl*` #701 +- Relax semver specs + ## 2.0.6 - resolve Self (e.g. in-impl function calls like Self::myfunction()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/Cargo.lock new/racer-2.0.8/Cargo.lock --- old/racer-2.0.6/Cargo.lock 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/Cargo.lock 2017-06-01 19:09:49.000000000 +0200 @@ -1,17 +1,18 @@ [root] name = "racer" -version = "2.0.6" +version = "2.0.8" dependencies = [ - "clap 2.19.1 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.24.2 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_syntax 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "typed-arena 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typed-arena 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -23,28 +24,51 @@ ] [[package]] +name = "aho-corasick" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "ansi_term" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "atty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "bitflags" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "bitflags" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "clap" -version = "2.19.1" +version = "2.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-segmentation 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -63,10 +87,10 @@ "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -74,7 +98,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -89,17 +113,17 @@ [[package]] name = "lazy_static" -version = "0.2.2" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.18" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "log" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -112,7 +136,15 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memchr" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -130,7 +162,7 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -146,13 +178,30 @@ ] [[package]] +name = "regex" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "regex-syntax" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "regex-syntax" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "rustc-serialize" -version = "0.3.22" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -165,7 +214,7 @@ [[package]] name = "strsim" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -173,11 +222,11 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -186,7 +235,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -195,18 +244,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_errors 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)", "syntex_pos 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "term" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -215,11 +264,11 @@ [[package]] name = "term_size" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -229,7 +278,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread-id" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -241,11 +299,20 @@ ] [[package]] +name = "thread_local" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "thread-id 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "toml" version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -253,27 +320,27 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "typed-arena" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-normalization" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-segmentation" -version = "0.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-width" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -282,13 +349,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "unreachable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "utf8-ranges" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "utf8-ranges" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "vec_map" -version = "0.6.0" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "void" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -303,41 +388,52 @@ [metadata] "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" +"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" +"checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" -"checksum clap 2.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "956cee0b2427dd9e71129a509d1ef17a7f5df9f8253924074d7a5d79bc61851e" +"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" +"checksum clap 2.24.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6b8f69e518f967224e628896b54e41ff6acfb4dcfefc5076325c36525dac900f" "checksum clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "5b4fabf979ddf6419a313c1c0ada4a5b95cfd2049c56e8418d622d27b4b6ff32" "checksum clippy_lints 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "ce96ec05bfe018a0d5d43da115e54850ea2217981ff0f2e462780ab9d594651a" "checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6abe0ee2e758cd6bc8a2cd56726359007748fbf4128da998b65d0b70f881e19b" -"checksum libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "a51822fc847e7a8101514d1d44e354ba2ffa7d4c194dcab48870740e327cac70" -"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" +"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" +"checksum libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)" = "babb8281da88cba992fa1f4ddec7d63ed96280a1a53ec9b919fd37b53d71e502" +"checksum log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5141eca02775a762cc6cd564d8d2c50f67c0ea3a372cbf1c51592b3e029e10ad" "checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" +"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" "checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" "checksum quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45" "checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" +"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" -"checksum rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "237546c689f20bb44980270c73c3b9edd0891c1be49cc1274406134a66d3957b" +"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" +"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f" -"checksum strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c" +"checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" "checksum syntex_errors 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9e52bffe6202cfb67587784cf23e0ec5bf26d331eef4922a16d5c42e12aa1e9b" "checksum syntex_pos 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)" = "955ef4b16af4c468e4680d1497f873ff288f557d338180649e18f915af5e15ac" "checksum syntex_syntax 0.52.0 (registry+https://github.com/rust-lang/crates.io-index)" = "76a302e717e348aa372ff577791c3832395650073b8d8432f8b3cb170b34afde" -"checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a" -"checksum term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f7f5f3f71b0040cecc71af239414c23fd3c73570f5ff54cf50e03cef637f2a0" +"checksum term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989" +"checksum term_size 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b6b55df3198cc93372e85dd2ed817f0e38ce8cc0f22eb32391bfad9c4bf209" "checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" +"checksum thread-id 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8df7875b676fddfadffd96deea3b1124e5ede707d4884248931077518cf1f773" "checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" +"checksum thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c85048c6260d17cf486ceae3282d9fb6b90be220bf5b28c400f5485ffc29f0c7" "checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796" "checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4" -"checksum typed-arena 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e2f9dc90da4f9d66ffc9ad3ead2c7d57582a26f4a3292d2ce7011bd29965100" -"checksum unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "26643a2f83bac55f1976fb716c10234485f9202dcd65cfbdf9da49867b271172" -"checksum unicode-segmentation 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c3bc443ded17b11305ffffe6b37e2076f328a5a8cb6aa877b1b98f77699e98b5" -"checksum unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6722facc10989f63ee0e20a83cd4e1714a9ae11529403ac7e0afd069abc39e" +"checksum typed-arena 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5934776c3ac1bea4a9d56620d6bf2d483b20d394e49581db40f187e1118ff667" +"checksum unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e28fa37426fceeb5cf8f41ee273faa7c82c47dc8fba5853402841e665fcd86ff" +"checksum unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8083c594e02b8ae1654ae26f0ade5158b119bd88ad0e8227a5d8fcd72407946" +"checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" "checksum unicode-xid 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb" +"checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" "checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" -"checksum vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac5efe5cb0fa14ec2f84f83c701c562ee63f6dcc680861b21d65c682adfb05f" +"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" +"checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c" +"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/Cargo.toml new/racer-2.0.8/Cargo.toml --- old/racer-2.0.6/Cargo.toml 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/Cargo.toml 2017-06-01 19:09:49.000000000 +0200 @@ -1,7 +1,7 @@ [package] name = "racer" -version = "2.0.6" +version = "2.0.8" license = "MIT" description = "Code completion for Rust" authors = ["Phil Dawes <[email protected]>"] @@ -21,13 +21,14 @@ debug = true [dependencies] -log = "~0.3.6" -syntex_syntax = "~0.52.0" -syntex_errors = "~0.52.0" -toml = "~0.2.1" -env_logger = "~0.3.4" -typed-arena = "~1.2.0" -clap = "~2.19.0" +log = "0.3.6" +syntex_syntax = "0.52.0" +syntex_errors = "0.52.0" +toml = "0.2.1" +env_logger = "0.3.4" +typed-arena = "1.2" +clap = "2.19" +regex = "0.2" [dependencies.clippy] version = "0.0.103" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/README.md new/racer-2.0.8/README.md --- old/racer-2.0.6/README.md 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/README.md 2017-06-01 19:09:49.000000000 +0200 @@ -30,9 +30,9 @@ 1. Fetch the Rust sourcecode - a) automatically via [rustup](https://www.rustup.rs/) and run `rustup component add rust-src` in order to install the source to `~/.multirust/toolchains/[your-toolchain]/lib/rustlib/src/rust/src`. Rustup will keep the sources in sync with the toolchain if you run `rustup update`. - - b) manually from git, or download from https://www.rust-lang.org/install.html (the 'rustc' source download behind the 'source' link is the right one). + 1. automatically via [rustup](https://www.rustup.rs/) and run `rustup component add rust-src` in order to install the source to `~/.multirust/toolchains/[your-toolchain]/lib/rustlib/src/rust/src`. Rustup will keep the sources in sync with the toolchain if you run `rustup update`. + + 2. manually from git, or download from https://www.rust-lang.org/install.html (the 'rustc' source download behind the 'source' link is the right one). 2. Set the ```RUST_SRC_PATH``` environment variable to point to the 'src' dir in the Rust source installation @@ -80,4 +80,8 @@ ### Atom integration -You can find the racer package for Atom [here](https://atom.io/packages/racer) +You can find the racer package for Atom [here](https://atom.io/packages/autocomplete-racer) + +### Kakoune integration + +[Kakoune](https://github.com/mawww/kakoune) comes with a builtin integration for racer auto completion. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/src/racer/ast.rs new/racer-2.0.8/src/racer/ast.rs --- old/racer-2.0.6/src/racer/ast.rs 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/src/racer/ast.rs 2017-06-01 19:09:49.000000000 +0200 @@ -255,6 +255,32 @@ None } } + PatKind::Struct(ref path, ref children, _) => { + let m = resolve_ast_path(path, &scope.filepath, scope.point, session); + let contextty = path_to_match(ty.clone(), session); + if let Some(m) = m { + let mut res = None; + + for child in children { + if point_is_in_span(point as u32, &child.span) { + res = typeinf::get_struct_field_type(&child.node.ident.name.as_str(), &m, session) + .and_then(|ty| + if let Some(Ty::Match(ref contextmatch)) = contextty { + path_to_match_including_generics(ty, contextmatch, session) + } else { + path_to_match(ty, session) + }) + .and_then(|ty| destructure_pattern_to_ty(&child.node.pat, point, &ty, scope, session)); + + break; + } + } + + res + } else { + None + } + } _ => { debug!("Could not destructure pattern {:?}", pat); None @@ -565,6 +591,26 @@ self.result = Some(Ty::Unsupported); } + ExprKind::TupField(ref subexpression, ref spanned_index) => { + let fieldnum = spanned_index.node; + debug!("tupfield {:?}", fieldnum); + self.visit_expr(subexpression); + self.result = self.result.as_ref().and_then(|ty| { + match *ty { + Ty::Match(ref structm) => { + typeinf::get_tuplestruct_field_type(fieldnum, structm, &self.session) + .and_then(|fieldtypepath| + find_type_match_including_generics(&fieldtypepath, + &structm.filepath, + structm.point, + structm, + self.session)) + } + _ => None + } + }); + } + _ => { debug!("- Could not match expr node type: {:?}",expr.node); } @@ -634,6 +680,13 @@ assert_eq!(&structm.filepath, filepath); let fieldtypepath = match *fieldtype { Ty::PathSearch(ref path, _) => path, + Ty::RefPtr(ref ty) => match *ty.as_ref() { + Ty::PathSearch(ref path, _) => path, + _ => { + debug!("EXPECTING A PATH!! Cannot handle other types yet. {:?}", fieldtype); + return None + } + }, _ => { debug!("EXPECTING A PATH!! Cannot handle other types yet. {:?}", fieldtype); return None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/src/racer/codeiter.rs new/racer-2.0.8/src/racer/codeiter.rs --- old/racer-2.0.6/src/racer/codeiter.rs 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/src/racer/codeiter.rs 2017-06-01 19:09:49.000000000 +0200 @@ -67,10 +67,10 @@ b'(' => { parenlevel += 1; }, b')' => { parenlevel -= 1; }, b'{' => { - // if we are top level and stmt is not a 'use' then + // if we are top level and stmt is not a 'use' or 'let' then // closebrace finishes the stmt if bracelevel == 0 && parenlevel == 0 - && !is_a_use_stmt(src_bytes, start, pos) { + && !(is_a_use_stmt(src_bytes, start, pos) || is_a_let_stmt(src_bytes, start, pos)) { enddelim = b'}'; } bracelevel += 1; @@ -116,6 +116,11 @@ whitespace.contains(&src_bytes[start+7])) } +fn is_a_let_stmt(src_bytes: &[u8], start: usize, pos: usize) -> bool { + let whitespace = b" {\t\r\n"; + pos > 3 && &src_bytes[start..start+3] == b"let" && whitespace.contains(&src_bytes[start+3]) +} + impl<'a, I> StmtIndicesIter<'a,I> where I: Iterator<Item=(usize,usize)> { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/src/racer/lib.rs new/racer-2.0.8/src/racer/lib.rs --- old/racer-2.0.6/src/racer/lib.rs 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/src/racer/lib.rs 2017-06-01 19:09:49.000000000 +0200 @@ -11,6 +11,7 @@ extern crate toml; extern crate env_logger; extern crate typed_arena; +extern crate regex; #[macro_use] mod testutils; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/src/racer/nameres.rs new/racer-2.0.8/src/racer/nameres.rs --- old/racer-2.0.6/src/racer/nameres.rs 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/src/racer/nameres.rs 2017-06-01 19:09:49.000000000 +0200 @@ -11,6 +11,7 @@ use std::path::{Path, PathBuf}; use std::{self, vec}; use matchers::PendingImports; +use regex::Regex; #[cfg(unix)] pub const PATH_SEP: char = ':'; @@ -241,7 +242,13 @@ if blob.starts_with("impl") { blob.find('{').map(|n| { - let mut decl = blob[..n+1].to_owned(); + let ref decl = blob[..n+1]; + if decl.contains('!') { + // Guard against macros + debug!("impl was probably a macro: {} {}", filepath.display(), start); + return; + } + let mut decl = decl.to_owned(); decl.push_str("}"); if txt_matches(ExactMatch, searchstr, &decl) { debug!("impl decl {}", decl); @@ -316,10 +323,15 @@ for (start, end) in src.iter_stmts() { let blob = &src[start..end]; - if blob.starts_with("impl") - && !blob.contains('!') { // Guard against macros + if blob.starts_with("impl") { blob.find('{').map(|n| { - let mut decl = blob[..n+1].to_owned(); + let ref decl = blob[..n+1]; + if decl.contains('!') { + // Guard against macros + debug!("impl was probably a macro: {} {}", filepath.display(), start); + return; + } + let mut decl = decl.to_owned(); decl.push_str("}"); let generics = ast::parse_generics(decl.clone()); let implres = ast::parse_impl(decl.clone()); @@ -368,6 +380,7 @@ filepath: &Path, search_type: SearchType, session: &Session, pending_imports: &PendingImports) -> vec::IntoIter<Match> { debug!("search_scope_headers for |{}| pt: {}", searchstr, scopestart); + if let Some(stmtstart) = scopes::find_stmt_start(msrc, scopestart) { let preblock = &msrc[stmtstart..scopestart]; debug!("search_scope_headers preblock is |{}|", preblock); @@ -501,6 +514,10 @@ } } + } else if let Some(mat) = try_to_match_closure_definition(searchstr, preblock, stmtstart, filepath) { + let mut out = Vec::new(); + out.push(mat); + return out.into_iter(); } } @@ -915,10 +932,43 @@ } } + if let Some(mat) = try_to_match_closure_definition(searchstr, &scopesrc[0..], start, filepath) { + out.push(mat); + + if let ExactMatch = search_type { + return out.into_iter(); + } + } + debug!("search_scope found matches {:?} {:?}", search_type, out); out.into_iter() } +fn try_to_match_closure_definition(searchstr: &str, scope_src: &str, scope_src_pos: usize, filepath: &Path) -> Option<Match> { + if searchstr.is_empty() { + return None; + } + + if let Some(cap) = Regex::new(format!(r"(?:\|)(?:(?s).*,[^a-zA-Z0-9]*|[^a-zA-Z0-9]*)?(?P<definition>{})(?:[^a-zA-Z0-9\|]+[^\|]*)?(?:\|)", + searchstr).as_str()).unwrap().captures(scope_src) { + let def = cap.name("definition").unwrap(); + Some(Match { + matchstr: searchstr.to_owned(), + filepath: filepath.to_path_buf(), + point: def.start() + scope_src_pos, + coords: None, + local: true, + mtype: FnArg, + contextstr: cap.get(0).unwrap().as_str().to_owned(), + generic_args: Vec::new(), + generic_types: Vec::new(), + docs: String::new(), + }) + } else { + None + } +} + fn run_matchers_on_blob(src: Src, start: usize, end: usize, searchstr: &str, filepath: &Path, search_type: SearchType, local: bool, namespace: Namespace, session: &Session, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/src/racer/scopes.rs new/racer-2.0.8/src/racer/scopes.rs --- old/racer-2.0.6/src/racer/scopes.rs 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/src/racer/scopes.rs 2017-06-01 19:09:49.000000000 +0200 @@ -7,6 +7,7 @@ use std::path::{Path, PathBuf}; use std::str::from_utf8; use util::char_at; +use regex::Regex; fn find_close<'a, A>(iter: A, open: u8, close: u8, level_end: u32) -> Option<usize> where A: Iterator<Item=&'a u8> { let mut levels = 0u32; @@ -25,10 +26,36 @@ .map_or(src.len(), |count| pos + count) } +pub fn find_closure_scope_start(src: Src, point: usize, parentheses_open_pos: usize) -> Option<usize> { + let masked_src = mask_comments(src.from(point)); + + let closing_paren_pos = find_closing_paren(masked_src.as_str(), 0) + point; + + let src_between_parent = mask_comments(src.from_to(parentheses_open_pos, closing_paren_pos)); + + if Regex::new(r"\|[^\|]+\|").unwrap().find(src_between_parent.as_str()).is_some() { + Some(parentheses_open_pos) + } else { + None + } +} + pub fn scope_start(src: Src, point: usize) -> usize { let masked_src = mask_comments(src.to(point)); - find_close(masked_src.as_bytes().iter().rev(), b'}', b'{', 0) - .map_or(0, |count| point - count) + + let curly_parent_open_pos = find_close(masked_src.as_bytes().iter().rev(), b'}', b'{', 0) + .map_or(0, |count| point - count); + + let parent_open_pos = find_close(masked_src.as_bytes().iter().rev(), b')', b'(', 0) + .map_or(0, |count| point - count); + + if curly_parent_open_pos > parent_open_pos { + curly_parent_open_pos + } else if let Some(scope_pos) = find_closure_scope_start(src, point, parent_open_pos) { + scope_pos + } else { + curly_parent_open_pos + } } pub fn find_stmt_start(msrc: Src, point: usize) -> Option<usize> { @@ -39,6 +66,36 @@ .map(|(start, _)| scopestart + start) } +/// Finds the start of a `let` statement; includes handling of struct pattern matches in the +/// statement. +pub fn find_let_start(msrc: Src, point: usize) -> Option<usize> { + let mut scopestart = scope_start(msrc, point); + let mut let_start = None; + + // To avoid infinite loops, we cap the number of times we'll + // expand the search in an attempt to find statements. + for step in 1..6 { + let_start = msrc.from(scopestart).iter_stmts() + .find(|&(_, end)| scopestart + end > point); + + if let Some((ref start, ref end)) = let_start { + // Check if we've actually reached the start of the "let" stmt. + let stmt = &msrc.src.code[(scopestart+start)..(scopestart+end)]; + if stmt.starts_with("let") { + break; + } + } + + debug!("find_let_start failed to find start on attempt {}: Restarting search from {} ({:?})", + step, + scopestart - 1, + msrc.src.point_to_coords(scopestart - 1)); + scopestart = scope_start(msrc, scopestart - 1); + } + + let_start.map(|(start, _)| scopestart + start) +} + pub fn get_local_module_path(msrc: Src, point: usize) -> Vec<String> { let mut v = Vec::new(); get_local_module_path_(msrc, point, &mut v); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/src/racer/typeinf.rs new/racer-2.0.8/src/racer/typeinf.rs --- old/racer-2.0.6/src/racer/typeinf.rs 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/src/racer/typeinf.rs 2017-06-01 19:09:49.000000000 +0200 @@ -137,7 +137,7 @@ fn get_type_of_let_expr(m: &Match, msrc: Src, session: &Session) -> Option<core::Ty> { // ASSUMPTION: this is being called on a let decl - let point = scopes::find_stmt_start(msrc, m.point).unwrap(); + let point = scopes::find_let_start(msrc, m.point).unwrap(); let src = msrc.from(point); if let Some((start, end)) = src.iter_stmts().next() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/racer-2.0.6/tests/system.rs new/racer-2.0.8/tests/system.rs --- old/racer-2.0.6/tests/system.rs 2017-02-17 17:32:13.000000000 +0100 +++ new/racer-2.0.8/tests/system.rs 2017-06-01 19:09:49.000000000 +0200 @@ -679,7 +679,7 @@ let it = St { text: StItem { field: 22 }, used: false - } + }; for item in it { item.fie~ @@ -1881,6 +1881,25 @@ } #[test] +fn finds_tuple_struct_field_type() { + let _lock = sync!(); + + let src = " + pub struct Blah(Foo); + + pub struct Foo { + bar: usize, + } + + let f = Blah(Foo { bar: 3 }); + f.0.b~ar + "; + + let got = get_definition(src, None); + assert_eq!("bar", got.matchstr); +} + +#[test] fn finds_a_generic_retval_from_a_function() { let _lock = sync!(); @@ -2014,6 +2033,22 @@ } #[test] +fn finds_type_of_struct_member_via_let_expr() { + let _lock = sync!(); + + let src = " + pub struct Blah { subfield: uint } + pub struct Foo { field: Blah } + + let Foo { ref field } = Foo { field: Blah { subfield: 1 }}; + field.subfi~eld + "; + + let got = get_definition(src, None); + assert_eq!("subfield", got.matchstr); +} + +#[test] fn finds_type_of_tuple_member_via_fn_retval() { let _lock = sync!(); @@ -2400,6 +2435,26 @@ } #[test] +fn finds_type_of_struct_field_reference() { + let _lock = sync!(); + + let src = " + struct Dolor { sit: u8 } + + struct Lorem<'a> { ipsum: &'a Dolor } + + impl<'a> Lorem<'a> { + fn sit(&self) { + let _ = self.ipsum.s~it; + } + } + "; + + let got = get_definition(src, None); + assert_eq!("sit", got.matchstr); +} + +#[test] fn finds_self_param_when_fn_has_generic_closure_arg() { let _lock = sync!(); @@ -2639,3 +2694,355 @@ let got = get_definition(src, None); assert_eq!("myfunction", got.matchstr); } + +#[test] +fn closure_bracket_scope() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x | { x~ } ); + } + "; + + let got = get_definition(src, None); + assert_eq!("x", got.matchstr); + assert_eq!("| x |", got.contextstr); +} + +#[test] +fn closure_bracket_scope_multiple_args() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x,y,z,u | { x~ } ); + } + "; + + let got = get_definition(src, None); + assert_eq!("x", got.matchstr); + assert_eq!("| x,y,z,u |", got.contextstr); +} + +#[test] +fn closure_bracket_scope_multiple_args_different_definition() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x,y,z,u | { z~ } ); + } + "; + + let got = get_definition(src, None); + assert_eq!("z", got.matchstr); + assert_eq!("| x,y,z,u |", got.contextstr); +} + +#[test] +fn closure_bracket_scope_overwrite() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x, y | { y~ } ); + } + "; + + let got = get_definition(src, None); + assert_eq!("y", got.matchstr); + assert_eq!("| x, y |", got.contextstr); +} + +#[test] +fn closure_bracket_scope_with_types() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x: i32, y: String | { y~ } ); + } + "; + + let got = get_definition(src, None); + assert_eq!("y", got.matchstr); + assert_eq!("| x: i32, y: String |", got.contextstr); +} + +#[test] +fn closure_bracket_scope_find_outside() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x: i32 | { y~ } ); + } + "; + + let got = get_definition(src, None); + assert_eq!("y", got.matchstr); + assert_eq!("let y = Some(5);", got.contextstr); +} + +#[test] +fn closure_scope() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x | x~ ); + } + "; + + let got = get_definition(src, None); + assert_eq!("x", got.matchstr); + assert_eq!("| x |", got.contextstr); +} + +#[test] +fn closure_scope_multiple_args() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x,y,z,u | x~ ); + } + "; + + let got = get_definition(src, None); + assert_eq!("x", got.matchstr); + assert_eq!("| x,y,z,u |", got.contextstr); +} + +#[test] +fn closure_scope_multiple_args_different_definition() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x,y,z,u | z~ ); + } + "; + + let got = get_definition(src, None); + assert_eq!("z", got.matchstr); + assert_eq!("| x,y,z,u |", got.contextstr); +} + +#[test] +fn closure_scope_overwrite() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x, y | y~ ); + } + "; + + let got = get_definition(src, None); + assert_eq!("y", got.matchstr); + assert_eq!("| x, y |", got.contextstr); +} + +#[test] +fn closure_scope_with_types() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x: i32, y: String | y~ ); + } + "; + + let got = get_definition(src, None); + assert_eq!("y", got.matchstr); + assert_eq!("| x: i32, y: String |", got.contextstr); +} + +#[test] +fn finds_impl_with_bang() { + let _lock = sync!(); + + let src = " + struct Foo; + impl Foo { + fn invert(&self, b: bool) -> bool { !b } + + fn tst(&self) -> bool { + self.inv~ert(false) + } + "; + + let got = get_definition(src, None); + assert_eq!("invert", got.matchstr); +} + +#[test] +fn ignores_impl_macro() { + let _lock = sync!(); + + let src = " + struct Foo; + impl!(Foo); + + impl Foo { + fn tst(&self) -> bool { + self.ts~t() + } + "; + + let got = get_definition(src, None); + assert_eq!("tst", got.matchstr); +} + +#[test] +fn closure_scope_find_outside() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x: i32 | y~ ); + } + "; + + let got = get_definition(src, None); + assert_eq!("y", got.matchstr); + assert_eq!("let y = Some(5);", got.contextstr); +} + +#[test] +fn closure_scope_with_newlines() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| + + +x: i32 + + + +| x~ ); + } + "; + + let got = get_definition(src, None); + assert_eq!("x", got.matchstr); + assert_eq!("| + + +x: i32 + + + +|", got.contextstr); +} + +#[test] +fn closure_bracket_scope_with_newlines() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| + + +x: i32 + + + +| {x~} ); + } + "; + + let got = get_definition(src, None); + assert_eq!("x", got.matchstr); + assert_eq!("| + + +x: i32 + + + +|", got.contextstr); +} + +#[test] +fn closure_scope_nested() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x: i32 | y.map(|z| z~) ); + } + "; + + let got = get_definition(src, None); + assert_eq!("z", got.matchstr); + assert_eq!("|z|", got.contextstr); +} + +#[test] +fn closure_bracket_scope_nested() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x: i32 | { y.map(|z| { z~ }) }); + } + "; + + let got = get_definition(src, None); + assert_eq!("z", got.matchstr); + assert_eq!("|z|", got.contextstr); +} + +#[test] +fn closure_scope_nested_math_outside() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x: i32 | y.map(|z| x~) ); + } + "; + + let got = get_definition(src, None); + assert_eq!("x", got.matchstr); + assert_eq!("| x: i32 |", got.contextstr); +} + +#[test] +fn closure_bracket_scope_nested_match_outside() { + let _lock = sync!(); + + let src = " + fn main() { + let y = Some(5); + y.map(| x: i32 | { y.map(|z| { x~ }) }); + } + "; + + let got = get_definition(src, None); + assert_eq!("x", got.matchstr); + assert_eq!("| x: i32 |", got.contextstr); +} \ No newline at end of file ++++++ vendor.tar.xz ++++++ ++++ 145979 lines of diff (skipped)
