diff options
-rw-r--r-- | Cargo.lock | 35 | ||||
-rw-r--r-- | crates/ra_prof/src/lib.rs | 29 | ||||
-rw-r--r-- | editors/code/src/client.ts | 4 |
3 files changed, 47 insertions, 21 deletions
diff --git a/Cargo.lock b/Cargo.lock index 9187a913b..79f28f7cd 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -25,9 +25,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
25 | 25 | ||
26 | [[package]] | 26 | [[package]] |
27 | name = "atty" | 27 | name = "atty" |
28 | version = "0.2.13" | 28 | version = "0.2.14" |
29 | source = "registry+https://github.com/rust-lang/crates.io-index" | 29 | source = "registry+https://github.com/rust-lang/crates.io-index" |
30 | dependencies = [ | 30 | dependencies = [ |
31 | "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | ||
31 | "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", | 32 | "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", |
32 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", | 33 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", |
33 | ] | 34 | ] |
@@ -129,7 +130,7 @@ source = "git+https://github.com/rust-lang/chalk.git?rev=ff65b5ac9860f3c36bd892c | |||
129 | dependencies = [ | 130 | dependencies = [ |
130 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | 131 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", |
131 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | 132 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", |
132 | "syn 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", | 133 | "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", |
133 | ] | 134 | ] |
134 | 135 | ||
135 | [[package]] | 136 | [[package]] |
@@ -192,7 +193,7 @@ name = "clicolors-control" | |||
192 | version = "1.0.1" | 193 | version = "1.0.1" |
193 | source = "registry+https://github.com/rust-lang/crates.io-index" | 194 | source = "registry+https://github.com/rust-lang/crates.io-index" |
194 | dependencies = [ | 195 | dependencies = [ |
195 | "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", | 196 | "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", |
196 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | 197 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
197 | "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", | 198 | "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", |
198 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", | 199 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -431,7 +432,7 @@ dependencies = [ | |||
431 | 432 | ||
432 | [[package]] | 433 | [[package]] |
433 | name = "hermit-abi" | 434 | name = "hermit-abi" |
434 | version = "0.1.5" | 435 | version = "0.1.6" |
435 | source = "registry+https://github.com/rust-lang/crates.io-index" | 436 | source = "registry+https://github.com/rust-lang/crates.io-index" |
436 | dependencies = [ | 437 | dependencies = [ |
437 | "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", | 438 | "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -591,7 +592,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
591 | 592 | ||
592 | [[package]] | 593 | [[package]] |
593 | name = "lock_api" | 594 | name = "lock_api" |
594 | version = "0.3.2" | 595 | version = "0.3.3" |
595 | source = "registry+https://github.com/rust-lang/crates.io-index" | 596 | source = "registry+https://github.com/rust-lang/crates.io-index" |
596 | dependencies = [ | 597 | dependencies = [ |
597 | "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | 598 | "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -728,7 +729,7 @@ name = "num_cpus" | |||
728 | version = "1.11.1" | 729 | version = "1.11.1" |
729 | source = "registry+https://github.com/rust-lang/crates.io-index" | 730 | source = "registry+https://github.com/rust-lang/crates.io-index" |
730 | dependencies = [ | 731 | dependencies = [ |
731 | "hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | 732 | "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", |
732 | "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", | 733 | "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", |
733 | ] | 734 | ] |
734 | 735 | ||
@@ -747,7 +748,7 @@ name = "parking_lot" | |||
747 | version = "0.10.0" | 748 | version = "0.10.0" |
748 | source = "registry+https://github.com/rust-lang/crates.io-index" | 749 | source = "registry+https://github.com/rust-lang/crates.io-index" |
749 | dependencies = [ | 750 | dependencies = [ |
750 | "lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | 751 | "lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", |
751 | "parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | 752 | "parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", |
752 | ] | 753 | ] |
753 | 754 | ||
@@ -781,7 +782,7 @@ dependencies = [ | |||
781 | "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", | 782 | "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", |
782 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | 783 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", |
783 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | 784 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", |
784 | "syn 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", | 785 | "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", |
785 | ] | 786 | ] |
786 | 787 | ||
787 | [[package]] | 788 | [[package]] |
@@ -815,7 +816,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
815 | dependencies = [ | 816 | dependencies = [ |
816 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | 817 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", |
817 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | 818 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", |
818 | "syn 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", | 819 | "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", |
819 | ] | 820 | ] |
820 | 821 | ||
821 | [[package]] | 822 | [[package]] |
@@ -1458,7 +1459,7 @@ dependencies = [ | |||
1458 | "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1459 | "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1459 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1460 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", |
1460 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1461 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1461 | "syn 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", | 1462 | "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", |
1462 | ] | 1463 | ] |
1463 | 1464 | ||
1464 | [[package]] | 1465 | [[package]] |
@@ -1503,7 +1504,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1503 | dependencies = [ | 1504 | dependencies = [ |
1504 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1505 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", |
1505 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1506 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1506 | "syn 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", | 1507 | "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", |
1507 | ] | 1508 | ] |
1508 | 1509 | ||
1509 | [[package]] | 1510 | [[package]] |
@@ -1523,7 +1524,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1523 | dependencies = [ | 1524 | dependencies = [ |
1524 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1525 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", |
1525 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1526 | "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1526 | "syn 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", | 1527 | "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", |
1527 | ] | 1528 | ] |
1528 | 1529 | ||
1529 | [[package]] | 1530 | [[package]] |
@@ -1562,7 +1563,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1562 | 1563 | ||
1563 | [[package]] | 1564 | [[package]] |
1564 | name = "syn" | 1565 | name = "syn" |
1565 | version = "1.0.12" | 1566 | version = "1.0.13" |
1566 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1567 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1567 | dependencies = [ | 1568 | dependencies = [ |
1568 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1569 | "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1770,7 +1771,7 @@ dependencies = [ | |||
1770 | "checksum anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c" | 1771 | "checksum anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c" |
1771 | "checksum anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" | 1772 | "checksum anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" |
1772 | "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" | 1773 | "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" |
1773 | "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" | 1774 | "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" |
1774 | "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" | 1775 | "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" |
1775 | "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" | 1776 | "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" |
1776 | "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" | 1777 | "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" |
@@ -1820,7 +1821,7 @@ dependencies = [ | |||
1820 | "checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" | 1821 | "checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" |
1821 | "checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" | 1822 | "checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" |
1822 | "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" | 1823 | "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" |
1823 | "checksum hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f629dc602392d3ec14bfc8a09b5e644d7ffd725102b48b81e59f90f2633621d7" | 1824 | "checksum hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772" |
1824 | "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" | 1825 | "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" |
1825 | "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" | 1826 | "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" |
1826 | "checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" | 1827 | "checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" |
@@ -1841,7 +1842,7 @@ dependencies = [ | |||
1841 | "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" | 1842 | "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" |
1842 | "checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" | 1843 | "checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" |
1843 | "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" | 1844 | "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" |
1844 | "checksum lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e57b3997725d2b60dbec1297f6c2e2957cc383db1cebd6be812163f969c7d586" | 1845 | "checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" |
1845 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" | 1846 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" |
1846 | "checksum lsp-server 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5383e043329615624bbf45e1ba27bd75c176762b2592855c659bc28ac580a06b" | 1847 | "checksum lsp-server 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5383e043329615624bbf45e1ba27bd75c176762b2592855c659bc28ac580a06b" |
1847 | "checksum lsp-types 0.68.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b08121a463f43ee67f09da45c0a61d447793adc8dc23e52b009e8cf80278a16" | 1848 | "checksum lsp-types 0.68.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b08121a463f43ee67f09da45c0a61d447793adc8dc23e52b009e8cf80278a16" |
@@ -1915,7 +1916,7 @@ dependencies = [ | |||
1915 | "checksum smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44e59e0c9fa00817912ae6e4e6e3c4fe04455e75699d06eedc7d85917ed8e8f4" | 1916 | "checksum smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44e59e0c9fa00817912ae6e4e6e3c4fe04455e75699d06eedc7d85917ed8e8f4" |
1916 | "checksum smol_str 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "34836c9a295c62c2ce3514471117c5cb269891e8421b2aafdd910050576c4d8b" | 1917 | "checksum smol_str 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "34836c9a295c62c2ce3514471117c5cb269891e8421b2aafdd910050576c4d8b" |
1917 | "checksum superslice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" | 1918 | "checksum superslice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" |
1918 | "checksum syn 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ddc157159e2a7df58cd67b1cace10b8ed256a404fb0070593f137d8ba6bef4de" | 1919 | "checksum syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4ff033220a41d1a57d8125eab57bf5263783dfdcc18688b1dacc6ce9651ef8" |
1919 | "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" | 1920 | "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" |
1920 | "checksum termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625" | 1921 | "checksum termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625" |
1921 | "checksum text_unit 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e08bbcb7a3adbda0eb23431206b653bdad3d8dea311e72d36bf2215e27a42579" | 1922 | "checksum text_unit 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e08bbcb7a3adbda0eb23431206b653bdad3d8dea311e72d36bf2215e27a42579" |
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index f260c40a3..6dde304b1 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs | |||
@@ -197,7 +197,10 @@ impl Drop for Profiler { | |||
197 | if level == 0 { | 197 | if level == 0 { |
198 | let stdout = stderr(); | 198 | let stdout = stderr(); |
199 | let longer_than = stack.filter_data.longer_than; | 199 | let longer_than = stack.filter_data.longer_than; |
200 | if duration >= longer_than { | 200 | // Convert to millis for comparison to avoid problems with rounding |
201 | // (otherwise we could print `0ms` despite user's `>0` filter when | ||
202 | // `duration` is just a few nanos). | ||
203 | if duration.as_millis() > longer_than.as_millis() { | ||
201 | print(0, &stack.messages, &mut stdout.lock(), longer_than, None); | 204 | print(0, &stack.messages, &mut stdout.lock(), longer_than, None); |
202 | } | 205 | } |
203 | stack.messages.clear(); | 206 | stack.messages.clear(); |
@@ -226,7 +229,7 @@ fn print( | |||
226 | continue; | 229 | continue; |
227 | } | 230 | } |
228 | accounted_for += duration; | 231 | accounted_for += duration; |
229 | if duration >= longer_than { | 232 | if duration.as_millis() > longer_than.as_millis() { |
230 | writeln!(out, "{}{:5}ms - {}", indent, duration.as_millis(), msg) | 233 | writeln!(out, "{}{:5}ms - {}", indent, duration.as_millis(), msg) |
231 | .expect("printing profiling info to stdout"); | 234 | .expect("printing profiling info to stdout"); |
232 | 235 | ||
@@ -251,8 +254,9 @@ fn print( | |||
251 | 254 | ||
252 | if let Some(total) = total { | 255 | if let Some(total) = total { |
253 | if let Some(unaccounted) = total.checked_sub(accounted_for) { | 256 | if let Some(unaccounted) = total.checked_sub(accounted_for) { |
254 | if unaccounted >= longer_than && last > 0 { | 257 | let unaccounted_millis = unaccounted.as_millis(); |
255 | writeln!(out, "{}{:5}ms - ???", indent, unaccounted.as_millis()) | 258 | if unaccounted_millis > longer_than.as_millis() && unaccounted_millis > 0 && last > 0 { |
259 | writeln!(out, "{}{:5}ms - ???", indent, unaccounted_millis) | ||
256 | .expect("printing profiling info to stdout"); | 260 | .expect("printing profiling info to stdout"); |
257 | } | 261 | } |
258 | } | 262 | } |
@@ -356,4 +360,21 @@ mod tests { | |||
356 | fn profiling_function2() { | 360 | fn profiling_function2() { |
357 | let _p = profile("profile2"); | 361 | let _p = profile("profile2"); |
358 | } | 362 | } |
363 | |||
364 | #[test] | ||
365 | fn test_longer_than() { | ||
366 | let mut result = vec![]; | ||
367 | let msgs = vec![ | ||
368 | Message { level: 1, duration: Duration::from_nanos(3), message: "bar".to_owned() }, | ||
369 | Message { level: 1, duration: Duration::from_nanos(2), message: "bar".to_owned() }, | ||
370 | Message { level: 0, duration: Duration::from_millis(1), message: "foo".to_owned() }, | ||
371 | ]; | ||
372 | print(0, &msgs, &mut result, Duration::from_millis(0), Some(Duration::from_millis(1))); | ||
373 | // The calls to `bar` are so short that they'll be rounded to 0ms and should get collapsed | ||
374 | // when printing. | ||
375 | assert_eq!( | ||
376 | std::str::from_utf8(&result).unwrap(), | ||
377 | " 1ms - foo\n 0ms - bar (2 calls)\n" | ||
378 | ); | ||
379 | } | ||
359 | } | 380 | } |
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index 743384bd7..1ff64a930 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { homedir } from 'os'; | 1 | import { homedir } from 'os'; |
2 | import * as lc from 'vscode-languageclient'; | 2 | import * as lc from 'vscode-languageclient'; |
3 | import { spawnSync } from 'child_process'; | ||
3 | 4 | ||
4 | import { window, workspace } from 'vscode'; | 5 | import { window, workspace } from 'vscode'; |
5 | import { Config } from './config'; | 6 | import { Config } from './config'; |
@@ -13,6 +14,9 @@ export function createClient(config: Config): lc.LanguageClient { | |||
13 | } | 14 | } |
14 | 15 | ||
15 | const command = expandPathResolving(config.raLspServerPath); | 16 | const command = expandPathResolving(config.raLspServerPath); |
17 | if (spawnSync(command, ["--version"]).status !== 0) { | ||
18 | window.showErrorMessage(`Unable to execute '${command} --version'`); | ||
19 | } | ||
16 | const run: lc.Executable = { | 20 | const run: lc.Executable = { |
17 | command, | 21 | command, |
18 | options: { cwd: folder }, | 22 | options: { cwd: folder }, |