Commit graph

611 commits

Author SHA1 Message Date
Laurențiu Nicola
93fcf1c133 Use mmap for proc macro libs 2020-04-17 12:38:38 +03:00
bors[bot]
10d8cb913c
Merge #3958
3958: Add proc-macro related config and tests r=matklad a=edwin0cheng

This PR do the following things:

1. Add cli argument `proc-macro` for running proc-macro server.
2. Added support for proc-macro in bench and analysis-stats
3. Added typescript config for proc-macros
4. Added an heavy test for proc-macros. 

To test it out: 

1. run `cargo xtask install --proc-macro`
2. add `"rust-analyzer.cargo.loadOutDirsFromCheck": true"` and `"rust-analyzer.procMacro.enabled": true"` in vs code config.

[Edit] Change to use `rust-analyzer proc-macro` for running proc-macro standalone process.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-16 20:21:59 +00:00
Edwin Cheng
177becea98 Add proc-macro cli command for rust-analyzer 2020-04-16 21:13:57 +08:00
kjeremy
45b0826499 cargo update 2020-04-16 09:13:44 -04:00
Florian Diebold
e8d0d79a0c Update Chalk 2020-04-16 12:39:00 +02:00
bors[bot]
d61909f904
Merge #3964 #3965 #3967
3964: Nicer Chalk debug logs r=matklad a=flodiebold

I'm looking at a lot of Chalk debug logs at the moment, so here's a few changes to make them slightly nicer...

3965: Implement inline associated type bounds r=matklad a=flodiebold

Like `Iterator<Item: SomeTrait>`.

This is an unstable feature, but it's used in the standard library e.g. in the definition of Flatten, so we can't get away with not implementing it :)

(This is cherry-picked from my recursive solver branch, where it works better, but I did manage to write a test that works with the current Chalk solver as well...)

3967: Handle `Self::Type` in trait definitions when referring to own associated type r=matklad a=flodiebold

It was implemented for other generic parameters for the trait, but not for `Self`.

(Last one off my recursive solver branch 😄 )

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-04-15 09:19:46 +00:00
bors[bot]
9726401eae
Merge #3963
3963: Upgrade Chalk r=matklad a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-04-15 09:08:39 +00:00
kjeremy
eedab116ab insta 0.16 2020-04-14 13:57:02 -04:00
Florian Diebold
c216a93da7 Upgrade Chalk 2020-04-13 16:18:25 +02:00
Florian Diebold
2e7b88b525 Nicer display of projections in Chalk logs 2020-04-13 14:46:03 +02:00
bors[bot]
0ecdba20df
Merge #3920
3920: Implement expand_task and list_macros in proc_macro_srv r=matklad a=edwin0cheng

This PR finish up the remain `proc_macro_srv` implementation :

1. Added dylib loading code for proc-macro crate dylib. Note that we have to add some special flags for unix loading because of a bug in old version of glibc, see https://github.com/fedochet/rust-proc-macro-panic-inside-panic-expample/issues/1 and https://github.com/rust-lang/rust/issues/60593 for details.

2. Added tests for proc-macro expansion: We use a trick here by adding `serde_derive` to dev-dependencies and calling `cargo-metadata` for searching its dylib path, and expand it in our tests. 

[EDIT]
Note that this PR **DO NOT** implement the final glue code with rust-analzyer and proc-macro-srv yet.
 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-04-11 11:49:07 +00:00
kjeremy
51b1750cfa cargo update 2020-04-10 13:48:25 -04:00
Florian Diebold
a0a80a4103 Implement Chalk's debug methods using TLS
Chalk now panics if we don't implement these methods and run with CHALK_DEBUG,
so I thought I'd try to implement them 'properly'. Sadly, it seems impossible to
do without transmuting lifetimes somewhere. The problem is that we need a `&dyn
HirDatabase` to get names etc., which we can't just put into TLS. I thought I
could just use `scoped-tls`, but that doesn't support references to unsized
types. So I put the `&dyn` into another struct and put the reference to *that*
into the TLS, but I have to transmute the lifetime to 'static for that to work.
2020-04-10 15:04:06 +02:00
Edwin Cheng
460ddde176 Add tests 2020-04-10 02:05:54 +08:00
Edwin Cheng
f7f121d60d Add dylib loading code 2020-04-10 01:18:47 +08:00
Edwin Cheng
6af1015f74 Add rustc_server (ra_tt rustc bridge) 2020-04-09 12:22:45 +08:00
Josh Mcguigan
8c378af721 missing match arms diagnostic 2020-04-07 05:12:08 -07:00
Edwin Cheng
40616fdb49 Refactor deps 2020-04-06 23:07:48 +08:00
bors[bot]
972816b6d4
Merge #3843
3843: Remove rustc_lexer dependency in favour of rustc-ap-rustc_lexer r=est31 a=est31

