Commit graph

255275 commits

Author SHA1 Message Date
ChosenName
adb7de2c69
Update config.rs 2024-06-04 21:39:37 -06:00
ChosenName
e592d8866f
fmt 2024-06-04 21:35:41 -06:00
ChosenName
48f1b49721
Fix typos 2024-06-04 21:30:36 -06:00
ChosenName
dc1074862b
Update config.rs 2024-06-04 21:09:21 -06:00
ChosenName
b885cea989
Update package.json 2024-06-04 21:08:30 -06:00
bors
4c007c86bb Auto merge of #17004 - Veykril:ide-macro-caching, r=Veykril
Try caching macro calls more aggressively in Semantics
2024-06-04 14:28:52 +00:00
Lukas Wirth
6eab89fd37 Use dyn cache for Semantics macro resolution 2024-06-04 16:25:38 +02:00
Lukas Wirth
8d5e14d408 Cache parse trees in Semantics 2024-06-04 15:29:24 +02:00
Lukas Wirth
c5a5c93ed9 Cache file_to_def in SourceToDefCtx 2024-06-04 15:23:02 +02:00
Lukas Wirth
98769133c6 Try caching macro calls more aggressively 2024-06-04 15:23:00 +02:00
bors
59c3a3a86b Auto merge of #17341 - Veykril:inert-attr, r=Veykril
internal: Cleanup some inert attribute stuff
2024-06-04 10:42:15 +00:00
Lukas Wirth
211af03439 Cleanup some inert attribute stuff 2024-06-04 12:38:20 +02:00
bors
33a902147f Auto merge of #17282 - jkelleyrtp:jk/filter-by-underscorte, r=Veykril
Feat: hide double underscored symbols from symbol search

Fixes #17272 by changing the default behavior of query to skip results that start with `__` (two underscores).

Not sure if this has any far reaching implications - a review would help to understand if this is the right place to do the filtering, and if it's fine to do it by default on the query.

If you type `__` as your search, then we'll show the matching double unders, just in case you actually need the symbol.
2024-06-04 08:37:56 +00:00
Lukas Wirth
93b87e9719 Recognize __ prefixes for symbol search query 2024-06-04 10:36:04 +02:00
bors
845754af9c Auto merge of #17340 - Veykril:find-path2, r=Veykril
internal: Improve `find_path` performance

cc https://github.com/rust-lang/rust-analyzer/issues/17339, db80216dac3d972612d8e2d12ade3c28a1826ac2 should fix a case where we don't reduce our search space appropriately. This also adds a fuel system which really shouldn't ever be hit, hence why it warns
2024-06-03 18:08:17 +00:00
Lukas Wirth
59cef9c624 Add fuel to find_path 2024-06-03 20:07:00 +02:00
Lukas Wirth
1eecc1863a Remove an allocation in find_path::find_local_import_locations 2024-06-03 19:57:49 +02:00
Lukas Wirth
1244fc5044 Simplify 2024-06-03 19:46:40 +02:00
Lukas Wirth
45a1662c80 Deduplicate 2024-06-03 19:26:11 +02:00
Lukas Wirth
cd265cab64 Fix find_path search not reducing scope appropriately for foreign items 2024-06-03 19:21:19 +02:00
Lukas Wirth
b26a06f678 Simplify 2024-06-03 19:06:58 +02:00
bors
bdd2bd1925 Auto merge of #17329 - Nilstrieb:rustc_deprecated_safe_2024, r=Veykril
Don't mark `#[rustc_deprecated_safe_2024]` functions as unsafe

`std::env::set_var` will be unsafe in edition 2024, but not before it. I couldn't quite figure out how to check for the span properly, so for now we just turn the false positives into false negatives, which are less bad.
2024-06-03 12:44:21 +00:00
bors
af65ff500a Auto merge of #17315 - hamirmahal:style/simplify-string-interpolation, r=Veykril
style: simplify string interpolation
2024-06-03 12:29:27 +00:00
bors
fa41f196b5 Auto merge of #17312 - regexident:function-fn-ptr-type, r=Veykril
Add `Function::fn_ptr_type(…)` for obtaining name-erased function type

The use case of this function if being able to group functions by their function ptr type.

cc `@flodiebold`
2024-06-03 12:16:29 +00:00
bors
fcde6c9b35 Auto merge of #17333 - DropDemBits:extract-format-args-snippet-cap, r=Veykril
fix: Only generate snippets for `extract_expressions_from_format_string` if snippets are supported

Part of #17332

Fixes `extract_expressions_from_format_string` so that it doesn't generate snippets if the client doesn't support it.
2024-06-03 12:03:18 +00:00
bors
1bed783846 Auto merge of #17337 - Veykril:assert-info, r=Veykril
Add path info to `AbsPathBuf::assert`'s assert

