Commit Graph

82 Commits

Author SHA1 Message Date
Lukas Wirth
ba84b91e78 Add a mirror function-like proc-macro expander for tests 2021-09-21 14:55:54 +02:00
Lukas Wirth
9c39363ada Simplify 2021-09-19 23:34:07 +02:00
Lukas Wirth
aa1b36dc6d Downmap the token in attribute inputs when expanding speculatively 2021-09-14 00:04:04 +02:00
Lukas Wirth
2b907652ee Speculatively expand attributes in completions 2021-09-13 19:30:23 +02:00
Lukas Wirth
edc915fbb6 Add proc-macro fixture directive 2021-09-13 18:37:50 +02:00
Giles Cope
4ccd90af81
remove unused deps 2021-09-11 16:20:04 +01:00
Lukas Wirth
36a5ce9790 minor: fix some clippy lints 2021-09-03 16:00:50 +02:00
Aleksey Kladov
81602f8a5d internal: reduce coupling
tt is a data structure, data structures cant' go wrong, they shouldn't
have the knowledge that the world outside of them has all kinds of
errors.
2021-08-31 19:14:33 +03:00
Aleksey Kladov
5192ddfa2e feat: include full path in the cyclic deps error 2021-08-18 15:35:04 +03:00
Jonas Schievink
3efdf6861f Complete editable private items 2021-07-23 19:57:16 +02:00
Aleksey Kladov
08caf36d9a minor: remove dead code
It has been living in RootDatabase::apply_change almost a year by now.
2021-07-20 20:22:56 +03:00
Aleksey Kladov
6a0f7f0852 internal: explain why we avoid serializing everything 2021-07-19 17:47:56 +03:00
Aleksey Kladov
8f3335f5fb internal: make it clearer where IO happens 2021-07-17 23:56:50 +03:00
Aleksey Kladov
86720f2953 minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
Laurențiu Nicola
cf9d93a5d6 Don't implement Eq for CrateGraph 2021-07-01 14:10:57 +03:00
Jamie Cunliffe
ae823aa23f Move features into potential_cfg_options 2021-06-21 17:54:05 +01:00
Jamie Cunliffe
284483b347 Improve completion of cfg attributes
The completion of cfg will look at the enabled cfg keys when
performing completion.

It will also look crate features when completing a feature cfg
option. A fixed list of known values for some cfg options are
provided.

For unknown keys it will look at the enabled values for that cfg key,
which means that completion will only show enabled options for those.
2021-06-21 17:47:00 +01:00
Lukas Wirth
2113c46797 Cleanup insert_use tests 2021-06-19 22:33:29 +02:00
Aleksey Kladov
89a0e58393 internal: use minicore deref more 2021-06-18 22:47:02 +03:00
Aleksey Kladov
f521e41853 internal: introduce minicore -- a subset of libcore for testing 2021-06-15 21:03:08 +03:00
Aleksey Kladov
1d2772c2c7 internal: move diagnostics to a new crate 2021-06-14 17:45:17 +03:00
Maan2003
c9b4ac5be4
clippy::redudant_borrow 2021-06-13 09:24:16 +05:30
Florian Diebold
20487a1b4a Fix coercion in match with expected type
Plus add infrastructure to test type mismatches without expect.
2021-06-12 23:04:43 +02:00
Kirill Bulatov
3aaf07b8cb Add more profiling for flyimports 2021-06-10 23:43:46 +03:00
bors[bot]
e9a797748d
Merge #8866
8866: Update salsa r=matklad a=jonas-schievink

