Florian Diebold
d6195fa21f
Fix completion of HashMap::new
...
The `ty` function in code_model returned the type with placeholders for type
parameters. That's nice for printing, but not good for completion, because
placeholders won't unify with anything else: So the type we got for `HashMap`
was `HashMap<K, V, T>`, which doesn't unify with `HashMap<?, ?, RandomState>`,
so the `new` method wasn't shown.
Now we instead return `HashMap<{unknown}, {unknown}, {unknown}>`, which does
unify with the impl type. Maybe we should just expose this properly as variables
though, i.e. we'd return something like `exists<type, type, type> HashMap<?0,
?1, ?2>` (in Chalk notation). It'll make the API more complicated, but harder to
misuse. (And it would handle cases like `type TypeAlias<T> = HashMap<T, T>` more
correctly.)
2020-03-13 13:04:32 +01:00
Aleksey Kladov
680182d0a0
Restore cargo-fmt gating
2020-03-13 12:54:32 +01:00
Josh Mcguigan
7208498d54
fix issue 3444
2020-03-12 17:16:28 -07:00
Aleksey Kladov
100cbc57ce
Simplify
2020-03-09 11:19:03 +01:00
Aleksey Kladov
0320ebdd10
Use Index
for CrateGraph
2020-03-09 11:11:59 +01:00
bors[bot]
57c27f9139
Merge #3519
...
3519: Show mod path on hover r=matklad a=SomeoneToIgnore
Closes #1064
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-03-09 09:33:46 +00:00
Kirill Bulatov
e1aa96f2c5
Less abstract CrateData api
2020-03-09 11:26:46 +02:00
Florian Diebold
05e1c7b197
Handle visibility for assoc item path completion as well
2020-03-08 15:15:46 +01:00
Florian Diebold
d9c77c5453
Handle visibility for path completion (not in all cases yet)
2020-03-08 10:51:40 +01:00
Florian Diebold
734e68da4c
Handle visibility in method call completion
2020-03-07 23:03:56 +01:00
Kirill Bulatov
32f5276465
Show mod path in hover tooltip
2020-03-07 23:20:18 +02:00
Aleksey Kladov
7d71cc72b5
Refactor reference search a bit
2020-03-03 18:22:52 +01:00
Aleksey Kladov
a1e1869554
Rename ast::ImplBlock -> ast::ImplDef
2020-02-29 21:33:15 +01:00
Aleksey Kladov
14ea21617a
Minor
2020-02-29 18:34:34 +01:00
Aleksey Kladov
28332d9b63
Simplify SourceBinder
2020-02-29 18:32:18 +01:00
Aleksey Kladov
86b66067f6
Don't store deriveable Module info in NameDefinition
2020-02-19 14:32:22 +01:00
Kirill Bulatov
eceaf94f19
More manual clippy fixes
2020-02-18 16:12:37 +02:00
Kirill Bulatov
b8ddcb0652
Run cargo +nightly fix --clippy -Z unstable-options
2020-02-18 16:03:08 +02:00
adamrk
04aff742b1
show names for record fields in enum completion
2020-02-16 16:10:23 +01:00
Kirill Bulatov
f65daf23df
Revert source_analyzer changes
2020-02-12 17:34:37 +02:00
Kirill Bulatov
afc1d18ff3
Fix post-rebase issues
2020-02-12 17:18:42 +02:00
Kirill Bulatov
d5c3808545
Support trait method call autoimports
2020-02-12 17:18:42 +02:00
Kirill Bulatov
8f959f20ee
Trait location draft
2020-02-12 17:18:42 +02:00
Aleksey Kladov
225fc353af
Add more hir APIs for associated items
2020-02-12 15:31:44 +01:00
Florian Diebold
dded90a748
Formatting
2020-02-07 18:28:10 +01:00
Florian Diebold
0718682cff
Fix compilation of other crates
2020-02-07 18:28:10 +01:00
Florian Diebold
93aa166748
wip lower impl trait to type args
2020-02-07 18:28:10 +01:00
Florian Diebold
7ea4bce1b2
Add impl trait lowering mode
2020-02-07 18:28:10 +01:00
Florian Diebold
22a65b11b3
Introduce TyLoweringContext
2020-02-07 18:28:10 +01:00
Kirill Bulatov
d3188769e4
Auto import functions
2020-02-01 22:13:02 +02:00
Aleksey Kladov
21ea62d292
Don't parse child modules when doing diagnostics
2020-01-15 14:42:57 +01:00
Aleksey Kladov
a38540771f
Move Type API to type
2020-01-14 14:42:52 +01:00
Aleksey Kladov
52e7f67128
Move impls_future to Type, where it belongs
2020-01-14 11:29:43 +01:00
Edwin Cheng
d7be1a4372
Use attr location for builtin macro goto-imp
2020-01-12 18:08:53 +08:00
Florian Diebold
4496e2a06a
Apply review suggestions
2020-01-11 23:33:04 +01:00
Florian Diebold
4d75430e91
Qualify some paths in 'add missing impl members'
2020-01-11 23:33:04 +01:00
Michal Terepeta
100c2d0127
Add profile
calls to {Module,Function}::diagnostics
...
With this change the output `ra_prof` gives a better indication where
the time is spent. Example output:
```
213ms - publish_diagnostics
213ms - diagnostics
70ms - Module::from_definition
70ms - Module::from_file
132ms - Module::diagnostics
78ms - Function::diagnostics
0ms - body_with_source_map_query (1 calls)
2ms - trait_solve_query (1 calls)
76ms - ???
15ms - Function::diagnostics
0ms - body_with_source_map_query (1 calls)
15ms - trait_solve_query (5 calls)
38ms - Function::diagnostics (51 calls)
8ms - parse_query (1 calls)
```
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 12:50:35 +01:00
Florian Diebold
9fd2c813ca
visible_from -> is_visible_from
2019-12-27 11:25:04 +01:00
Florian Diebold
78111620a3
Remove visibility query, instead add struct field visibility to data
...
Methods should be handled the same, and for items the visibility will be in the
def map.
2019-12-26 16:23:40 +01:00
Florian Diebold
50ebff257d
Rename ResolvedVisibility -> Visibility
2019-12-26 16:23:40 +01:00
Florian Diebold
ca15cf422c
Add visibility in code model for fields
2019-12-26 16:23:40 +01:00
Florian Diebold
c39352fa43
Fill in type params in 'add missing impl members' assist
2019-12-24 17:29:27 +01:00
Aleksey Kladov
6c3ddcfa50
Simplify
2019-12-22 15:37:53 +01:00
Aleksey Kladov
4e0168ec14
Remove imports from hir
2019-12-21 15:18:14 +01:00
Aleksey Kladov
973b5cf7e2
Revert "Merge #2629 "
...
This reverts commit cdc9d682b0
, reversing
changes made to 90ef070db3
.
2019-12-21 15:04:33 +01:00
Aleksey Kladov
67ba9072fa
Remove hir for imports
2019-12-21 12:18:20 +01:00
Aleksey Kladov
1b8ce5b37b
Move impls to ItemScope
2019-12-20 16:52:02 +01:00
Aleksey Kladov
1234dda9ee
Use generic ItemLoc for impls
2019-12-20 13:47:44 +01:00
Aleksey Kladov
f42697e54b
Support for nested traits
2019-12-20 12:29:25 +01:00
Aleksey Kladov
ac5a3f611b
Support for nested ADT
2019-12-20 12:20:49 +01:00