Commit Graph

24992 Commits

Author SHA1 Message Date
alibektas
e275f77b2c Comment clean-up. Use display where possible 2023-04-22 13:23:52 +02:00
bors
5750d81e30 Auto merge of #14632 - Veykril:lru-macro, r=lnicola
internal: Increase LRU cache size for parse_expansion and macro_expand queries
2023-04-22 11:13:35 +00:00
bors
442a769f82 Auto merge of #14634 - Veykril:assoc-collect, r=Veykril
fix: Report remaining macro errors in assoc item collection
2023-04-22 09:49:57 +00:00
Lukas Wirth
77afc6e793 fix: Report remaining macro errors in assoc item collection 2023-04-22 11:49:00 +02:00
bors
34ebb30e84 Auto merge of #14610 - lowr:fix/hygiene-for-meta-item, r=Veykril
fix: Resolve `$crate` in derive paths

Paths in derive meta item list may contain any kind of paths, including those that start with `$crate` generated by macros. We need to take hygiene into account when we lower paths in the list.

This issue was identified while investigating #14607, though this patch doesn't fix the broken trait resolution.
2023-04-22 09:36:38 +00:00
Lukas Wirth
6253fc031b Increase LRU cache size for parse_expansion and macro_expand queries 2023-04-22 11:28:56 +02:00
Ryo Yoshida
85e76542fe
Cache Hygiene in DefCollector 2023-04-22 18:22:29 +09:00
bors
6f43a56201 Auto merge of #14633 - Veykril:assoc-collect, r=Veykril
internal: Don't reparse files when trying to expand assoc item macro calls
2023-04-22 09:02:25 +00:00
Lukas Wirth
2aa44c8e37 internal: Don't reparse files when trying to expand assoc item macro calls 2023-04-22 11:02:11 +02:00
bors
1379b5fac7 Auto merge of #14630 - Veykril:arc, r=Veykril
internal: `Arc<String>` -> `Arc<str>`
2023-04-22 07:58:13 +00:00
Lukas Wirth
f2295cda42 Report vfs memory usage in status command 2023-04-22 09:57:48 +02:00
Lukas Wirth
f00dcf9a69 internal: Arc<String> -> Arc<str> 2023-04-22 09:48:37 +02:00
bors
11c55b2e27 Auto merge of #14629 - Veykril:stats, r=Veykril
internal: Add some additional status ouput

We should be able to use this infra to get a better grasp about what we might want to LRU
2023-04-22 07:35:29 +00:00
Lukas Wirth
63e3bf118d internal: Add some additional status ouput 2023-04-22 09:34:47 +02:00
bors
779b891526 Auto merge of #14628 - Veykril:symbols, r=Veykril
internal: Restructure symbol queries a bit
2023-04-22 07:04:33 +00:00
Lukas Wirth
e7285507f6 Restructure symbol queries 2023-04-22 08:27:10 +02:00
bors
fcbbec6c6e Auto merge of #14625 - jhgg:fix/token-conversion-for-doc-comments, r=Veykril
mbe: fix token conversion for doc comments

fixes #14611

when creating token trees for the converted doc comment, we should use the correct span in all places, rather than allowing some to remain unspecified. otherwise, things behave incorrectly.
2023-04-22 05:23:18 +00:00
Jake Heinz
a497e9a05e mbe: fix token conversion for doc comments 2023-04-22 03:06:06 +00: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
bors
3a08713caa Auto merge of #14619 - HKalbasi:dev3, r=Veykril
Fix need-mut large span in closures and a false positive

fix #14612
2023-04-21 15:10:27 +00:00
hkalbasi
0c621065fb Fix need-mut large span in closures and a false positive 2023-04-21 02:15:19 +03:30
bors
0289dfa261 Auto merge of #14599 - HKalbasi:dev2, r=HKalbasi
Detect sysroot dependencies using symlink copy

cc #7637

It is currently in a proof of concept stage, and it doesn't generates a copy. You need to provide your own sysroot copy in `/tmp/ra-sysroot-hack` in a way that `/tmp/ra-sysroot-hack/library/std/lib.rs` exists and `/tmp/ra-sysroot-hack/Cargo.toml` is [the one from this comment](https://github.com/rust-lang/rust-analyzer/issues/7637#issuecomment-1495008329). I will add the symlink code if we decide that this approach is not a dead end.

It seems to somehow work on my system. Go to definition into std dependencies works, type checking can look through fields if I make them public and `cfg_if` appears to work (I tested it by hovering both sides and seeing that the correct one is enabled). Though finding layout of `HashMap` didn't work.

Please try it and let me know if I should go forward in this direction or not.
2023-04-20 22:26:17 +00:00
bors
5b6655028a Auto merge of #14618 - westernwontons:feature/automatic-parameter-hints-toggle, r=Veykril
fix: `editor.parameterHints.enabled` not always being respected

#13472

