Commit Graph

24057 Commits

Author SHA1 Message Date
bors
9a6294d703 Auto merge of #13993 - OmarTawfik-forks:fix-server-path, r=Veykril
fix: substitute vscode variables in `config.serverPath`

From comment by `@Veykril` in https://github.com/rust-lang/rust-analyzer/issues/13939#issuecomment-1398187320:

> Yep, we pull the server path first, then substitute the configs, that's the wrong order.

6e52c64031/editors/code/src/ctx.ts (L155-L161)

Fixes #13939
2023-01-20 22:17:08 +00:00
bors
303737dad7 Auto merge of #13989 - Veykril:hover, r=Veykril
internal: Remove hover fallback in favor of ranged hover

The fallback is usually more annoying than useful at this point (it messes with the range of diagnostic popups a lot), we now have a ranged hover to check the type of something which works a lot better.

Closes https://github.com/rust-lang/rust-analyzer/issues/11602
2023-01-20 22:00:22 +00:00
OmarTawfik
7198cd04ac allow using vscode variables in config.serverPath 2023-01-20 13:22:11 -08:00
Lukas Wirth
4685b97f74 Remove hover fallback in favor of ranged hover 2023-01-20 21:52:05 +01:00
Laurențiu Nicola
5691c20bb4 Bump serde and serde_json 2023-01-20 20:57:27 +02:00
Laurențiu Nicola
2901e2803f Bump anyhow 2023-01-20 20:54:37 +02:00
Lukas Wirth
a542bd46bf Split out some hover functions 2023-01-20 16:30:08 +01:00
bors
ce67dea2ac Auto merge of #13988 - Veykril:hover-no-markdown, r=Veykril
Fix markdown removal in hover handling whitespace weirdly

Fixes https://github.com/rust-lang/rust-analyzer/issues/10028
2023-01-20 15:23:54 +00:00
Lukas Wirth
c5b1e3f2ae Fix markdown removal in hover handling whitespace weirdly 2023-01-20 14:29:12 +01: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
bors
6e52c64031 Auto merge of #13985 - Veykril:content-modified, r=Veykril
Don't respond with a ContentModified while loading the workspace

Initially this was done to prevent frequent inlay hint flickering, but this causes a lot of problems for a bunch of clients. We can (and already kind of have) move this into the semantic token request handlers instead.

Fixes https://github.com/rust-lang/rust-analyzer/issues/10910
2023-01-19 21:00:26 +00:00
Lukas Wirth
7385467f2e Don't respond with a ContentModified while loading the workspace 2023-01-19 21:52:27 +01:00
bors
56fb0cad6d Auto merge of #13984 - Veykril:target-data-layout, r=Veykril
fix: Fix target-data-layout fetching incorrectly passing 'rustc' to rustc
2023-01-19 20:45:29 +00:00
Lukas Wirth
384fa4b84a fix: Fix target-data-layout fetching incorrectly passing 'rustc' to rustc 2023-01-19 21:31:08 +01:00
bors
bbb730a441 Auto merge of #13983 - ink-feather-org:parse_const_closure, r=Veykril
Parse const_closures syntax.