This updates salsa to include https://github.com/salsa-rs/salsa/pull/265, and removes all cancellation-related code from rust-analyzer

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-31 12:42:32 +00:00
Jonas Schievink
acb5c227ed Update to prerelease 2021-05-29 21:10:00 +02:00
Jonas Schievink
8c639a87bd Thread proc-macro types through the HIR 2021-05-29 20:32:57 +02:00
Lukas Wirth
a6b92a8cc0 simplify 2021-05-28 20:46:09 +02:00
Jonas Schievink
33debc4065 Update salsa 2021-05-27 15:05:41 +02:00
Jonas Schievink
13b8449a11 Update CrateGraph comment
`cfg` flags are now implemented, and crates *may* have names, it doesn't
doesn't matter for name resolution
2021-05-25 00:56:24 +02:00
Laurențiu Nicola
c37ca7841c Add one more profiling span to add_dep 2021-04-22 21:48:17 +03:00
Lukas Wirth
58a6ec549d Add some more error messages to fixture failure cases 2021-04-17 21:34:14 +02:00
Yoshua Wuyts
5518a65037 Add an error message to fixture errors 2021-04-17 16:39:03 +02:00
Kirill Bulatov
e785672f15 Adjust fixture docs a bit 2021-04-06 21:42:27 +03:00
Aleksey Kladov
483a5bc9c8 internal: track missing .check_cancelled 2021-03-29 21:38:23 +03:00
Aleksey Kladov
fa9c6eb456 Improve readability 2021-03-23 13:04:43 +03:00
Aleksey Kladov
ba48c0d8bd Align naming of deps and revdeps 2021-03-23 13:04:43 +03:00
Aleksey Kladov
521a26b0d2 Align semantics of deps and rev deps 2021-03-23 12:58:48 +03:00
Aleksey Kladov
45a8f37b6a Compute more mathematically well-rounded notion of transitive deps
By including the crate itself, we make the resulting set closed with
respect to `transitve_reveres_dependencies` operation, as it becomes a
proper transitive closure. This just feels more proper and mathy.

And, indeed, this actually allows us to simplify call sites somewhat.
2021-03-23 12:49:55 +03:00
Matthias Krüger
202b51bc7b a lot of clippy::style fixes 2021-03-21 16:15:41 +01:00
Matthias Krüger
966c23f529 avoid converting types into themselves via .into() (clippy::useless-conversion)
example: let x: String = String::from("hello world").into();
2021-03-17 01:27:56 +01:00
Lukas Wirth
bebee2106d Don't repeat work in transitive_reverse_dependencies 2021-03-16 15:53:34 +01:00
Lukas Wirth
75fafd6fcc Add new_source_root meta to test fixtures 2021-03-16 15:28:02 +01:00
Lukas Wirth
e97cd709cd Implement Crate::transitive_reverse_dependencies 2021-03-15 18:28:31 +01:00
Vincent Esche
c4e2f32d73 Fixed remaining references to AnalysisChange (now: Change)
(The type was renamed/moved in 8716c4cec3)
2021-02-28 12:57:41 +01:00
Aleksey Kladov
58be1edfbb Make more common assist easier to ues 2021-02-22 16:07:08 +03:00
Joshua Nelson
e7d1f30cb3 Fix warnings when running cargo doc --document-private-items
These were the warnings previously:

```
warning: could not parse code block as Rust code
   --> crates/stdx/src/lib.rs:137:9
    |
137 |   ///     ∀ x in slice[..idx]:  pred(x)
    |  _________^
138 | | ///  && ∀ x in slice[idx..]: !pred(x)
    | |____^
    |
    = note: error from rustc: unknown start of token: \u{2200}

warning: 1 warning emitted

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = note: `#[warn(broken_intra_doc_links)]` on by default
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: 2 warnings emitted

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = note: `#[warn(broken_intra_doc_links)]` on by default
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: unresolved link to `package`
   --> crates/base_db/src/input.rs:181:15
    |
181 |     /// it's [package].name, can be different for other project types or even
    |               ^^^^^^^ no item named `package` in scope
    |
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

warning: 2 warnings emitted
```

This does *not* fix the following warning, because it is actually rust
code and rustdoc is being over eager:

```
warning: Rust code block is empty
  --> crates/parser/src/grammar.rs:16:5
   |
16 |   //! ```
   |  _____^
17 | | //! // test function_with_zero_parameters
18 | | //! // fn foo() {}
19 | | //! ```
   | |_______^
   |
help: mark blocks that do not contain Rust code as text
   |
16 | //! ```text
   |     ^^^^^^^
```

https://github.com/rust-lang/rust/pull/79816 should make this
configurable so the warning can be `allow`ed.
2021-01-18 16:44:40 -05:00
Aleksey Kladov
f459375f48 Better fixture highlight 2021-01-07 19:11:27 +03:00
Mara Bos
4833972067 Add support for Rust 2021. 2021-01-01 17:22:23 +01:00
Jonas Schievink
70877428a8 Pass crate environment to proc macros 2020-12-27 15:29:47 +01:00