When accepting a suggestion, the parameter hints would always trigger automatically. This PR provides the ability for users to toggle this functionality off by specifying the new "rust-analyzer.autoTriggerParameterHints" option in `settings.json`. Possible options are `true` and `false`. It's `true` by default.
2023-04-20 20:19:50 +00:00
hkalbasi
39715ce26f Add RA_UNSTABLE_SYSROOT_HACK 2023-04-20 22:55:39 +03:30
Nagy Botond
36281e0745 using VSCode's native parameterHints.enabled setting 2023-04-20 22:13:33 +03:00
Nagy Botond
770734fdbb Automatic parameter hints trigger can be toggled on/off 2023-04-20 19:41:15 +03:00
Ryo Yoshida
cf72b6232b
Resolve $crate in derive paths 2023-04-20 15:50:17 +09:00
bors
2400b36a2e Auto merge of #14577 - jsoref:spelling, r=lnicola
Spelling

This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling).

The misspellings have been reported at https://github.com/jsoref/rust-analyzer/actions/runs/4699991040#summary-12751355796

The action reports that the changes in this PR would make it happy: https://github.com/jsoref/rust-analyzer/actions/runs/4699991284#summary-12751356293

closes #14567
2023-04-19 14:05:40 +00: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
bors
112464fd6b Auto merge of #14604 - HKalbasi:dev3, r=Veykril
internal: Add minicore smoke test

fix #14501
2023-04-18 14:34:44 +00:00
hkalbasi
f05f7ab082 Add minicore smoke test 2023-04-18 17:38:38 +03:30
bors
e84781ad58 Auto merge of #14603 - Veykril:workspaces, r=Veykril
fix: Deduplicate passed workspaces by top level cargo workspace they belong to

Fixes https://github.com/rust-lang/rust-analyzer/issues/14571

With this we should be supporting vscode workspaces properly
2023-04-18 12:28:00 +00:00
Lukas Wirth
9c408970ea Deduplicate loaded projects 2023-04-18 14:27:01 +02:00
Lukas Wirth
f5f68e4dc7 Make workspace fields of config private 2023-04-18 13:25:54 +02:00
bors
9b835f334f Auto merge of #14594 - Veykril:Simplify, r=Veykril
internal: Move Expander and LowerCtx into separate modules
2023-04-17 19:00:42 +00:00
Lukas Wirth
bca8029a6e Move Expander and LowerCtx into separate modules 2023-04-17 20:44:06 +02:00
bors
b92b7c0d94 Auto merge of #14598 - lowr:fix/release-channel-from-str, r=lnicola
Fix release channel detection

We detect toolchain's release channel by looking at pre-release identifier of cargo/rustc's version string. It's empty for stable, "beta" or "beta.x" for beta, and "nightly" for nightly.

See rust-lang/rust's [bootstrap code] for how the version string is determined.

[bootstrap code]: e49122fb1c/src/bootstrap/lib.rs (L1244)
2023-04-17 18:43:47 +00:00
Ryo Yoshida
4db87f9346
Fix release channel detection
See bootstrap code in rust-lang/rust for versioning details: e49122fb1c/src/bootstrap/lib.rs (L1244)
2023-04-18 02:12:17 +09:00
bors
1f92641093 Auto merge of #14593 - lnicola:bump-deps, r=lnicola
minor: Bump a couple of deps

Only a couple because I didn't yet try to untangle the `windows-sys` / `syn 2.0`.
2023-04-17 16:08:31 +00:00
Laurențiu Nicola
160ab88bb9 Bump bitflags 2023-04-17 18:42:59 +03:00
Laurențiu Nicola
840cfd0862 Bump mimalloc 2023-04-17 17:38:47 +03:00
Laurențiu Nicola
8e192b0298 Bump cargo_metadata 2023-04-17 17:26:55 +03:00
Laurențiu Nicola
1737bd628f Bump proc-macro2 2023-04-17 17:23:09 +03:00
Laurențiu Nicola
966fa604c1 Bump libc 2023-04-17 17:22:07 +03:00
Laurențiu Nicola
3c027fed1b Bump always-assert 2023-04-17 17:21:02 +03:00
Laurențiu Nicola
ad38c30e65 Bump serde_json 2023-04-17 17:19:48 +03:00
bors
5111207d9a Auto merge of #14591 - justahero:gh-14516, r=Veykril
Restrict "sort items" assist for traits & impls

This restricts the "sort items alphabetically" assist when the selection is inside a `Impl` or `Trait` node & intersects with one of the associated items.

It re-orders the conditional checks of AST nodes in the `sort_items` function to check for more specific nodes first before checking `Trait` or `Impl` nodes. The `AssistContext` is passed into the `add_sort_methods_assist` function to check if the selection intersects with any inner items, e.g. associated const or type alias, function. In this case the assist does not apply.

Fixes: #14516
2023-04-17 12:45:31 +00:00