Enables parsing of the syntax for `#![features(const_closures)]` introduced in [this PR](https://github.com/rust-lang/rust/pull/106004)
2023-01-19 14:53:59 +00: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
93c8ae08dd Auto merge of #13981 - Veykril:saveOnCheckStartup, r=Veykril
Don't run flycheck on startup unless checkOnSave is enabled

The main reason people disable it is because they don't want the expensive checks to occur automatically, so we shouldn't trigger them at the start up either if this is disabled.
2023-01-18 20:39:44 +00:00
Lukas Wirth
c9d33cddc9 Don't run flycheck on startup unless checkOnSave is enabled 2023-01-18 21:38:30 +01:00
bors
760f2ff58d Auto merge of #13980 - Veykril:checkOnSaveConfigPatch, r=Veykril
Fix checkOnSave to check config patching not always working

This early return was missed in the initial PR, so if we aren't patching the `completion_addCallArgumentSnippets` `completion_addCallParenthesis` configs we won't be patching the checkOnSave ones...
2023-01-18 19:31:21 +00:00
Lukas Wirth
1e4a182954 Fix checkOnSave to check config patching not always working 2023-01-18 20:29:55 +01:00
bors
3a72713365 Auto merge of #13973 - lnicola:replace-arith, r=lnicola
minor: Fix `replace_arith` assist label
2023-01-17 18:16:04 +00:00
Laurențiu Nicola
210757769d Fix replace_arith label 2023-01-17 16:31:34 +02:00
bors
492b3deba7 Auto merge of #13971 - lowr:fix/more-precise-builtin-binop-types, r=Veykril
fix: more precise binop inference

While inferring binary operator expressions, Rust puts some extra constraints on the types of the operands for better inference. Relevant part in rustc is [this](159ba8a92c/compiler/rustc_hir_typeck/src/op.rs (L128-L152)).

There are two things we currently fail to consider:
- we should enforce them only when both lhs and rhs type are builtin types that are applicable to the binop
- lhs and rhs types may be single reference to applicable builtin types

This PR basically ports [`enforce_builtin_binop_types()`](159ba8a92c/compiler/rustc_hir_typeck/src/op.rs (L159)) and [`is_builtin_binop()`](159ba8a92c/compiler/rustc_hir_typeck/src/op.rs (LL927)) to our inference context.
2023-01-17 12:39:53 +00:00
Ryo Yoshida
c53064fb58
Enforce builtin binop expectations even without lang items 2023-01-17 20:17:15 +09:00
Ryo Yoshida
461435adab
Enforce builtin binop expectations on single references
Also don't enforce them on non-builtin types
2023-01-17 20:17:09 +09: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
bors
62907858d5 Auto merge of #13964 - Veykril:workspace.package, r=Veykril
Specify authors, edition, license and rust-versian via workspace.package
2023-01-17 10:13:24 +00:00
Lukas Wirth
bed4db3c62 Use workspace.dependencies to declare local dependencies 2023-01-17 10:52:26 +01:00
bors
e11c0e3e85 Auto merge of #13966 - HKalbasi:layout, r=Veykril
Don't compute layout if `TargetDataLayout` is not available
2023-01-17 09:39:32 +00:00
hkalbasi
ec65b3b3aa fix tests 2023-01-16 23:45:12 +03:30
hkalbasi
77efa0267d Don't compute layout if TargetDataLayout is not available 2023-01-16 22:43:27 +03:30
bors
455ef0c806 Auto merge of #13935 - ModProg:assist_desugar_doc_comment, r=Veykril
Assist: desugar doc-comment

My need for this arose due to wanting to do feature dependent documentation and therefor convert parts of my doc-comments to attributes.

Not sure about the pub-making of the other handlers functions, but I didn't think it made much sense to reimplement them.
2023-01-16 19:11:19 +00:00
bors
1d02474cd2 Auto merge of #13963 - Veykril:location-links, r=Veykril
Unconditionally enable location links in inlay hints again

While the goto functionality still doesn't work in VSCode, the hover part actually does. Also the way this was gated before, one only had to update their config while r-a was running to have the links enabled automatically due to the check only living in the startup code.
2023-01-16 18:58:16 +00:00
Roland Fredenhagen
ec06313a6d
fix test for required_hashes 2023-01-16 19:25:30 +01:00
Roland Fredenhagen
5e66e49c73
move required_hashes into utils 2023-01-16 18:39:16 +01:00
Lukas Wirth
f932d39945 Regen config 2023-01-16 17:02:30 +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
Lukas Wirth
3a95864df5 Unconditionally enable location links in inlay hints again 2023-01-16 16:04:38 +01:00
bors
5306eb06cc Auto merge of #13947 - WaffleLapkin:adjustment_hint_tooltips, r=Veykril
Add basic tooltips to adjustment hints

![2023-01-16_16-45](https://user-images.githubusercontent.com/38225716/212681383-a60b60bb-a8e7-410d-8b24-f6b72c197311.png)

I'm not sure how to make them look nicer, but it's at least something.
2023-01-16 13:11:16 +00:00
bors
27c9c2fcaf Auto merge of #13961 - lowr:fix/impl-missing-members-type-neq, r=Veykril
fix: don't generate `PartialEq`/`PartialOrd` methods body for types don't match

Fixes #12985

This PR changes the implementation of well-known trait methods body generation so that it takes generic arguments of traits into account and does not generate `PartialEq`/`PartialOrd` methods body when the self type and rhs type don't match.

I took this opportunity to add `hir::TraitRef`, which has been suggested by a FIXME note. I didn't change the signature of the existing method `hir::Impl::trait_(self, db) -> Option<Trait>` as suggested by FIXME but added a new method because you quite often only want to know the trait rather than `TraitRef`s.
2023-01-16 12:56:35 +00:00
Maybe Waffle
81d7e302ed Add basic tooltips to adjustment hints 2023-01-16 12:44:39 +00:00
Ryo Yoshida
fc56cacfc1
Test TraitRef equality before generating missing impl method body 2023-01-16 20:55:56 +09:00
Ryo Yoshida
8afaaa54b0
Add TraitRef for HIR 2023-01-16 20:55:51 +09:00
bors
ff4d55e480 Auto merge of #13956 - nielx:fix/nix-haiku-fix, r=lnicola
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 13:37:07 +00:00
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