Commit Graph

17238 Commits

Author SHA1 Message Date
jakhh8
f502169f1c minor: use extra_args for fetching workspace 2023-04-23 21:19:40 +02: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
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
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
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
hkalbasi
39715ce26f Add RA_UNSTABLE_SYSROOT_HACK 2023-04-20 22:55:39 +03:30
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
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
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
Laurențiu Nicola
160ab88bb9 Bump bitflags 2023-04-17 18:42:59 +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
Sebastian Ziebell
c1712e55c6 Restrict "sort items" assist inside Impl & Trait
This fixes the applicability of the "sort items alphabetically" assist
when the selection is inside a `Trait` or `Impl`. It's now tested if the
selection is inside or overlaps with an inner node, e.g. associated
const or type alias, function.
2023-04-17 12:36:32 +02:00
bors
bab80dae44 Auto merge of #14588 - Veykril:macro-def-err, r=Veykril
fix: Actually bring back LRU limit for macro_expand query
2023-04-16 21:13:02 +00:00
Lukas Wirth
fd4bbcabe8 Actually bring back LRU limit for macro_expand query 2023-04-16 23:12:25 +02:00
bors
9b54e39762 Auto merge of #14587 - Veykril:macro-def-err, r=Veykril
fix: Bring back LRU limit for macro_expand query

Should fix the memory increase
2023-04-16 19:30:42 +00:00
Lukas Wirth
76718ea2fc Bring back LRU limit for macro_expand query 2023-04-16 21:30:04 +02:00
bors
924d30a772 Auto merge of #14585 - Veykril:macro-def-err, r=Veykril
Make `ExpandDatabase::parse_macro_expansion` and `ExpandDatabase::parse_or_expand` infallible
2023-04-16 18:50:02 +00:00
Lukas Wirth
4ea5d7f6a0 Re-introduce option for macro_arg to prevent calling macros with empty inputs 2023-04-16 20:26:26 +02:00
bors
697b335fda Auto merge of #14584 - Veykril:macro-def-err, r=Veykril
internal: Report item-level macro expansion syntax errors
2023-04-16 17:40:20 +00:00
Lukas Wirth
a2a3fecae3 Option begone part 2 2023-04-16 19:20:48 +02:00
Lukas Wirth
96a774261f Option begone part 1 2023-04-16 19:20:42 +02:00
Lukas Wirth
0f4ffaa5af Fix duplicate eager expansion errors 2023-04-16 19:20:35 +02:00
Lukas Wirth
d1632c2727 Report syntax errors from item level macro expansions 2023-04-16 17:22:06 +02:00