Commit Graph

56 Commits

Author SHA1 Message Date
oxalica
6a2f83a8a2
Impl HirDisplay for SelfParam 2023-08-09 02:26:44 +08:00
Lukas Wirth
bcff166b3a Add ExternCrateDecl to HIR 2023-08-02 11:52:55 +02:00
hkalbasi
3a1054fc1c Replace x with it 2023-07-06 17:33:17 +03:30
Lukas Wirth
dc7c6d43c7 Slightly shrink DefMap 2023-06-01 14:46:36 +02:00
Lukas Wirth
c7ef6c25b7 internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
Lukas Wirth
a1b96b1e00 Remove unnecessary Names from FunctionData::params 2023-04-06 20:14:51 +02:00
Lukas Wirth
8e7c104b3a Move hir_def::adt to hir_def::data::adt 2023-04-06 19:23:29 +02:00
Ryo Yoshida
29c957f973
Lower and handle trait aliases in HIR 2023-03-04 00:24:07 +09:00
Ryo Yoshida
d4166234ef
Adjust block-local impl item visibility rendering 2023-02-20 00:44:51 +09:00
Ryo Yoshida
443801755c
Refactor
- Remove unnecessary references and derefs
- Manual formatting
2023-02-19 23:55:49 +09:00
Lukas Wirth
1535881836 Replace SmolStr usage with lang item enum for lang items 2023-01-21 17:55:45 +01:00
Lukas Wirth
27ba598dfe Make inlay hint location links work for more types 2023-01-14 13:30:56 +01:00
Yuri Astrakhan
e16c76e3c3 Inline all format arguments where possible
This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.

The change was automatically created with, so there are far less change
of an accidental typo.

```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2022-12-24 14:36:10 -05:00
Lukas Wirth
77cfc9b392 Fix type alias hovers not rendering generic parameters 2022-10-01 00:21:29 +02:00
Amos Wenger
7e285e1ef5 Run cargo fmt 2022-07-20 15:06:15 +02:00
Amos Wenger
816f7fe12a Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
Lukas Wirth
7ff6c36716 fix: Don't show qualified path completions for private items 2022-07-15 13:30:43 +02:00
Lukas Wirth
4f97950595 fix: Fix uncorrect use of double braces in HirDisplay implementations 2022-05-02 12:39:38 +02:00
Jonas Schievink
5d8b4c40eb Determine function unsafety semantically 2022-04-07 18:33:03 +02:00
Laurențiu Nicola
bd570903b0 Add and use HirFormatter::write_{str,char} 2022-04-07 16:41:07 +03:00
hkalbasi
b301b040f5 Add const generics 2022-03-14 14:38:37 +03:30
Lukas Wirth
6c8c02f625 Don't parse source files to generate macro completion details 2022-03-10 22:21:58 +01:00
hkalbasi
1282178783 insert dummy values for const generics in subst 2022-03-09 02:02:42 +03:30
Andy Russell
49fab593ad
show variadic args in hover function signature 2022-03-04 16:44:31 -05:00
hkalbasi
4fa8749c44 Preserve order of generic args 2022-03-04 11:46:14 +03:30
Lukas Wirth
661d721e20 Add completion module tailored towards use trees 2022-02-03 15:51:57 +01:00
Florian Diebold
4ed5fe1554 Fix assoc type shorthand from method bounds
In code like this:
```rust
impl<T> Option<T> {
    fn as_deref(&self) -> T::Target where T: Deref {}
}
```

when trying to resolve the associated type `T::Target`, we were only
looking at the bounds on the impl (where the type parameter is defined),
but the method can add additional bounds that can also be used to refer
to associated types. Hence, when resolving such an associated type, it's
not enough to just know the type parameter T, we also need to know
exactly where we are currently.

This fixes #11364 (beta apparently switched some bounds around).
2022-02-03 13:15:02 +01:00
Lukas Wirth
cd9d76e0ca internal: Store function param names in ItemTree 2021-12-20 15:24:37 +01:00
Laurențiu Nicola
32b6f103a6 Bump chalk 2021-12-19 18:58:39 +02:00
Lukas Wirth
1bbc255ec5 Remove some allocations 2021-12-10 20:01:24 +01:00
Jake Heinz
7cbc6ae920 ide: hover omits unnamed where preds 2021-11-20 11:45:12 +00:00
Lukas Wirth
7776aad166 internal: Flatten Definition::ModuleDef variant 2021-11-11 00:05:53 +01:00
Jonas Schievink
3aa37d7f80 Avoid cycle when lowering predicates for associated item lookup 2021-10-04 17:39:55 +02:00
Lukas Wirth
b6ed91a6de Rename *Owner traits to Has* 2021-09-27 12:54:24 +02:00
Dawer
dfb15292c2 fix: Type param hover shows correct sized bounds. 2021-09-10 20:48:39 +05:00
Dawer
5f2486e9a8 Handle impl ?Sized. Fix tests. 2021-08-04 20:20:10 +05:00
Dawer
421979bc68 HirDisplay prints ?Sized bounds now; impl Trait: Sized by default. 2021-08-04 20:05:46 +05:00
Dawer
3981373b93 internal: add implicit Sized bounds to type parameters. 2021-08-04 19:04:21 +05:00
Laurențiu Nicola
2268a220e4 Don't store supertraits in ItemTree 2021-05-27 16:52:30 +03:00
Jonas Schievink
8ebb8d29e1 internal: intern TypeBounds
Doesn't save much memory (~2 mb), but interning things is generally a
good pattern to follow
2021-05-24 15:13:23 +02:00
Aleksey Kladov
cb3ef552e8 internal: normalize name
All def types in hir are unsubstituted
2021-04-30 11:52:31 +03:00
Florian Diebold
30a339e038 Add Interner parameter to Binders::substitute 2021-04-05 19:21:01 +02:00
Florian Diebold
05eba0db3d Binders::subst -> substitute 2021-04-05 19:20:28 +02:00
Florian Diebold
ebdfc932e7 Replace Substitution::type_params 2021-04-04 13:16:39 +02:00
Jonas Schievink
ee4b5a34d8 Use bitflags to compress function properties
Very minor savings, only 1 MB or so
2021-04-03 20:58:42 +02:00
Jonas Schievink
b00266b79f Global TypeRef/TraitRef interning 2021-04-01 19:46:43 +02:00
Florian Diebold
c4fd3f47f5 Align InEnvironment with Chalk
This in particular means storing a chalk_ir::Environment, not our
TraitEnvironment. This makes InEnvironment not usable for Type, where we
need to keep the full TraitEnvironment.
2021-03-21 20:19:07 +01:00
Florian Diebold
1d5c4a77fb Use QuantifiedWhereClause in generic_predicates as well
Still far too much binder skipping going on; I find it hard to imagine
this is all correct, but the tests pass.
2021-03-21 18:01:14 +01:00
Florian Diebold
590c416359 Introduce QuantifiedWhereClause and DynTy analogous to Chalk
This introduces a bunch of new binders in lots of places, which we have
to be careful about, but we had to add them at some point.
2021-03-21 18:01:14 +01:00
Florian Diebold
ce2cae45b5 Rename Substs -> Substitution 2021-03-16 17:58:17 +01:00