cc https://github.com/rust-lang/rust-analyzer/issues/17335
2024-06-02 19:30:55 +00:00
Lukas Wirth
a10d710813 Add path info to AbsPathBuf::assert's assert 2024-06-02 21:28:25 +02:00
DropDemBits
0c7d5c6340
fix typos & formatting 2024-06-02 14:09:36 -04:00
DropDemBits
9e317051b3
Make extract_expressions_from_format_string only use snippets when available 2024-06-02 11:47:05 -04:00
DropDemBits
b9c19c1a46
Add ast::Expr::parse 2024-06-02 11:17:52 -04:00
DropDemBits
becd71f826
minor: tidy up Parse a little bit
- Add doc comments to some `Parse` methods
- Uses `Parse::new` more
2024-06-02 11:10:39 -04:00
DropDemBits
5fc5f63d09
Add tt_from_syntax
Used for inserting syntax nodes into existing token trees
2024-06-02 11:10:07 -04:00
Nilstrieb
ee26bcb9ce Don't mark #[rustc_deprecated_safe_2024] functions as unsafe
`std::env::set_var` will be unsafe in edition 2024, but not before it.
I couldn't quite figure out how to check for the span properly, so for now
we just turn the false positives into false negatives, which are less bad.
2024-06-02 15:04:26 +02:00
bors
4717bdfc13 Auto merge of #17328 - Veykril:derive-helper-completions, r=Veykril
feat: Enable completions within derive helper attributes

![Code_zG5qInoQ6B](https://github.com/rust-lang/rust-analyzer/assets/3757771/db30b98d-4981-45e3-83a5-7ff23fbd3f66)
2024-06-02 07:47:13 +00:00
Lukas Wirth
f122a6f2f1 feat: Enable completions within derive helper attributes 2024-06-02 09:45:57 +02:00
bors
60d2f73fd1 Auto merge of #17326 - Veykril:fix-attr-derive-container, r=Veykril
fix: Fix container search failing for tokens originating within derive attributes
2024-06-01 18:58:59 +00:00
Lukas Wirth
8ab8bb0603 fix: Fix container search failing for tokens originating within derive attributes 2024-06-01 20:57:29 +02:00
bors
c1ea2b562e Auto merge of #17302 - mladedav:dm/fix-clear, r=Veykril
fix diagnostics clearing when flychecks run per-workspace

This might be causing #17300 or it's a different bug with the same functionality.

I wonder if the decision to clear diagnostics should stay in the main loop or maybe the flycheck itself should track it and tell the mainloop?

I have used a hash map but we could just as well use a vector since the IDs are `usizes` in some given range starting at 0. It would be probably faster but this just felt a bit cleaner and it allows us to change the ID to newtype later and we can just use a hasher that returns the underlying integer.
2024-06-01 14:14:14 +00:00
David Mládek
f476d37e4e Move state trackig of diagnostic clearing inside FlycheckActor 2024-06-01 15:59:23 +02:00
bors
d4a5cb9fdd Auto merge of #17278 - chenx97:flycheck-process-wrap, r=lnicola
internal: replace command-group with process-wrap

Because command-group no longer receives updates and depends on an older version of nix.
2024-06-01 08:39:22 +00:00
bors
b738617be0 Auto merge of #17319 - LukeFranceschini:patch-1, r=lnicola
minor: Missing word typo
2024-05-31 15:34:53 +00:00
Luke Franceschini
fa3835c419
docs: Missing word typo 2024-05-31 11:24:26 -04:00
Henry Chen
772e48cfbb minor: replace command-group with process-wrap
Because command-group no longer receives updates and depends on an
older version of nix.
2024-05-31 12:43:40 +08:00
Hamir Mahal
58cc9641b8
fix: formatting in handlers/unresolved_method.rs 2024-05-30 16:39:41 -07:00
Hamir Mahal
e3d09394c2
style: simplify string interpolation 2024-05-30 16:18:49 -07:00
Vincent Esche
88f125ebc9 Add Function::fn_ptr_type(…) for obtaining name-erased function type 2024-05-29 19:41:55 +02:00
David Mládek
4be8e5a372 add FlycheckStatus to global state 2024-05-28 20:45:13 +02:00
David Mládek
eeda60ddd8 fix diagnostics clearing when flychecks run per-workspace 2024-05-28 11:07:57 +02:00
bors
c1b051602c Auto merge of #17258 - maxwase:code-assist-async-sugar, r=Veykril
Add `toggle_async_sugar` assist code action

Implement code action for sugaring and de-sugaring asynchronous functions.

This code action does not import `Future` trait when de-sugaring and does not touch function boby, I guess this can be implemented later if needed. This action also does not take into consideration other bounds because IMO it's usually "let me try to use sugared version here".

Feel free to request changes, that's my first code action implementation 😄

Closes #17010
Relates to #16195
2024-05-27 16:40:04 +00:00
bors
cbd40a2da4 Auto merge of #17253 - ThouCheese:master, r=Veykril
Implement assist to switch between doc and normal comments

Hey first PR to rust-analyzer to get my feet wet with the code base. It's an assist to switch a normal comment to a doc comment and back, something I've found myself doing by hand a couple of times.

I shamelessly stole `relevant_line_comments` from `convert_comment_block`, because I didn't see any inter-assist imports happening in the files I peeked at so I thought this would be preferable.
2024-05-27 16:27:23 +00:00