DropDemBits
df629627c5
Add tests for LetStmt::set_ty
2023-11-14 17:35:24 -05:00
DropDemBits
787ca888e3
Add IdentPat::set_pat
...
Needed so that the `tuple_pat` node gets added to the syntax tree,
which is required as we're using structured snippets.
2023-11-13 20:41:06 -05:00
Young-Flash
3e5bc9a9c8
impl qualifying_trait
for PathSegment
2023-11-13 18:14:00 +08:00
Young-Flash
23fde40fed
fix PathSegment
grammar
2023-11-12 11:20:14 +08:00
DropDemBits
4aaa592a9a
Migrate destructure_tuple_binding
to mutable ast
...
Due to the way the current tree mutation api works, we need to collect
changes before we can apply them to the real syntax tree, and also can only
switch to a file once.
`destructure_tuple_binding_in_sub_pattern` also gets migrated even
though can't be used.
2023-11-11 21:07:19 -05:00
DropDemBits
5fc8cc52e2
Add LetStmt::set_ty
...
Way for setting and removing the type ascription of a let stmt
2023-11-11 21:05:27 -05:00
DropDemBits
92422f7488
Use syntax's version of SyntaxElement
2023-11-11 21:05:27 -05:00
DropDemBits
02c7b8b9ba
Add MethodCallExpr::get_or_create_generic_arg_list
...
Mirrors `PathSegment's` version, except that it always generates a
turbofish
2023-11-11 21:05:26 -05:00
Laurențiu Nicola
d1d111d09e
Merge commit '3b7c7f97e4a7bb253a8d398ee4f8346f6cf2817b' into sync-from-ra
2023-11-08 08:15:03 +02:00
Young-Flash
8d8d12120d
feat: add generate_mut_trait_impl assist
2023-11-05 12:27:10 +08:00
cui fliter
9c99afe3aa
Fix some typos
...
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-30 10:31:50 +08:00
bohan
d20471334f
use visibility to check unused imports and delete some stmts
2023-10-22 21:27:46 +08:00
Lukas Wirth
88a00bf49d
Shrink PatPtr by swapping its AstPtr and Either wrap order
2023-10-06 12:32:37 +02:00
Lukas Wirth
0dbde71159
Simplify
2023-09-26 12:25:59 +02:00
bors
df75809a85
Auto merge of #15484 - rmehri01:14779_bool_to_enum_assist, r=Veykril
...
feat: Bool to enum assist
This adds the `bool_to_enum` assist, which converts the type of boolean local variables, fields, constants and statics to a new `enum` type, making it easier to distinguish the meaning of `true` and `false` by renaming the variants.
Closes #14779
2023-09-22 07:19:12 +00:00
bors
11ffcc08a3
Auto merge of #15615 - shogo-nakano-desu:refactor/fix-clippy-lints, r=Veykril
...
Refactor/fix clippy lints
As title says.
2023-09-22 06:46:29 +00:00
Laurențiu Nicola
bcfc997eac
Merge commit '258b15c506a2d3ad862fd17ae24eaf272443f477' into sync-from-ra
2023-09-18 12:33:49 +03:00
hkalbasi
f4704bc8ae
Switch to in-tree rustc dependencies with a cfg flag
2023-09-15 18:10:11 +03:30
shogo-nakano-desu
0bb2298ac6
refactor: remove TODO with no explanation
2023-09-15 16:43:31 +09:00
shogo-nakano-desu
ebbbaaa90f
refactor: fix clippy lints
2023-09-15 16:43:21 +09:00
Ryan Mehri
d7a8e800c9
feat: initial version of bool_to_enum assist
2023-09-09 11:58:19 -07:00
Lukas Wirth
abe8f1ece4
Implement builtin#format_args, using rustc's format_args parser
2023-09-05 19:19:46 +02:00
Lukas Wirth
3431d586e5
Insert builtin#asm into asm! expansion
2023-09-05 14:00:49 +02:00
Lukas Wirth
15048304e3
Implement offset_of in hir-def and hir-ty
2023-09-05 12:27:52 +02:00
Lukas Wirth
9b8eb807a3
Parse builtin# syntax
2023-09-05 10:36:35 +02:00
Laurențiu Nicola
30d8aa1bec
Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra
2023-08-21 12:44:09 +03:00
bors
b771de3fdc
Auto merge of #15179 - ponyii:fix/default-values-of-const-params-are-ignored, r=HKalbasi
...
the "add missing members" assists: implemented substitution of default values of const params
To achieve this, I've made `hir::ConstParamData` store the default values
2023-08-15 10:17:43 +00:00
bors
7ca45dcf04
Auto merge of #15410 - alibektas:15240/invalid-demorgan, r=Veykril
...
internal : rewrite DeMorgan assist
fixes #15239 , #15240 . This PR is a rewrite of the DeMorgan assist that essentially rids of all the string manipulation and modifies syntax trees to apply demorgan on a binary expr. The main reason for the rewrite is that I wanted to use `Expr::needs_parens_in` method to see if the expr on which the assist is applied would still need the parens it had once the parent expression's operator had equal precedence with that of the expression. I used `.clone_(subtree|for_update)` left and right and probably more than I should have, so I would also be happy to hear how I could have prevented redundant cloning.
2023-08-15 07:29:28 +00:00
Lukas Wirth
e5b23e3bc1
Derive block attributes from block item tree
2023-08-10 18:52:27 +02:00
ponyii
4ebdc6f052
syntax update: the default value of ConstParam
turned from Expr
into ConstArg
2023-08-08 21:57:54 +04:00
ponyii
52b4392724
the "add missing members" assists: implemented substitution of default values of const params
2023-08-08 21:57:54 +04:00
Ali Bektas
ef5c6daf6e
Rewrite DeMorgan without str manipulation.
2023-08-08 15:49:27 +02:00
Lukas Wirth
cba39f8553
fix: Fix float parser hack creating empty NameRef tokens
2023-08-08 14:44:33 +02:00
Laurențiu Nicola
aa55ce9567
Merge commit 'baee6b338b0ea076cd7a9f18d47f175dd2ba0e5d' into sync-from-ra
2023-08-07 12:03:15 +03:00
bors
62dcf39ef0
Auto merge of #14723 - obsgolem:master, r=Veykril
...
Added remove unused imports assist
This resolves the most important part of #5131 . I needed to make a couple of cosmetic changes to the search infrastructure to do this.
A few open questions:
* Should imports that don't resolve to anything be considered unused? I figured probably not, but it would be a trivial change to make if we want it.
* Is there a cleaner way to make the edits to the use list?
* Is there a cleaner way to get the list of uses that intersect the current selection?
* Is the performance acceptable? When testing this on itself, it takes a good couple seconds to perform the assist.
* Is there a way to hide the rustc diagnostics that overlap with this functionality?
2023-08-01 09:50:16 +00:00
Lukas Wirth
7c765d9f9e
fix: Expand eager macros to delimited comma separated expression list
2023-07-30 17:31:26 +02:00
Laurențiu Nicola
0155385b57
Merge commit '99718d0c8bc5aadd993acdcabc1778fc7b5cc572' into sync-from-ra
2023-07-24 12:21:34 +03:00
oxalica
59a3e42ac9
Fix unescaping of C string literals
2023-07-18 18:52:34 +08:00
oxalica
de1f766820
Fix highlighting of byte escape sequences
...
Currently non-UTF8 escape sequences in byte strings and any escape
sequences in byte literals are ignored.
2023-07-17 22:52:58 +08:00
Laurențiu Nicola
4704881b64
Merge commit '37f84c101bca43b11027f30ab0c2852f9325bc3d' into sync-from-ra
2023-07-17 16:49:15 +03:00
bors
132ba2cf77
Auto merge of #15248 - Veykril:eager, r=Veykril
...
Fix eager token mapping panics
2023-07-13 07:39:30 +00:00
Lukas Wirth
6a7b905c86
Fix the eager token maps by re-mapping the textranges between the input and input expansion
2023-07-13 09:22:38 +02:00
DropDemBits
8c40fa33df
Add HasVisibilityEdit::set_visibility
2023-07-09 20:50:20 -04:00
Josiah Bills
7a87a35f1a
Added remove_unused_imports assist.
2023-07-09 17:44:27 -04:00
DropDemBits
419f641d49
add AttrsOwnerEdit::add_attr
2023-07-07 20:06:09 -04:00
DropDemBits
c0172333c2
add attr-related make
functions
2023-07-07 20:06:09 -04:00
bors
aa91eda902
Auto merge of #15152 - alibektas:14987, r=Veykril,lowr
...
assist : generate trait from impl
fixes #14987 . As the name suggests this assist is used to generate traits from inherent impls while adapting the original impl to fit to the newly generated trait. I made some decisions regarding when the assist should be applicable. These are surely open to discussion. I looking forward to any feedback.
![generate_trait_from_impl_v1](https://github.com/rust-lang/rust-analyzer/assets/20956650/05d4dda5-604a-4108-8b82-9b60bd45894a )
2023-07-05 16:56:37 +00:00
Ali Bektas
03423116ad
Generate trait from impl v2
2023-07-04 17:33:45 +02:00
Ali Bektas
677151e4e1
Version 1
2023-06-27 18:03:36 +02:00
Josh Stone
380773b3e8
Upgrade to indexmap v2
2023-06-24 17:35:20 -07:00
oxalica
2cd7b0cfce
Remove unused StmtList::push_front
2023-06-19 22:56:31 +08:00
oxalica
52f1ce17aa
Correctly handle inlining of async fn
2023-06-19 17:14:17 +08:00
Laurențiu Nicola
9326cf7f0c
Merge commit 'cd3bf9fe51676b520c546460e6d8919b8c8ff99f' into sync-from-ra
2023-06-19 09:14:04 +03:00
hkalbasi
f8594f78bb
Use ConstArg
instead of Expr
for AstId
of InTypeConstId
2023-06-11 00:39:28 +03:30
Laurențiu Nicola
c48062fe2a
Merge commit 'aa9bc8612514d216f84eec218dfd19ab83f3598a' into sync-from-ra
2023-06-05 12:04:23 +03:00
DropDemBits
dd5f05590e
Migrate extract_type_alias
to mutable ast
2023-06-05 00:24:12 -04:00
bors
e33c0b4b5e
Auto merge of #14842 - alibektas:internal/ast-make-improve, r=Veykril
...
Improve ast::make
Add `ty_alias` and make `impl_trait` , `fn` and `impl_` have more coverage.
2023-05-30 16:09:46 +00:00
Sebastian Ziebell
95f59668e6
Fix removal of generic param from list
...
This removes an existing generic param from the `GenericParamList`. It
also considers to remove the extra colon & whitespace to the previous
sibling.
* change order to get all param types first and mark them as mutable
before the first edit happens
* add helper function to remove a generic parameter
* fix test output
2023-05-26 13:13:15 +02:00
Sebastian Ziebell
59f8827a6f
Implement assist to replace named generic with impl
...
This adds a new assist named "replace named generic with impl" to move
the generic param type from the generic param list into the function
signature.
```rust
fn new<T: ToString>(input: T) -> Self {}
```
becomes
```rust
fn new(input: impl ToString) -> Self {}
```
The first step is to determine if the assist can be applied, there has
to be a match between generic trait param & function paramter types.
* replace function parameter type(s) with impl
* add new `impl_trait_type` function to generate the new trait bounds with `impl` keyword for use in the
function signature
2023-05-26 13:13:11 +02:00
bors
a512774fd9
Auto merge of #14752 - ponyii:fix/generate_derive_breaks_indentation, r=Veykril
...
fix: assists no longer break indentation
Fixes https://github.com/rust-lang/rust-analyzer/issues/14674
These are _ad hoc_ patches for a number of assists that can produce incorrectly indented code, namely:
- generate_derive
- add_missing_impl_members
- add_missing_default_members
Some general solution is required in future, as the same problem arises in many other assists, e.g.
- replace_derive_with...
- generate_default_from_enum...
- generate_default_from_new
- generate_delegate_methods
(the list is incomplete)
2023-05-24 18:58:07 +00:00
bors
2df56cadcb
Auto merge of #14755 - poliorcetics:clippy-fixes, r=Veykril
...
Fix: a TODO and some clippy fixes
- fix(todo): implement IntoIterator for ArenaMap<IDX, V>
- chore: remove unused method
- fix: remove useless `return`s
- fix: various clippy lints
- fix: simplify boolean test to a single negation
2023-05-24 11:13:52 +00:00
alibektas
51ec2ced69
Improve ast::make
...
Add `ty_alias` and make `impl_trait` , `fn` and `impl_` have more coverage.
2023-05-23 03:12:57 +02:00
Lukas Wirth
4b577e2bc8
Support c string literals
2023-05-18 11:06:05 +02:00
Lukas Wirth
099b5b3b15
internal: Bump rustc_lexer
2023-05-18 10:17:40 +02:00
ponyii
e07d6382de
add_missing_impl_members
no longer breaks indentation
2023-05-10 16:35:48 +04:00
Alexis (Poliorcetics) Bourget
d7fdf141a4
fix: various clippy lints
2023-05-07 09:43:37 +02:00
Ryo Yoshida
fa2340a4df
Parse associated return type bounds
2023-05-06 20:31:11 +09:00
Ryo Yoshida
d7d8971203
Remove (..)
-style return type notation
2023-05-06 20:30:17 +09:00
Laurențiu Nicola
7197a27028
Use triomphe Arc
2023-05-02 20:02:43 +03:00
bors
2feabc4dc4
Auto merge of #14622 - alibektas:make_ty_alias, r=alibektas
...
Add syntax::make::ty_alias
There was until now no function that returns TypeAlias. This commit introduces a func that is fully compliant with the Rust Reference. I had problems working with Ident so for now the function uses simple string manipulation until ast_from_text function is called. I am however open to any ideas that could replace ident param in such a way that it accepts syntax::ast::Ident
2023-04-22 11:43:42 +00:00
alibektas
e275f77b2c
Comment clean-up. Use display where possible
2023-04-22 13:23:52 +02:00
alibektas
caa13b3f95
Small changes in str formatting
2023-04-21 22:09:11 +03:00
bors
af3b6a0893
Auto merge of #14621 - alibektas:make_impl_trait_fix, r=Veykril
...
Simple fix for make::impl_trait
This is my first PR in this project. I made this PR because I needed this function to work properly for the main PR I am working on (#14386 ). This is a small amendment to what it was before. We still need to improve this in order for it to fully comply with its syntactic definition as stated [here](https://doc.rust-lang.org/reference/items/implementations.html ).
2023-04-21 18:25:42 +00:00
alibektas
7c9e4e10bc
Add syntax::make::ty_alias
...
The function is fully compliant with the specifications from the Rust Reference.
2023-04-21 21:19:36 +03:00
alibektas
4601331ceb
Simple fix for make::impl_trait
2023-04-21 20:46:57 +03:00
Josh Soref
bc7d84c3ce
Spelling
...
* a rule
* access
* after
* amount
* annotations
* assignment
* assist
* associated
* attribute
* borrowed
* built-in type
* clarification
* command
* const
* constructor
* corresponding
* counterparts
* curlies
* dependencies
* deterministic
* diagnostic
* duplicates
* edge
* edited
* efficient
* elsewhere
* execution
* expression
* extensions
* extracted
* fill
* github
* helper
* heuristic
* incomplete
* indent end
* inlay
* invocation
* lifetime
* looking
* maybe
* move
* mutability
* mutable
* necessarily
* necessary
* negative
* nonexistent
* occurred
* offsets
* offsetted
* overridden
* parameters
* params
* params_and_where_preds_in_scope
* paredit
* parent
* parentheses
* prepended if
* punctuation
* receive
* receiver
* referring
* repeated
* representing
* semantically
* separately
* shouldnot
* siblings
* similar
* something's
* statement
* struct
* structure
* surprise
* the
* this
* transparent
* unimplemented
* unnamed
* unnecessary
* unneeded
* unreachable
* unterminated
* utilities
* variant
* variants
* visibility
* work around (v)
* workaround
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-19 09:45:55 -04:00
Lukas Wirth
1456b53051
Bump smol-str
2023-04-11 14:39:19 +02:00
tamasfe
0b9c0c5088
feat(syntax): RTN in bounds
...
Limited syntactic support for experimental return type notations.
https://github.com/rust-lang/rust/issues/109417
2023-04-01 15:26:03 +02:00
bors
992a0fc074
Auto merge of #14403 - Veykril:dependencies, r=Veykril
...
internal: Bump Cargo.lock
2023-03-25 14:15:10 +00:00
Lukas Wirth
39e86e78c3
Bump Cargo.lock
2023-03-25 15:12:39 +01:00
Laurențiu Nicola
dbf04a5ee2
⬆️ rust-analyzer
2023-03-20 08:31:01 +02:00
hkalbasi
eb4939e217
Support overloaded deref MIR lowering
2023-03-17 14:02:55 +03:30
hkalbasi
9564773d5e
Improve pattern matching MIR lowering
2023-03-17 13:08:36 +03:30
Lukas Wirth
9fe206956f
fix: Fix ast::IfExpr child accessors
2023-03-15 14:34:31 +01:00
Lukas Wirth
228b44cb18
fix: Only skip adjustment hints for block, if and match expressions for reborrows
2023-03-13 16:10:49 +01:00
Laurențiu Nicola
b2f6fd4f96
⬆️ rust-analyzer
2023-03-13 10:42:24 +02:00
hkalbasi
ac04bfd7a7
Add View Mir
command and fix some bugs
2023-03-06 21:09:09 +03:30
Ryo Yoshida
356d12eae4
refactor: leverage HasAttrs
for code brevity
2023-03-04 00:24:03 +09:00
Ryo Yoshida
2e7d2c2d04
Parse trait alias as a distinct AST type
2023-03-04 00:23:56 +09:00
Ryo Yoshida
cf0c8fe000
minor: import Either
from either
2023-02-25 21:55:11 +09:00
Laurențiu Nicola
7e711da2f0
⬆️ rust-analyzer
2023-02-20 10:14:12 +02:00
Lukas Wirth
e550e553e0
fix: Bring back hovering call parens for return type info
2023-02-15 18:58:59 +01:00
Laurențiu Nicola
bc45c7659a
⬆️ rust-analyzer
2023-02-13 13:55:14 +02:00
Ryo Yoshida
92fdfb548e
Make is_raw_identifier()
public util function
2023-02-13 18:43:59 +09:00
Lukas Wirth
4788c7a056
Bump rustc-ap-rustc_lexer
2023-02-08 11:42:14 +01:00
bors
3bc33c7e9f
Auto merge of #14010 - silvergasp:ci, r=lnicola
...
fuzz: Fixes broken Cargo.toml for fuzz tests
Fixes broken Cargo.toml for fuzz tests and adds building of fuzz tests to the CI.
2023-02-03 11:15:54 +00:00
Ryo Yoshida
3edde6fcc1
Support generic function in generate_function
assist
2023-01-31 21:05:25 +09:00
Nathaniel Brough
6c4749e8f5
fix(fuzz): Fixes broken Cargo.toml for fuzz tests
...
Fixes broken Cargo.toml for fuzz tests and adds building of
fuzz tests to the CI.
2023-01-24 10:54:10 -08:00
Laurențiu Nicola
1431264646
Bump rayon
2023-01-21 14:05:22 +02:00
Laurențiu Nicola
392a6ee422
Bump once_cell
2023-01-21 08:48:46 +02:00
bors
d46d012c38
Auto merge of #13978 - bvanjoi:array-match, r=Veykril
...
feat: array match
fixed https://github.com/rust-lang/rust-analyzer/issues/13970
2023-01-20 10:30:18 +00:00
bvanjoi
8fa69f9f7d
feat: array match
2023-01-20 10:59:30 +08:00
onestacked
872408500b
Parse const_closures syntax.
...
Enables parsing of the syntax for `#![features(const_closures)]` introduced in https://github.com/rust-lang/rust/pull/106004
2023-01-19 15:40:07 +01:00
bors
fa874627f0
Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril
...
Use workspace.dependencies to declare local dependencies
2023-01-17 10:29:27 +00:00
Lukas Wirth
bed4db3c62
Use workspace.dependencies to declare local dependencies
2023-01-17 10:52:26 +01:00
Lukas Wirth
e4858fe480
Specify authors, edition and license via workspace.package
2023-01-16 16:44:00 +01:00
Lukas Wirth
679df2adf1
Specify rust-version via workspace.package
2023-01-16 16:33:01 +01:00
Maybe Waffle
cfc01150bf
implement AstNode
for Either
2023-01-14 12:45:20 +00:00
Daniel Eades
b971b5b64f
suppress lint
2023-01-10 07:06:26 +00:00
Daniel Eades
ef4debc8b1
comment out disabled code
2023-01-10 07:02:04 +00:00
arcnmx
25242fe93f
⬆️ rust-analyzer
...
Merge commit '368e0bb32f1178cf162c2ce5f7e10b7ae211eb26'
2023-01-09 10:36:22 -08:00
bors
ba204ef07b
Auto merge of #13863 - danieleades:approx-constant, r=Veykril
...
minor: suppress 'clippy::approx_constant' lint in test case
suppresses a false positive clippy lint
2023-01-09 14:53:46 +00:00
bors
938a39ab89
Auto merge of #13891 - bvanjoi:reverse-whitespace-in-assists, r=Veykril
...
fix: keep whitespace in extract function handler
Fixed #13874
2023-01-09 14:11:40 +00:00
bors
ae659125a5
Auto merge of #13763 - rami3l:fix/gen-partial-eq-generic, r=Veykril
...
fix: add generic `TypeBoundList` in generated derivable impl
Potentially fixes #13727 .
Continuing with the work in #13732 , this fix tries to add correct type bounds in the generated `impl` block:
```diff
enum Either<T, U> {
Left(T),
Right(U),
}
- impl<T, U> PartialEq for Either<T, U> {
+ impl<T: PartialEq, U: PartialEq> PartialEq for Either<T, U> {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Left(l0), Self::Left(r0)) => l0 == r0,
(Self::Right(l0), Self::Right(r0)) => l0 == r0,
_ => false,
}
}
}
```
2023-01-09 13:02:09 +00:00
bvanjoi
ae73628f6b
fix: keep whitespace in extract function handler
2023-01-04 22:10:17 +08:00
Daniel Eades
cc80c5bd07
remove unnecessary lazy evaluations
2023-01-02 15:02:54 +00:00
Daniel Eades
ed128872eb
remove needless borrows
2023-01-02 14:52:32 +00:00
Daniel Eades
77051679d7
use inline format args
2023-01-02 14:52:32 +00:00
Daniel Eades
b196e5b2f6
fixup
2022-12-31 09:26:58 +00:00
Daniel Eades
ba5067a6f0
suppress 'clippy::approx_constant' lint in test case
2022-12-30 11:28:06 +00:00
Maybe Waffle
346bf5fb5b
Implement do yeet
expression
2022-12-28 23:17:13 +00:00
Maybe Waffle
4a16afa264
Parse do yeet
expressions
2022-12-28 22:42:26 +00:00
Yuri Astrakhan
d3dbf9c194
Moar linting: needless_borrow, let_unit_value, ...
...
* There are a few needless borrows that don't seem to be needed. I even did a quick assembly comparison and posted a q to stackoveflow on it. See [here](https://stackoverflow.com/questions/74910196/advantages-of-pass-by-ref-val-with-impl-intoiteratoritem-impl-asrefstr )
* removed several `let _ = ...` when they don't look necessary (even a few ones that were not suggested by clippy (?))
* there were a few `then(|| ctor{})` that clippy suggested to replace with `then_some(ctor{})` -- seems reasonable?
* some unneeded assignment+return - keep the code a bit leaner
* a few `writeln!` instead of `write!`, or even consolidate write!
* a nice optimization to use `ch.is_ascii_digit` instead of `ch.is_digit(10)`
2022-12-25 05:07:47 -05: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
Maybe Waffle
babd4c7f7d
Don't panic in Expr::needs_parens_in
2022-12-20 15:16:26 +00:00
rami3l
cfa914958c
refactor: use generate_trait_impl_text_intransitive
for From
-like traits
2022-12-17 22:59:30 +08:00
rami3l
12b05d2416
fix: add generic TypeBoundList
in generated derivable impl
2022-12-14 19:18:05 +08:00
Maybe Waffle
7ed0871ff6
Fix "needs parens" check in remove_parentheses
assist
2022-12-13 00:06:00 +00:00
Maybe Waffle
8d42439a7d
Move precedence handling to crates/syntax
2022-12-08 18:46:30 +00:00
Laurențiu Nicola
a2a1d99545
⬆️ rust-analyzer
2022-11-23 17:24:03 +02:00
Michael Goulet
61c744d4fd
Rollup merge of #104211 - lnicola:rust-analyzer-2022-11-09, r=lnicola
...
⬆️ rust-analyzer
r? ``@ghost``
2022-11-09 21:53:38 -08:00
Laurențiu Nicola
79923c382a
⬆️ rust-analyzer
2022-11-09 21:49:10 +02:00
Dylan DPC
a65ca91b84
Rollup merge of #103919 - nnethercote:unescaping-cleanups, r=matklad
...
Unescaping cleanups
Some code improvements, and some error message improvements.
Best reviewed one commit at a time.
r? ````@matklad````
2022-11-09 19:21:22 +05:30
Nicholas Nethercote
7d2a1ee4fc
Remove unescape_byte_literal
.
...
It's easy to just use `unescape_literal` + `byte_from_char`.
2022-11-05 13:56:36 +11:00
Laurențiu Nicola
c60b1f6414
⬆️ rust-analyzer
2022-11-01 11:31:31 +02:00
Laurențiu Nicola
8807fc4cc3
⬆️ rust-analyzer
2022-10-26 17:40:41 +03:00
Laurențiu Nicola
a99a48e786
⬆️ rust-analyzer
2022-10-18 09:12:49 +03:00
Laurențiu Nicola
4f55ebbd4f
⬆️ rust-analyzer
2022-10-11 10:37:35 +03:00
Laurențiu Nicola
459bbb4222
⬆️ rust-analyzer
2022-09-13 15:38:11 +03:00
Laurențiu Nicola
65e1dc4d9c
⬆️ rust-analyzer
2022-09-06 21:20:49 +03:00
Laurențiu Nicola
31519bb394
⬆️ rust-analyzer
2022-08-23 10:05:52 +03:00
Laurențiu Nicola
8231fee466
⬆️ rust-analyzer
2022-08-16 11:24:50 +03:00
Laurențiu Nicola
22c8c9c401
⬆️ rust-analyzer
2022-08-09 07:23:57 +03:00
Laurențiu Nicola
9d2cb42a41
⬆️ rust-analyzer
2022-08-02 09:05:16 +03:00
Amos Wenger
74998e46e9
Fix .gitattributes for test_data
2022-07-24 14:05:35 +02:00
Amos Wenger
b351e115d6
Move cfg attrs up to the mod definitions to disable sourcegen
2022-07-24 10:38:34 +02:00
Amos Wenger
0bffdf2627
Disable all source-gen tests at compile time
2022-07-24 10:38:28 +02:00
Lukas Wirth
cb6703fe06
internal: Don't parse files unnecessarily in scope_for_offset
2022-07-23 00:50:59 +02:00
Amos Wenger
816f7fe12a
Run cargo fix --edition-idioms
2022-07-20 15:02:08 +02:00
Amos Wenger
23d25a3094
Enable extra warnings required by rust-lang/rust
2022-07-20 15:00:17 +02:00
Amos Wenger
1b416473a3
Upgrade to expect-test@1.4.0
...
cf. https://github.com/rust-analyzer/expect-test/issues/33
cf. https://github.com/rust-lang/rust/pull/99444#issuecomment-1188844202
2022-07-19 13:00:45 +02:00
Jonas Schievink
6c6ae965ba
Update remaining GitHub URLs
2022-07-08 15:44:49 +02:00
Laurențiu Nicola
6669f388a2
Bump indexmap
2022-07-03 10:09:35 +03:00
Laurențiu Nicola
c7c314d462
Bump quote
2022-07-03 10:09:35 +03:00
Lukas Wirth
531e152390
fix: Simplify macro statement expansion handling
2022-07-01 14:49:30 +02:00
Lukas Wirth
76ae5434fa
internal: Bump Dependencies
2022-06-10 17:30:02 +02:00
feniljain
1f4870ff1c
fix: f32 and f64 representation during lowering
2022-05-26 20:03:05 +05:30
Lukas Wirth
86d1d9067e
fix: Insert whitespace into trait-impl completions when coming from macros
2022-05-24 22:56:33 +02:00
Lukas Wirth
6a8b8a6039
internal: Refactor our record pat/expr handling in completion context
2022-05-24 13:24:36 +02:00
Lukas Wirth
ad537be194
fix: When reference searching macro inputs, don't search everything that was downmapped
2022-05-23 16:09:56 +02:00
Lukas Wirth
6b696fced8
feat: Add binding mode inlay hints
2022-05-14 14:58:35 +02:00
Jonas Schievink
9bd11459ba
Revert "Auto merge of #12149 - jonas-schievink:literally-just-a-literal, r=jonas-schievink"
...
This reverts commit cc9ae2b89e
, reversing
changes made to 7dfd1cb572
.
2022-05-13 15:08:14 +02:00
Jonas Schievink
2fe38d3b63
Indicate the number of float tokens in the first token
2022-05-05 16:28:59 +02:00
Jonas Schievink
1bc3305d95
Split float literal tokens at the .
2022-05-05 16:28:58 +02:00
Jonas Schievink
502c519e7d
Wrap float literals in their own node
2022-05-05 16:28:14 +02:00
Jonas Schievink
2d5d16f18c
Remove ast::Literal::token
2022-05-05 16:27:35 +02:00
Laurențiu Nicola
9856144b0b
Lower values of char and byte literals
2022-05-05 08:12:08 +03:00
Benjamin Coenen
6344eea242
improve the default constructor mode when filling fields
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2022-05-04 09:45:12 +02:00
Peh
1f011fa4a3
style: rename crates to kebab case
2022-05-01 10:48:58 +00:00
bors
1ad500beb6
Auto merge of #12057 - harpsword:fix_validata_visibility, r=jonas-schievink
...
fix visibility token validation in trait impl with proc-macro
fix #11828
2022-04-27 13:09:31 +00:00
harpsword
b1f858118b
fix visibility token validation in trait impl with proc-macro
2022-04-27 20:58:36 +08:00
Lukas Wirth
ea45e54458
Simplify
2022-04-23 02:21:27 +02:00
XFFXFF
bdecd9374e
update grammer to support associated const equality
2022-04-17 12:03:52 +08:00
Alex Touchet
940ec0967a
Update repo URL
2022-04-13 16:54:24 -07:00
Lukas Wirth
d8341c5b92
Parse for<'a> closure syntax
2022-04-10 17:50:14 +02:00
Jonas Schievink
872b7b9660
Wrap macros in expr position in MacroExpr
node
2022-04-05 17:43:34 +02:00
bors[bot]
65eaabc200
Merge #11887
...
11887: fix: Add missing fields diagnostic fix for patterns r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-03 13:42:15 +00:00
Lukas Wirth
dd3f7664fd
fix: Add missing fields diagnostic fix for patterns
2022-04-03 15:18:05 +02:00
bors[bot]
ba9aed19c7
Merge #11877
...
11877: fix: splitting path of a glob import wrongly adds `self` r=Veykril a=iDawer
Close #11703
`ast::UseTree::split_prefix` handles globs now.
Removed an extra branch for globs in `ide_db::imports::merge_imports::recursive_merge` (superseeded by split_prefix).
Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
2022-04-02 22:12:59 +00:00
iDawer
c8c21aabff
fix: merge_imports::recursive_merge
exiting early
2022-04-02 14:18:42 +05:00
Lukas Wirth
0d1d1dc3d9
internal: Move rust.ungram into rust-analyzer/crates/syntax
2022-04-01 17:12:33 +02:00
iDawer
b4c608896c
fix: splitting path of a glob import wrongly adds self
...
`ast::UseTree::split_prefix` handles globs now.
Removed an extra branch for globs in `ide_db::imports::merge_imports::recursive_merge` (superseeded by split_prefix).
2022-04-01 19:12:50 +05:00
Lukas Wirth
8e91bb7660
minor: Bump dependencies
2022-03-22 17:42:24 +01:00
bors[bot]
b594f9c441
Merge #11690
...
11690: feat: Add an assist for inlining type aliases r=Veykril a=steven-joruk
I'm working towards implementing #10881 , but I'd like to get this in first with earlier feedback.
Is `inline_type_alias` a good enough name? I guess the follow up assist would be called `inline_type_alias_into_all_users` based on that.
![valid_inlines](https://user-images.githubusercontent.com/1277939/158020510-fed78b5c-4c7e-46d1-9151-3044a29b9990.gif )
![invalid_inlines](https://user-images.githubusercontent.com/1277939/158020516-8a2deb6d-c6ec-4adf-a15b-c514fc97dc43.gif )
Co-authored-by: Steven Joruk <steven@joruk.com>
2022-03-20 21:15:49 +00:00
Morgan Thomas
3fafbca32e
fix: "Extract to function" assist preserves break
and continue
labels
...
Adds a label / lifetime parameter to `ide_assists::handlers::extract_function::FlowKind::{Break, Continue}`, adds support for emitting labels to `syntax::ast::make::{expr_break, expr_continue}`, and implements the required machinery to let `extract_function` make use of them.
This does modify the external API of the `syntax` crate, but the changes there are simple, not used outside `ide_assists`, and, well, we should probably support emitting `break` and `continue` labels through `syntax` anyways, they're part of the language spec.
Closes #11413 .
2022-03-12 08:54:06 -08:00
Matthias Krüger
5a0078c9d1
more clippy fixes:
...
clippy::search_is_some
clippy::redundant_static_lifetimes
clippy::match_single_binding
clippy::match_ref_pats
clippy::map_entry
clippy::manual_map
clippy::iter_overeager_cloned
clippy::into_iter_on_ref
clippy::extra_unused_lifetimes
2022-03-12 16:50:49 +01:00
Matthias Krüger
451fcd3c79
fix clippy::redundant_closure
2022-03-12 16:50:49 +01:00
Matthias Krüger
1f70886b15
fix clippy::single_char_pattern
2022-03-12 16:50:49 +01:00
Steven Joruk
5b712bd821
feat: Add an assist for inlining type aliases
...
This intends to lead to a more useful assist to replace all users of an
alias with its definition.
2022-03-12 13:42:24 +00:00
Lukas Wirth
6c8c02f625
Don't parse source files to generate macro completion details
2022-03-10 22:21:58 +01:00
Lukas Wirth
e5bb661b7a
Highlight Self
as a keyword by default
2022-03-06 00:13:45 +01:00
Lukas Wirth
c0d6471143
fix: Recognize Self
as a proper keyword
2022-03-05 23:20:06 +01:00
bors[bot]
8f504dc873
Merge #11598
...
11598: feat: Parse destructuring assignment r=Veykril a=ChayimFriedman2
Part of #11532 .
Lowering is not as easy and may not even be feasible right now as it requires generating identifiers: `(a, b) = (b, a)` is desugared into
```rust
{
let (<gensym_a>, <gensym_b>) = (b, a);
a = <gensym_a>;
b = <gensym_b>;
}
```
rustc uses hygiene to implement that, but we don't support hygiene yet.
However, I think parsing was the main problem as lowering will just affect type inference, and while `{unknown}` is not nice it's much better than a syntax error.
I'm still looking for the best way to do lowering, though.
Fixes #11454 .
Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
2022-03-05 11:31:29 +00:00
hkalbasi
4fa8749c44
Preserve order of generic args
2022-03-04 11:46:14 +03:30
Chayim Refael Friedman
d9f0731bd2
Parse destructuring assignment
...
The only patterns we should parse are `..` in structs and `_`: the rest are either not supported or already valid expressions.
2022-03-02 01:51:25 +00:00
Chayim Refael Friedman
54fe3dc0f1
Fix if
in #11561
2022-02-27 00:19:45 +00:00
Laurențiu Nicola
87c4a4104d
Fix body selection in while loops
2022-02-26 16:45:06 +02:00
Chayim Refael Friedman
2df7a1af17
Generate AST code after rust-analyzer/ungrammar#46
2022-02-25 01:25:42 +00:00
Moritz Vetter
8848186213
fix(11422): have two different funuctions - one for iterating breaks, one for iteraating breaks and continues
2022-02-24 19:00:08 +01:00
Lukas Wirth
f13c98034b
Make replace_derive_with_manual_impl work again
2022-02-22 10:20:44 +01:00