Commit Graph

23959 Commits

Author SHA1 Message Date
Niels Sascha Reedijk
8aa1d2d789 Update command-group from 1.0.8 to 2.0.1
With #13552 the depencency of on the command-group crate was introduced, which also
introduced a dependency on nix. That version of nix does not build on Haiku. This
change introduces a newer version of command-group, which also updates nix from
0.22.3 to 0.26.1, which is compatible on Haiku.
2023-01-15 08:20:25 +00:00
bors
6189be13ab Auto merge of #13952 - WaffleLapkin:either_ast_node2, r=lnicola
minor: Use the fact that `Either`: `AstNode`

Continuation of https://github.com/rust-lang/rust-analyzer/pull/13949
2023-01-14 15:34:32 +00:00
Maybe Waffle
a7787533af Use the fact that Either: AstNode 2023-01-14 15:20:32 +00:00
bors
c78b9f0068 Auto merge of #13949 - WaffleLapkin:either_ast_node, r=Veykril
minor: implement `AstNode` for `Either`

Makes code a little bit nicer
2023-01-14 13:50:11 +00:00
bors
ce86f12e8d Auto merge of #13945 - bvanjoi:orpat-match, r=lnicola
fix: check orpat in missing match

fixed #13942
2023-01-14 13:37:30 +00:00
bors
8800ea6461 Auto merge of #13950 - WaffleLapkin:iterate_over_arrays_directly, r=Veykril
minor: Iterate over arrays dirrectly, instead of going through a slice

Minor code improvement.
2023-01-14 13:08:36 +00:00
Maybe Waffle
bd04416aaa Iterate over arrays dirrectly, instead of going through a slice 2023-01-14 13:02:28 +00:00
bors
6673e515b7 Auto merge of #13948 - Veykril:inlay-hints, r=Veykril
Make inlay hint location links work for more types
2023-01-14 12:50:26 +00:00
Maybe Waffle
cfc01150bf implement AstNode for Either 2023-01-14 12:45:20 +00:00
Lukas Wirth
27ba598dfe Make inlay hint location links work for more types 2023-01-14 13:30:56 +01:00
bors
ce6955c10e Auto merge of #13946 - Veykril:inlay-hints, r=Veykril
Remove hover inlay tooltips, replace them with location links

Turns out we re-implemented what clients can already figure out through the use of location-links. We might want lazy resolves tooltips later on still, but for now this simplifies things again.
2023-01-14 12:22:43 +00:00
Lukas Wirth
f2444b2a40 Remove unnecessary Hint suffix on InlayKind variants 2023-01-14 13:08:45 +01:00
Lukas Wirth
60075a6625 Remove hover inlay tooltips, replace them with location links 2023-01-14 12:19:29 +01:00
bvanjoi
e9724e55df fix: check orpat in missing match 2023-01-14 18:54:45 +08:00
bors
32be158630 Auto merge of #13941 - matklad:rpj, r=Veykril
internal: explain the idea behind rust-project.json
2023-01-14 09:40:40 +00:00
Lukas Wirth
aafb0f1f8d Use smallvec for inlay-hint parts 2023-01-13 15:03:37 +01:00
bors
a119352ada Auto merge of #13937 - danieleades:recursive-display, r=lnicola
remove recursive 'Display' implementations

closes #13920

`@lnicola` is this the solution you were looking for?

having explicitly unimplemented methods seems preferable to apparently implemented methods that can't be called
2023-01-13 12:07:28 +00:00
Alex Kladov
bd350085f6
Update crates/project-model/src/project_json.rs
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2023-01-13 12:01:04 +00:00
Alex Kladov
87315ef5c3
Apply suggestions from code review
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2023-01-13 11:57:02 +00:00
bors
15fb082cc1 Auto merge of #13753 - kdy1:limit, r=lnicola
fix: Increase token limit of proc macro

Fixes #13738