The latter is auto-published on a regular schedule (Right now weekly).

See also https://github.com/alexcrichton/rustc-auto-publish

Co-authored-by: est31 <MTest31@outlook.com>
2020-04-06 08:42:52 +00:00
est31
2f6914824a Remove rustc_lexer dependency in favour of rustc-ap-rustc_lexer
The latter is auto-published on a regular schedule (Right now weekly).
2020-04-06 10:08:51 +02:00
bors[bot]
a93a04fc9e
Merge #3744
3744: Upgrade Chalk r=matklad a=flodiebold



Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-04-06 07:49:09 +00:00
kjeremy
66c20495e7 Update serde_json 2020-04-05 16:03:21 -04:00
Florian Diebold
952714685a Upgrade Chalk again
The big change here is counting binders, not
variables (https://github.com/rust-lang/chalk/pull/360). We have to adapt to the
same scheme for our `Ty::Bound`. It's mostly fine though, even makes some things
more clear.
2020-04-05 19:23:18 +02:00
Florian Diebold
3659502816 Upgrade Chalk 2020-04-05 19:23:18 +02:00
kjeremy
e37e8d52f1 Cargo update 2020-04-04 17:47:19 -04:00
est31
dc142152e6 Remove unused dependencies 2020-04-04 19:22:14 +02:00
Edwin Cheng
84fb9b44c3 Introduce ra_proc_macro_srv 2020-04-03 19:01:44 +08:00
kjeremy
e5cd48940d filetime and proc-macro-hack 2020-04-01 10:36:00 -04:00
Aleksey Kladov
8d27829781 Reduce deps 2020-03-31 19:29:11 +02:00
Aleksey Kladov
70730d7655 Rename cargo_watch -> flycheck 2020-03-31 17:29:40 +02:00
Edwin Cheng
7f7a16675d Use jod_thread 2020-03-31 22:20:19 +08:00
Edwin Cheng
fa621f80fa Fix test 2020-03-31 22:20:18 +08:00
Edwin Cheng
503cbd3f4b Implement ra_proc_macro client logic 2020-03-31 22:20:18 +08:00
kjeremy
a1c5905d8d Update deps 2020-03-31 09:09:16 -04:00
Aleksey Kladov
f7df0b56a7 Use automatic thread joining for cargo-watch 2020-03-30 11:33:01 +02:00
Aleksey Kladov
8bea5ace7e ⬆️ jod-thread 2020-03-30 11:33:01 +02:00
Aleksey Kladov
6596e7cddf Nice string formatting 2020-03-28 12:27:54 +01:00
Aleksey Kladov
b764c38436 Start stdx
This crate will hold everything to small to be worth publishing
2020-03-28 11:01:25 +01:00
bors[bot]
b1594f1080
Merge #3727
3727: Introduce ra_proc_macro r=matklad a=edwin0cheng

This PR implemented:

1.  Reading dylib path of proc-macro crate from cargo check , similar to how `OUTDIR` is obtained.
2.  Added a new crate `ra_proc_macro` and implement the foot-work for reading result from external proc-macro expander. 
3. Added a struct `ProcMacroClient` , which will be responsible to the client side communication to the External process.



Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-03-26 17:09:32 +00:00
Edwin Cheng
db162df264 Remove deps on tt_mbe 2020-03-27 00:46:40 +08:00
kjeremy
49144deb1b Update deps 2020-03-26 09:41:53 -04:00
Edwin Cheng
d0b6ed4441 Add ProcMacroClient 2020-03-26 03:29:45 +08:00
Edwin Cheng
a617f24eae Add ra_proc_macro 2020-03-26 01:30:39 +08:00
Kirill Bulatov
944f28fe5b Use more generic public api 2020-03-24 10:43:22 +02:00
Josh Mcguigan
df58ab8963 update itertools version to 0.9.0 2020-03-23 16:22:46 -07:00
Josh Mcguigan
2afccbe477 implement fill match arm assist for tuple of enums 2020-03-22 23:28:25 -07:00
Jeremy Kolb
d19a5c04ea Bump proc-macro-hack and syn 2020-03-22 10:39:35 -04:00
CAD97
27d9516105 cargo update 2020-03-18 17:17:45 -04:00
Emil Lauridsen
33c6c7abc6 Support loading OUT_DIR from cargo check at launch 2020-03-17 14:47:05 +01:00
kjeremy
8e6c1087b1 Update dependencies, removing rustc_version 2020-03-16 16:45:32 -04:00
Jeremy Kolb
2107216dd7 Update anyhow 2020-03-15 12:15:58 -04:00
kjeremy
4c1cde7bda Update deps 2020-03-13 09:50:56 -04:00
Josh Mcguigan
7208498d54 fix issue 3444 2020-03-12 17:16:28 -07:00
Aleksey Kladov
59a3ec5f33 ⬆️ fst 2020-03-10 15:03:32 +01:00
kjeremy
ba0cd6edc8 Remove c2-chaha dependency 2020-03-10 09:51:27 -04:00
bors[bot]
530ff9f57f
Merge #3533
3533: Updates insta to 0.15.0 and bumps console to 0.10.0 r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-03-09 14:38:20 +00:00
kjeremy
d1e9f0af04 Updates insta to 0.15.0 and bumps console to 0.10.0 2020-03-09 10:28:30 -04:00
kjeremy
c981c8b0d0 Fix SelectionRange return type 2020-03-09 10:17:16 -04:00
Florian Diebold
24e98121d8 Try to complete within macros 2020-03-07 15:48:06 +01:00
kjeremy
2a8b7bc648 Bump to quote-1.0.3 since 1.0.2 is blacklisted 2020-03-05 15:21:20 -05:00
kjeremy
cae888e926 Update deps 2020-03-04 10:20:03 -05:00
Aleksey Kladov
e839d793ae Drop one once_cell dep 2020-03-04 12:22:47 +01:00
Aleksey Kladov
f79719b8ae Move find_refs_to_def 2020-03-04 12:22:47 +01:00
Aleksey Kladov
19115e9fab Support cross-crate marks 2020-03-04 11:55:25 +01:00
Laurențiu Nicola
91e02ace06 Drop larlpop-intern dep 2020-03-03 07:57:16 +02:00
Laurențiu Nicola
f60cf882a8 Update chalk for Ty interners 2020-03-03 00:02:19 +02:00
Laurențiu Nicola
807a56bebf Update chalk for RawId removal 2020-03-02 23:30:38 +02:00
kjeremy
92ae17a117 Update deps 2020-03-02 14:47:25 -05:00
kjeremy
c6f4e8de5e lsp-types 0.72 2020-03-02 11:52:46 -05:00
Shotaro Yamada
33de107ed9 Remove unused dependencies 2020-02-27 14:04:13 +09:00
kjeremy
bc1985037f Update lsp-types 2020-02-26 16:50:47 -05:00
kjeremy
d90d1e8f8e Update 2020-02-26 15:33:16 -05:00
Aleksey Kladov
8046622871 Actually drop unicase dependency 2020-02-26 11:38:33 +01:00
Aleksey Kladov
469011169b ⬆️ rowan 2020-02-25 14:44:51 +01:00
Laurențiu Nicola
ed69482d90 Bump chalk and replace TypeFamily with Interner 2020-02-24 22:36:57 +02:00
Jeremy Kolb
0419dbacc9 Update deps 2020-02-24 07:58:54 -05:00
Laurențiu Nicola
9077942212 Bump crossbeam crates 2020-02-22 18:22:09 +02:00
kjeremy
044180847a Bump lsp-types 2020-02-19 09:14:05 -05:00
Kirill Bulatov
f6816c253b Update versions 2020-02-18 16:12:40 +02:00
Aleksey Kladov
039f2039a4 Remove unicase dependency 2020-02-18 14:44:52 +01:00
Aleksey Kladov
b643ccfaed Drop extra deps 2020-02-18 14:44:52 +01:00
Aleksey Kladov
c0fa5e2246 Rename the binary to rust-analyzer 2020-02-18 12:33:16 +01:00
Aleksey Kladov
2c9b91ad32 Merge ra_vfs_glob and ra_lsp_server 2020-02-17 19:07:30 +01:00
Aleksey Kladov
659b0e73cf Merge cli and ra_lsp_server 2020-02-17 19:03:03 +01:00
Aleksey Kladov
2d1b3da5fb Use anyhow 2020-02-17 18:19:25 +01:00
Aleksey Kladov
d7be1da8df Inline ra_batch 2020-02-17 17:32:17 +01:00
Aleksey Kladov
57140f1730 Drop proptest tests
It takes waaay to long to compile.

We should add quickcheck tests when we touch the relevant code next
time.
2020-02-17 16:57:06 +01:00
kjeremy
ba9fb8822e Update deps 2020-02-17 09:19:55 -05:00
bors[bot]
d976772716
Merge #3157
3157: Extend analysis-stats a bit r=matklad a=flodiebold

This adds some tools helpful when debugging nondeterminism in analysis-stats:
 - a `--randomize` option that analyses everything in random order
 - a `-vv` option that prints even more detail

Also add a debug log if Chalk fuel is exhausted (which would be a source of
nondeterminism, but didn't happen in my tests).

I found one source of nondeterminism (rust-lang/chalk#331), but there are still
other cases remaining.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-02-15 22:35:44 +00:00
Aleksey Kladov
11dda31941 Remove extra dep 2020-02-15 23:23:44 +01:00
Florian Diebold
3484d727c3 Extend analysis-stats a bit
This adds some tools helpful when debugging nondeterminism in analysis-stats:
 - a `--randomize` option that analyses everything in random order
 - a `-vv` option that prints even more detail

Also add a debug log if Chalk fuel is exhausted (which would be a source of
nondeterminism, but didn't happen in my tests).

I found one source of nondeterminism (rust-lang/chalk#331), but there are still
other cases remaining.
2020-02-15 18:04:01 +01:00
Adam Bratschi-Kaye
6f2cab1368
Add error context to failures in ra_project_model using anyhow crate (#3119)
Add error context to failures in ra_project_model using anyhow crate
2020-02-13 11:10:50 +01:00
bors[bot]
759100fb0d
Merge #3062
3062: Implement slice pattern AST > HIR lowering r=jplatte a=jplatte

WIP. The necessary changes for parsing are implemented, but actual inference is not yet. Just wanted to upload what I've got so far so it doesn't get duplicated :)

Will fix #3043

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2020-02-11 21:46:36 +00:00
Jonas Platte
a3b104aa6d
Implement slice pattern AST > HIR lowering 2020-02-11 22:33:11 +01:00
kjeremy
f51e3a357e Update some crates 2020-02-10 10:42:56 -05:00
bors[bot]
895cdb5883
Merge #3034
3034: Remove ImportLocator hack r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-06 16:50:01 +00:00
kjeremy
6fdbf9038f Update indexmap and bstr 2020-02-06 10:44:43 -05:00
Aleksey Kladov
a173e31890 Make assists use ImportsLocator directly 2020-02-06 16:40:28 +01:00
bors[bot]
ff2d77bde6
Merge #3029
3029: Docs r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-06 14:14:47 +00:00
Aleksey Kladov
ec6fb8da7c Add profiling around add_impl_members
This intention is pretty slow for `impl Interator`, because it has a
ton of default methods which need to be substituted.

The proper fix here is to not compute the actual edit until the user
triggers the action, but that's awkward to do in the LSP right now, so
let's just put a profiling code for now.
2020-02-06 14:55:10 +01:00