Jonas Schievink
f96c1a0414
Implement per-edition preludes
2021-06-01 13:39:19 +02:00
Kirill Bulatov
050c592b8c
Exclude inherent traits more eagerly
2021-05-27 02:00:23 +03:00
Lukas Tobias Wirth
da7f1eb756
Don't compare ast::Visibility by stringifying
2021-05-20 17:45:59 +02:00
Lukas Tobias Wirth
2bf720900f
Check for differing attributes in granularity guessing
2021-05-20 10:25:04 +02:00
Lukas Tobias Wirth
b4fe479236
Replace ImportGranularity::Guess with guessing boolean flag
2021-05-19 15:57:10 +02:00
Lukas Tobias Wirth
5fd9f6c7b9
Add ImportGranularity::Guess
2021-05-18 20:21:47 +02:00
Lukas Tobias Wirth
b8a99692d1
Implement import-granularity guessing
2021-05-18 20:10:39 +02:00
Lukas Tobias Wirth
64f7072c25
MergeBehavior -> ImportGranularity
2021-05-18 19:53:20 +02:00
Aleksey Kladov
73123a7550
internal: remove SyntaxRewriter
2021-05-14 16:40:11 +03:00
Aleksey Kladov
0650f77dd9
internal: remove one more immutable tree
2021-05-14 16:19:27 +03:00
Lukas Wirth
6a8d47e7f0
Give MergeBehaviour variants better names
2021-05-10 21:14:59 +02:00
Aleksey Kladov
4f3c0adc5a
internal: introduce ast::make::ext
module with common shortcuts
...
There's a tension between keeping a well-architectured minimal
orthogonal set of constructs, and providing convenience functions.
Relieve this pressure by introducing an dedicated module for
non-orthogonal shortcuts.
This is inspired by the django.shortcuts module which serves a similar
purpose architecturally.
2021-05-09 19:55:43 +03:00
Lukas Wirth
050c69c19d
Split out merge_imports module from helpers::insert_use
2021-04-24 13:31:43 +02:00
Lukas Wirth
b290cd5782
Add cov_marks to insert_use tests
2021-04-20 19:34:43 +02:00
Lukas Wirth
fa20a5064b
Remove SyntaxRewriter usage in insert_use in favor of ted
2021-04-20 02:09:12 +02:00
Lukas Wirth
2f62c0117a
Check for rust doc code attributes like rustdoc does
2021-04-19 13:32:52 +02:00
bors[bot]
3f432730df
Merge #8467
...
8467: Adds impl Deref assist r=jhgg a=jhgg
This PR adds a new `generate_deref` assist that automatically generates a deref impl for a given struct field.
Check out this gif:
![2021-04-11_00-33-33](https://user-images.githubusercontent.com/5489149/114296006-b38e1000-9a5d-11eb-9112-807c01b8fd0a.gif )
--
I have a few Q's:
- [x] Should I write more tests, if so, what precisely should I test for?
- [x] I have an inline question on line 65, can someone provide guidance? :)
- [x] I can implement this for `ast::TupleField` too. But should it be a separate assist fn, or should I try and jam both into the `generate_deref`?
- [x] I want to follow this up with an assist on `impl $0Deref for T {` which would automatically generate a `DerefMut` impl that mirrors the Deref as well, however, I could probably use some pointers on how to do that, since I'll have to reach into the ast of `fn deref` to grab the field that it's referencing for the `DerefMut` impl.
Co-authored-by: jake <jh@discordapp.com>
2021-04-19 04:54:04 +00:00
Kirill Bulatov
739edfd5cf
Exclude inherent traits from flyimports
2021-04-16 11:13:17 +03:00
jake
a624e2ea8d
Adds impl Deref assist
2021-04-11 00:42:05 -07:00
Graeme Coupar
ee03849017
Convert Into to From assist
...
This adds a "Convert Into to From" assist, useful since clippy has
recently started adding lints on every `Into`.
It covers converting the signature, and converting any `self`/`Self`
references within the body to the correct types.
It does assume that every instance of `Into` can be converted to a
`From`, which I _think_ is the case now. Let me know if there's
something I'm not thinking of and I can try and make it smarter.
2021-04-03 15:48:35 +01:00
Lukas Wirth
c2a63b97a8
Rename target_ty to self_ty
2021-03-29 17:47:47 +02:00
Lukas Wirth
1ef55002c2
Cleanup ide_db imports
2021-03-27 21:51:00 +01:00
cynecx
5ff3299dd6
syntax: return owned string instead of leaking string
2021-03-26 18:30:59 +01:00
Aleksey Kladov
9cbf09ec4f
rewrite merge use trees assist to use muatable syntax trees
...
changelog internal
2021-03-22 20:47:46 +03:00
Edwin Cheng
7784cadc3d
Reexport PrefixKind to remove deps to hir
2021-03-22 13:39:13 +08:00
Kirill Bulatov
eaa4fcbbde
Less reallocations
2021-03-21 11:45:37 +02:00
Kirill Bulatov
56a7d246d5
Disable unqualified assoc items completion for now
2021-03-20 23:08:44 +02:00
Kirill Bulatov
879432452d
Docs
2021-03-20 22:55:34 +02:00
Kirill Bulatov
a631108d2d
Do not query item search by name eagerly
2021-03-20 22:33:54 +02:00
Kirill Bulatov
81961dc035
Do not propose assoc items without qualifiers
2021-03-20 22:18:43 +02:00
Lukas Wirth
34464ede3f
Fix associated items not being appended to paths in import_assets
2021-03-18 21:36:52 +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
Kirill Bulatov
778deb38fe
Better strip turbofishes
2021-03-08 23:59:39 +02:00
Kirill Bulatov
5168ab16e1
Add rustdocs and use better names
2021-03-08 23:59:37 +02:00
Kirill Bulatov
dccbb38d2e
Less lifetines: derive SemanticsScope in place
2021-03-08 23:59:20 +02:00
Kirill Bulatov
84c575a212
Restrict fuzzy qualifiers for now
2021-03-08 23:59:20 +02:00
Kirill Bulatov
5b7d928075
Enforce the located imports' order
2021-03-08 23:59:20 +02:00
Kirill Bulatov
24a5d3b19d
Fix the completion labels and tests
2021-03-08 23:59:20 +02:00
Kirill Bulatov
33c83e72b9
Work towards better import labels
2021-03-08 23:59:20 +02:00
Kirill Bulatov
4d4ac1d4fa
Profile import_assets better
2021-03-08 23:59:20 +02:00
Kirill Bulatov
e214c3a6bd
Simplify
2021-03-08 23:59:20 +02:00
Kirill Bulatov
e74c55bb4a
Refactor the import location
2021-03-08 23:59:20 +02:00
Kirill Bulatov
89d410cef5
Do not propose already imported imports
2021-03-08 23:59:20 +02:00
Kirill Bulatov
9482353fa8
Properly handle turbofishes in qualifiers
2021-03-08 23:59:20 +02:00
Kirill Bulatov
d386481fac
Fix some tests
2021-03-08 23:59:20 +02:00
Kirill Bulatov
582cee2cdf
Return more data about located imports
2021-03-08 23:59:18 +02:00
Kirill Bulatov
309421c117
Draft the qualifier import resolution
2021-03-08 23:58:48 +02:00
Kirill Bulatov
c395c3311d
Filter out path items by the qualifier
2021-03-08 23:58:33 +02:00
Kirill Bulatov
f08c0cdd2a
Simplify
2021-03-08 23:58:33 +02:00
Kirill Bulatov
7584260b9a
Find the code to change
2021-03-08 23:58:33 +02:00
Kirill Bulatov
005bc49d74
Test and initial refactoring
2021-03-08 23:58:32 +02:00
Laurențiu Nicola
fc9eed4836
Use upstream cov-mark
2021-03-08 22:19:44 +02:00
asv
96fc01a30b
Make group imports configurable
2021-03-07 10:15:17 +02:00
Lukas Wirth
8d305680e6
Show docs on hover for keywords and primitives
2021-03-02 14:41:01 +01:00
lbrande
9db970ee08
De Morgan's Law assist now correctly inverts <, <=, >, >=.
2021-02-24 11:58:37 +01:00
Aleksey Kladov
46b4f89c92
.
2021-01-20 01:56:11 +03:00
bors[bot]
342bf41022
Merge #7297 #7338
...
7297: Propose trait associated items and autoimport traits on completion r=matklad a=SomeoneToIgnore
![trait_imports](https://user-images.githubusercontent.com/2690773/104819998-6faeb480-583a-11eb-8b45-b7351b51b90e.gif )
Closes #7248
7338: Parse `impl const Trait` r=Veykril a=Veykril
Closes #7313
bors r+
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-01-18 19:40:11 +00:00
bors[bot]
9eb37fbdeb
Merge #7292
...
7292: Swap assert_eq_text\!(expected, actual) r=matklad a=u5surf
Fixes #7283
Swap assert_eq_text parameters in the order (expected, actual)
Co-authored-by: yugo-horie <u5.horie@gmail.com>
2021-01-18 10:12:54 +00:00
Kirill Bulatov
09c11054a1
Do trait solving in batch
2021-01-17 02:57:38 +02:00
Kirill Bulatov
68626e4ef5
Draft the working completion
2021-01-17 02:57:34 +02:00
Kirill Bulatov
db335a1bbf
Add flyimport completion for trait assoc items
2021-01-16 20:44:12 +02:00
Kirill Bulatov
6742f38e49
Share import_assets and related entities
2021-01-16 19:33:36 +02:00
yugo-horie
f273995a25
Swap assert_eq_text\!(expected, actual)
2021-01-16 13:30:26 +09:00
unexge
a3a722de9f
Add Unmerge Use assist
2021-01-15 22:14:51 +03:00
Lukas Wirth
cb863390f2
Handle self/super/crate in PathSegment as NameRef
2021-01-15 19:21:23 +01:00
Lukas Wirth
3d6480bc31
Render Fn* trait objects and impl types as rust does
2021-01-13 13:29:47 +01:00
Lukas Wirth
e9e3ab549d
Move FamousDefs fixture out into its own file
2021-01-12 17:26:08 +01:00
Jesse Bakker
700034bd5a
Do not merge imports with different attributes
2020-12-18 15:29:37 +01:00
Aleksey Kladov
17f236c2b0
Normalize spelling to American English
2020-12-10 17:51:56 +03:00
Daiki Ihara
f486640682
Extract tests module to file in ide_db crate
2020-12-04 00:05:39 +09:00
Lukas Wirth
ec94657077
Fix use merging not using the first path segment
2020-11-30 17:21:07 +01:00
Kirill Bulatov
3f612d37c6
Move the helpers into ide_db
2020-11-28 16:30:39 +02:00