Moritz Vetter
cad0cf6950
refactor helper function to work with function taking expression enum instead of break expression
2022-02-24 18:58:14 +01:00
Lukas Wirth
8db88df758
simplify and document
2022-02-22 10:45:29 +01:00
Lukas Wirth
f13c98034b
Make replace_derive_with_manual_impl work again
2022-02-22 10:20:44 +01:00
bors[bot]
979b5b32bc
Merge #11455
...
11455: Handle proc-macro functions as the proc-macro they resolve to r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11212
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-21 16:56:37 +00:00
Chayim Refael Friedman
13ac5c3491
Fix various IDE features
...
As a side benefit, we got `let` guard support for `move_guard` for free.
2022-02-21 08:34:35 +02:00
Lukas Wirth
cef8a17ea5
Handle proc-macro functions as the proc-macro they resolve to
2022-02-11 22:06:03 +01:00
Lukas Wirth
82fccb971e
feat: Add very simplistic ident completion for format_args! macro input
2022-01-15 12:23:26 +01:00
Lukas Wirth
6b7b09d329
internal: Record unresolved derive invocations in hir
2022-01-02 23:44:23 +01:00
Aleksey Kladov
bfc263f1f9
introduce hacks module
2021-12-28 18:57:13 +03:00
Aleksey Kladov
621ba1c2d3
import style
2021-12-28 13:52:40 +03:00
bors[bot]
3f550d2e38
Merge #11000
...
11000: fix: insert whitespaces into assoc items for assist when macro generated r=Veykril a=Veykril
This is obviously only a temporary hack which still produces ugly looking items, but as long as the syntax is valid one can at least have rustfmt fix the formatting again.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6588
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-13 15:43:12 +00:00
Lukas Wirth
749eeef3e7
fix: insert whitespaces into assoc items for assist when macro generated
2021-12-13 16:35:32 +01:00
Lukas Wirth
328419534d
Move ws insert rendering for macro expansion into ide_db
2021-12-13 15:55:13 +01:00
Lukas Wirth
0001a42570
fix: Fix lint completions not working for unclosed attributes
2021-12-11 15:55:25 +01:00
rainy-me
0bb08ccb8f
fix: derive path handling
2021-11-25 00:21:29 +09:00
Emil Gardström
3dc898389f
Make lint groups work correctly with warningsAsInfo
and warningsAsHint
2021-11-22 18:38:28 +01:00
Lukas Wirth
a510021065
Replace some more ide usages of ModuleDef with Definition
2021-11-11 18:20:54 +01:00
Lukas Wirth
439a8194b0
Replace more Name::to_string usages with Name::to_smol_str
2021-11-04 18:12:05 +01:00
Lukas Wirth
3018ffd85e
Refactor ide handling for paths in derive inputs
2021-10-28 16:47:19 +02:00
Lukas Wirth
aa9d093488
Resolve derive attributes even when shadowed
2021-10-19 13:42:36 +02:00
Lukas Wirth
b6ed91a6de
Rename *Owner
traits to Has*
2021-09-27 12:54:24 +02:00
Aleksey Kladov
2bf81922f7
internal: more reasonable grammar for blocks
...
Consider these expples
{ 92 }
async { 92 }
'a: { 92 }
#[a] { 92 }
Previously the tree for them were
BLOCK_EXPR
{ ... }
EFFECT_EXPR
async
BLOCK_EXPR
{ ... }
EFFECT_EXPR
'a:
BLOCK_EXPR
{ ... }
BLOCK_EXPR
#[a]
{ ... }
As you see, it gets progressively worse :) The last two items are
especially odd. The last one even violates the balanced curleys
invariant we have (#10357 ) The new approach is to say that the stuff in
`{}` is stmt_list, and the block is stmt_list + optional modifiers
BLOCK_EXPR
STMT_LIST
{ ... }
BLOCK_EXPR
async
STMT_LIST
{ ... }
BLOCK_EXPR
'a:
STMT_LIST
{ ... }
BLOCK_EXPR
#[a]
STMT_LIST
{ ... }
2021-09-26 19:16:09 +03:00
Lukas Wirth
151afdfe5c
Remove inherent methods from ast node that carry semantic meaning
2021-09-26 16:49:03 +02:00
Lukas Wirth
b7d7dd6163
Implement bool_then_to_if
assist
2021-08-10 13:17:45 +02:00
Jade
e3a67ccec6
tree-wide: fix rustdoc warnings, add some links
2021-08-03 21:34:20 -07:00
Lukas Wirth
1edbaa29f9
Wrap inner tail expressions in MissingOkOrSomeInTailExpr
2021-07-31 20:00:09 +02:00
Lukas Wirth
bfe0fa009e
Resolve derive attribute input macro paths in ide layer
2021-07-24 20:35:43 +02:00
mahdi-frms
7bae9c9187
add 'for' postfix completion
2021-07-11 17:10:57 +04:30
Lukas Wirth
26dd0c4e5b
wrap_return_type_in_result works on the HIR
2021-07-02 23:19:32 +02:00
Lukas Wirth
3ce5c66ca1
Deduplicate ast expression walking logic
2021-06-27 01:11:57 +02:00
Lukas Wirth
f615efdfc3
Factor out pick_best_token
ide pattern into ide_db
2021-06-22 17:50:15 +02:00
Aleksey Kladov
66673eae2b
internal: retire famous_defs_fixture
...
This is now done declaratively via `minicore`.
2021-06-18 00:42:32 +03:00
Lukas Wirth
343df88ac7
Generate default lint completions
2021-06-04 18:35:19 +02:00
Lukas Wirth
050c69c19d
Split out merge_imports module from helpers::insert_use
2021-04-24 13:31:43 +02:00
Lukas Wirth
2f62c0117a
Check for rust doc code attributes like rustdoc does
2021-04-19 13:32:52 +02: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
41745f48d5
move Semantics::visit_file_defs to ide_db::helpers
2021-03-15 12:18:52 +01:00
Kirill Bulatov
d386481fac
Fix some tests
2021-03-08 23:59:20 +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
Jonas Schievink
5d99ba1d9a
Make ModPath
's representation private
2021-02-04 20:49:24 +01:00
Kirill Bulatov
6742f38e49
Share import_assets and related entities
2021-01-16 19:33:36 +02:00
Lukas Wirth
e9e3ab549d
Move FamousDefs fixture out into its own file
2021-01-12 17:26:08 +01:00
Aleksey Kladov
f8a0561178
Align config's API with usage
...
The config now is mostly immutable, optimize for that.
2021-01-06 21:22:24 +03:00
Kirill Bulatov
3f612d37c6
Move the helpers into ide_db
2020-11-28 16:30:39 +02:00