[The swc project](https://swc.rs) has lots of type definitions, and the current limit is too low for the ECMAScript/CSS visitors.

[rustdoc](https://rustdoc.swc.rs/swc_ecma_visit)

---

With this fix, the rust-analyzer shows trait-related actions.

<img width="1840" alt="image" src="https://user-images.githubusercontent.com/29931815/206839269-d7a04589-7dba-449b-ad0b-1f69d52bd039.png">
2023-01-13 11:45:50 +00:00
Aleksey Kladov
aa73366b0b internal: explain the idea behind rust-project.json 2023-01-13 11:44:02 +00:00
bors
cdbe025232 Auto merge of #13922 - danieleades:loop-that-never-loops, r=lnicola
minor: loop-that-never-loops

closes #13921
2023-01-13 11:23:51 +00:00
bors
c7a3f34ad8 Auto merge of #13940 - nlydv:unwrap-panic, r=lnicola
Fix panicking Option unwraping in match arm analysis

Hi, first PR here!

I've noticed my IDE sometimes briefly becoming pretty slow to respond while writing Rust. When checking the logs I found reams of this same error repeating itself.

```
thread 'Worker' panicked at 'called `Option::unwrap()` on a `None` value'
crates/ide-assists/src/handlers/convert_match_to_let_else.rs:90:46
```

RA seemed to have been panicking on virtually every keystroke I made whenever I was part way through writing/refactoring a match statement of relevance to this assist.

The fix in this PR should be self-explanatory.
2023-01-13 09:11:22 +00:00
Neel Yadav
9721505bf1
Fix panicking Option unwraping in match arm analysis 2023-01-12 22:33:58 -06:00
bors
fb39efe26c Auto merge of #13934 - Veykril:unlinked-file-inline-modules, r=Veykril
feat: Make unlinked_file diagnostic quickfixes work for inline modules

Finally got myself to fix this, bothered me quite a bit that this never worked
![Code_Qe3WlMvt5Q](https://user-images.githubusercontent.com/3757771/211927799-023e48ee-7cdd-4dd7-8e25-a23eddc7d897.gif)

(Just gotta fix up the indentation still)
2023-01-12 15:25:12 +00:00
Daniel Eades
c4b36b64aa remove recursive 'Display' implementations 2023-01-12 11:53:45 +00:00
bors
80e616e00b Auto merge of #13936 - danieleades:static-mod-depth-limit, r=lnicola
interior-mutable types should be 'static' rather than 'const

with the 'tracking' feature enabled, `limit::Limit` is interior mutable, so the `const` `hir_def::nameres::mod_resolution::MOD_DEPTH_LIMIT` is probably meant to be `static` rather than `const`.

with `const` you get a new copy of it everywhere it's used, instead of the shared, global value that seems to be the intent.

This fix brought to you by the catchily-named `clippy::declare_interior_mutable_const` lint.
2023-01-12 10:58:19 +00:00
Daniel Eades
7413a9954f interior-mutable types should be 'static' rather than 'const 2023-01-12 10:48:10 +00:00
Lukas Wirth
14777ce751 fix indentation of unlinked_file quickfix 2023-01-12 11:24:44 +01:00
Lukas Wirth
5214a98d9c Simplify 2023-01-11 23:04:35 +01:00
Lukas Wirth
1ce3e820dc feat: Make unlinked_file diagnostic quickfixes work for inline modules 2023-01-11 22:39:05 +01:00
bors
09aceea36d Auto merge of #13933 - Veykril:assoc-search, r=Veykril
Refine search for const and function assoc items

This changes our searching behavior, before we always associated all usages and definitions of associated items with all implementations of a trait and the trait itself. Now, when searching for references of a an associated trait item, we still do the same and consider all implementations, but when searching for an associated item of an implementation we now only consider the uses of that specific implementations associated item.

This does not affect associated type aliases as we unfortunately are missing information in the IDE layer here still.
2023-01-11 16:21:11 +00:00
Lukas Wirth
bb4e272d8a Refine search for const and function assoc items 2023-01-11 17:10:04 +01:00
daniel.eades
a3114c3697 move loop index inside iterator 2023-01-11 16:07:35 +00:00
bors
f32f64bffc Auto merge of #13929 - danieleades:simplify, r=lnicola
internal: a number of code simplifications
2023-01-11 09:38:34 +00:00
bors
75877d78d9 Auto merge of #13897 - bvanjoi:nearest-block-search, r=Veykril
fix(ty): should query impls in nearest block

fix https://github.com/rust-lang/rust-analyzer/issues/13895
2023-01-10 22:44:29 +00:00
Daniel Eades
d218b237fd collapse some nested blocks 2023-01-10 20:40:08 +00:00
Daniel Eades
95fc3ba41c fixup 2023-01-10 19:51:21 +00:00
Daniel Eades
5b1cd8245f fixup 2023-01-10 19:44:19 +00:00
Daniel Eades
ac3844a0bb a number of code simplifications 2023-01-10 18:48:51 +00:00
bors
6dabdefa2e Auto merge of #13928 - danieleades:clone-on-copy, r=lnicola
internal: avoid 'cloning' types that implement 'Copy'
2023-01-10 18:48:10 +00:00
Daniel Eades
95d14c393c avoid 'cloning' types that implement 'Copy' 2023-01-10 18:20:12 +00:00
bors
a97cbb1ee9 Auto merge of #13927 - lnicola:rm-blank-issue, r=lnicola
minor: tweak wording and remove blank issue template

There's already a "blank issue" link at the bottom, and some users seem to pick this one because it's the first.
2023-01-10 18:01:48 +00:00
bors
3987c835f2 Auto merge of #13919 - danieleades:derive-hash, r=lnicola
derive 'Hash'
2023-01-10 17:48:46 +00:00
bors
c3b78f440e Auto merge of #13917 - Veykril:raw-attrs, r=Veykril
Split out hir-def attribute handling parts into hir-expand

This should help with `cfg_attr` handling for macro inputs
2023-01-10 17:35:37 +00:00
bors
674b52aaaa Auto merge of #13862 - danieleades:logic-bug, r=lnicola
comment out disabled code
2023-01-10 17:22:39 +00:00
bors
6e89e7787c Auto merge of #13923 - rust-lang:revert-13886-inlay-ligatures, r=lnicola
Revert "Use ZWNJ to prevent VSCode from forming ligatures between hints and code"

Doesn't actually seem to fix the bug, it seems to be theme dependent and I am not sure what causes it
Reverts rust-lang/rust-analyzer#13886
2023-01-10 17:07:06 +00:00
bors
8eb75220b0 Auto merge of #13924 - lnicola:sync-from-rust, r=Veykril
internal: sync from downstream
2023-01-10 16:47:46 +00:00
Laurențiu Nicola
220996c5c1 Tweak wording and remove blank issue template 2023-01-10 17:25:02 +02:00
Laurențiu Nicola
13aa7a2ca2 Merge branch 'master' into sync-from-rust 2023-01-10 16:08:39 +02:00