Nicholas Rishel
f8f7d37b8b
minor: Break out of waiting for debugger on Windows using native debugger check API.
...
For Windows, this removes the need to add a breakpoint and modify a value to exit the debugger wait loop.
As a ridealong, this adds a 100ms sleep for all platforms such that waiting for the debugger doesn't hog the CPU thread.
2024-12-23 14:33:26 -08:00
bors
485f5e80e6
Auto merge of #134681 - lnicola:sync-from-ra, r=lnicola
...
Subtree update of `rust-analyzer`
r? `@ghost`
2024-12-23 12:18:14 +00:00
Laurențiu Nicola
a2a5b72c47
Merge from rust-lang/rust
2024-12-23 11:27:07 +02:00
Zalathar
aeec9ba525
Revert "Auto merge of #130766 - clarfonthey:stable-coverage-attribute, r=wesleywiser"
...
This reverts commit 1d35638dc38dbfbf1cc2a9823135dfcf3c650169, reversing
changes made to f23a80a4c2fbca593b64e70f5970368824b4c5e9.
2024-12-23 12:30:37 +11:00
Brian Bosak
5162a9ab1c
Treat ; as a terminator rather than something that can be glued together in an expression
2024-12-22 16:44:01 -06:00
Lukas Wirth
fa4a40bbe8
Merge pull request #18742 from Veykril/push-yswvkzmsvqql
...
fix: Fix flycheck workspace when requested but package was found
2024-12-22 13:42:39 +00:00
Lukas Wirth
4a86434cf5
fix: Fix flycheck workspace when requested but package was found
2024-12-22 14:28:17 +01:00
Lukas Wirth
2e5998a9bf
fix: Delay initial flycheck until after build scripts
2024-12-22 14:18:53 +01:00
Lukas Wirth
066284addd
Merge pull request #18738 from Veykril/push-vqxqutskzvvu
...
fix: Properly check if workspace flychecking is allowed
2024-12-22 12:11:00 +00:00
Lukas Wirth
d67b900edd
Merge pull request #18740 from Veykril/push-tntsvtmtlotw
...
fix: Fix empty check diagnostics not marking files as changed
2024-12-22 11:52:59 +00:00
Lukas Wirth
8da08e7100
fix: Fix empty check diagnostics not marking files as changed
2024-12-22 12:38:38 +01:00
Lukas Wirth
2f33e85f56
Merge pull request #18739 from Veykril/push-ntpvvqnnovtn
...
fix: Don't trigger paren wrapping typing handler after idents
2024-12-22 11:22:56 +00:00
Lukas Wirth
1962cae609
fix: Properly check if workspace flychecking is allowed
2024-12-22 12:10:48 +01:00
Lukas Wirth
a7f3265028
fix: Don't trigger paren wrapping typing handler after idents
2024-12-22 12:08:27 +01:00
Lukas Wirth
31938dbfdc
Merge pull request #18735 from Veykril/push-rpuxqrzrzvsw
...
fix: Set `result_id` for `RelatedFullDocumentDiagnosticReport` everywhere
2024-12-22 10:03:25 +00:00
Lukas Wirth
6b5615df46
fix: Set result_id
for RelatedFullDocumentDiagnosticReport
everywhere
2024-12-22 10:48:57 +01:00
roife
59e3d6684b
fix: only show debug lens with a valid root
2024-12-21 07:03:45 +08:00
roife
693b110e3d
fix: remove always! check for file_id in runnables
2024-12-21 07:00:49 +08:00
Lukas Wirth
c966876f85
Revert "internal: Drop proc-macro server support for ~1.66.0 and older toolchains"
2024-12-20 20:51:09 +01:00
Giga Bowser
2b6e7ce896
internal: Standardize how we take iterator parameters in SyntaxFactory
2024-12-20 12:06:27 -05:00
Chayim Refael Friedman
82896b2cc4
Move ty lowering diagnostic definitions into a separate module
...
To keep them organized.
2024-12-20 15:34:23 +02:00
Lukas Wirth
f4cafbb678
Merge pull request #18729 from Veykril/push-kyxtnozqzwkn
...
Clear flycheck diagnostics more granularly
2024-12-20 13:23:31 +00:00
Lukas Wirth
db8660410f
Clear all check diagnostics when the workspace changes
2024-12-20 14:09:29 +01:00
Lukas Wirth
4a8eb8c229
Arc the package ids coming from flycheck
2024-12-20 14:09:29 +01:00
Lukas Wirth
7da17fe195
Arc the workspace root flycheck
2024-12-20 14:09:11 +01:00
Lukas Wirth
7aab6a5c12
Clear flycheck diagnostics more granularly
2024-12-20 14:09:11 +01:00
Lukas Wirth
15d2d509d0
Merge pull request #18723 from ChayimFriedman2/tracing-complete
...
fix: Fix a case where completion was unable to expand a macro
2024-12-20 12:33:25 +00:00
Chayim Refael Friedman
02d47f3a81
Fix a case where completion was unable to expand a macro
...
Which caused the macros of the popular `tracing` crate to not offer completions.
The reason is rather complicated: it boils down to macro ignoring their input and completion always choosing the first expansion.
2024-12-20 13:14:59 +02:00
Lukas Wirth
f3f8f4c6ad
Merge pull request #18728 from Veykril/push-ozqlrzmqklwt
...
internal: Split `serde` derive feature into `serde_derive` usage
2024-12-20 11:09:27 +00:00
Lukas Wirth
027daf1686
Merge pull request #18702 from ChayimFriedman2/prep
...
minor: Use a record struct instead of a tuple for each namespace in `PerNs`
2024-12-20 11:05:49 +00:00
Lukas Wirth
5211972743
internal: Split serde derive feature into serde_derive
usage
...
Ideally we'd not have any dependency pull in the derive feature for faster build times, once that is the case this change would have an actual effect.
See https://github.com/matklad/macro-dep-test/blob/master/README.md for context.
2024-12-20 11:55:02 +01:00
Chayim Refael Friedman
b5486ffc42
Show substitution where hovering over generic things
...
There are few things to note in the implementation:
First, this is a best-effort implementation. Mainly, type aliases may not be shown (due to their eager nature it's harder) and partial pathes (aka. hovering over `Struct` in `Struct::method`) are not supported at all.
Second, we only need to show substitutions in expression and pattern position, because in type position all generic arguments always have to be written explicitly.
2024-12-20 11:30:19 +02:00
Lukas Wirth
e0c11f631e
Merge pull request #18726 from Veykril/push-vyzotyqqtpqs
...
fix: Reduce applicability of unnecessary_async assist
2024-12-20 07:56:23 +00:00
Lukas Wirth
0be03285f9
fix: Reduce applicability of unnecessary_async assist
2024-12-20 08:41:46 +01:00
Lukas Wirth
fe027d79d2
Merge pull request #18717 from Veykril/push-pomxnvxotwlr
...
internal: Set `result_id` for pull diagnostics
2024-12-19 15:38:32 +00:00
Lukas Wirth
c1a2955b50
internal: Set result_id
for pull diagnostics
2024-12-19 16:24:18 +01:00
Lukas Wirth
27fac08c82
Merge pull request #18715 from aibaars/ungram-asm-option
...
Fix AsmOption rule in rust.ungram
2024-12-18 14:22:05 +00:00
Lukas Wirth
e89d72056b
fix: Consider both completion detail fields in to_proto
2024-12-18 15:00:09 +01:00
Arthur Baars
cb2829eaa7
Fix AsmOption rule in rust.ungram
2024-12-18 14:56:00 +01:00
Lukas Wirth
683150f4da
fix: Do not ask the client ro resolve for non existing label details
2024-12-18 14:03:50 +01:00
Lukas Wirth
540ada516a
internal: Cleanup label structure of CompletionItem
2024-12-18 13:37:21 +01:00
Lukas Wirth
c70b07b3c9
Merge pull request #18711 from Veykril/push-kwurwxttmqwo
...
Taking a raw ref of a deref is always safe
2024-12-18 10:47:07 +00:00
Lukas Wirth
dfa46292b6
Taking a raw ref of a deref is always safe
2024-12-18 11:32:29 +01:00
Ralf Jung
c858ce132f
make no-variant types a dedicated Variants variant
2024-12-18 11:01:54 +01:00
Ralf Jung
d7d08ae95c
Variants::Single: do not use invalid VariantIdx for uninhabited enums
2024-12-18 11:00:21 +01:00
Lukas Wirth
3d63140758
Remove salsa from proc-macro server dep tree
2024-12-18 10:24:26 +01:00
Lukas Wirth
2780dfd80c
Merge pull request #18708 from ChayimFriedman2/fix-tiny
...
fix: Fix pretty-printing of `@` patterns
2024-12-18 07:41:09 +00:00
Chayim Refael Friedman
8c8e738636
Fix pretty-printing of @
patterns
...
It didn't print the `@`.
2024-12-18 01:24:12 +02:00
ltdk
c180e41198
Stabilize #[coverage] attribute
2024-12-16 21:07:06 -05:00
Lukas Wirth
0a706f7d2a
Merge pull request #18700 from ChayimFriedman2/dyn-send
...
fix: Fix a panic with a diagnostics fix when a keyword is used as a field
2024-12-16 21:54:28 +00:00
Chayim Refael Friedman
79214583f6
Use a record struct instead of a tuple for each namespace in PerNs
...
The reason I did this is because I plan to add another field to this struct (indicating whether the item was cfg'ed out), but it seems worthy even separately and removes a bunch of one-letter variable names and tuple-indexing. It is also easy to separate from future changes, so it will be easier to review this way.
2024-12-16 22:39:50 +02:00
Chayim Refael Friedman
8277c0336e
Fix a panic with a diagnostics fix when a keyword is used as a field
...
I found it easiest to fix in the quickfix code, and not deeper (e.g. body lowering).
2024-12-16 19:58:29 +02:00
Lukas Wirth
ada5f2059c
fix: Fix path qualified auto-importing completions not working with re-exports
...
Prior to this commit we used to generate import paths, then zipped them with the existing qualifier to check if they agree on the path to import.
This is brittle when re-exports come into play causing items to have multiple applicable paths that refer to them.
This commit instead rewrites this logic by generating the import path for the qualifier, verifying that the rest of the qualifier resolves and then doing a final lookup on that resolution result for the final segment instead.
2024-12-16 13:20:55 +01:00
Lukas Wirth
65c8d1242b
Merge pull request #18698 from Veykril/push-vpqwrwxptsql
...
internal: Don't serialize empty fields in completions and resolve payloads
2024-12-16 10:39:19 +00:00
Lukas Wirth
61c222e1af
Merge pull request #18690 from Giga-Bowser/extract-variable-string
...
feat: Use string literal contents as a name when extracting into variable
2024-12-16 10:29:05 +00:00
Lukas Wirth
de7808bb71
internal: Don't serialize empty fields in completions and resolve payloads
2024-12-16 11:25:29 +01:00
Lukas Wirth
0189a8937b
Merge pull request #18695 from roife/improve-tuple-destruction
...
minor: improve name suggestion for destructure_tuple_binding
2024-12-16 10:25:01 +00:00
Lukas Wirth
efafe66a78
Merge pull request #18696 from ChayimFriedman2/syn-syn
...
feat: Report unresolved idents for implicit captures in `format_args!()`
2024-12-16 09:33:51 +00:00
Lukas Wirth
910e705932
Merge pull request #18697 from Veykril/push-qtmmtvpyrntr
...
internal: Simplify ratoml testdir usage
2024-12-16 09:16:18 +00:00
Lukas Wirth
1b27ba86eb
internal: Simplify ratoml testdir usage
2024-12-16 10:01:35 +01:00
Chayim Refael Friedman
54ce1dda3a
Report unresolved idents for implicit captures in format_args!()
...
And also a bit of cleanup by storing the capture's span with the open quote included.
2024-12-16 10:10:26 +02:00
roife
ad63e6957f
refactor: simplify edit_tuple_usages
in destructure_tuple_binding
2024-12-16 14:12:19 +08:00
Laurențiu Nicola
27e824fad4
Merge pull request #18693 from Veykril/push-wzoomkkmuolm
...
fix: Fix proc-macro dylib names on windows
2024-12-15 18:32:38 +00:00
Lukas Wirth
6c6779e6f0
fix: Fix proc-macro dylib names on windows
2024-12-15 17:38:44 +01:00
Lukas Wirth
15239f612d
internal: Show mir eval errors on hover with debug env var set
2024-12-15 17:38:37 +01:00
Giga Bowser
620af0ef2f
feat: Use string literal contents as a name when extracting into variable
2024-12-14 13:36:57 -05:00
roife
cb1533f7e9
feat: improve name generation in destructure_tuple_binding
2024-12-13 23:34:03 +08:00
Laurențiu Nicola
dc978a976f
Bump typos
2024-12-13 11:45:44 +02:00
Laurențiu Nicola
405f01ac3f
Merge pull request #18678 from regexident/fix-typos
...
minor: Fix a few typos
2024-12-13 09:09:33 +00:00
Vincent Esche
3d4f10a856
Fix a few typos
2024-12-13 09:54:35 +01:00
Lukas Wirth
6aadbae022
Merge pull request #18674 from Veykril/push-lrxotqknvxvr
...
Show expansion errors in expand_macro feature
2024-12-13 08:50:45 +00:00
Lukas Wirth
7ce807bf4d
Merge pull request #18672 from Veykril/push-lurnqpqtzvzq
...
internal: Do not require a special env var to be set for the proc-macro-srv
2024-12-13 08:43:33 +00:00
Lukas Wirth
28fbecff42
Show expansion errors in expand_macro feature
2024-12-13 09:36:03 +01:00
Lukas Wirth
a5adfafd93
Do not require a special env var to be set for the proc-macro-srv
2024-12-13 09:29:16 +01:00
Lukas Wirth
9b2e72c404
Merge pull request #18677 from Veykril/push-uumpxklsqpzk
...
internal: Implement `naked_asm!` builtin
2024-12-12 16:58:26 +00:00
Lukas Wirth
f748eb510e
internal: Implement naked_asm!
builtin
2024-12-12 17:43:27 +01:00
Lukas Wirth
cde07f29c9
Merge pull request #18675 from ShoyuVanilla/issue-18664
...
fix: Panic when displaying generic params with defaults, again
2024-12-12 16:37:10 +00:00
Shoyu Vanilla
94ec3fe7ed
fix: Panic when displaying generic params with defaults, again
2024-12-13 01:15:41 +09:00
Philipp Hofer
04ac6f8405
Fix typo in error message for invalid casting
...
Corrected the spelling of "defererence" to "dereference" in the error message that informs users about invalid casting requirements.
2024-12-12 15:42:21 +01:00
Lukas Wirth
acd469681f
Merge pull request #18670 from Veykril/push-ylomnylswnxm
...
internal: Drop proc-macro server support for ~1.66.0 and older toolchains
2024-12-12 14:19:07 +00:00
Lukas Wirth
f0b5b8333d
internal: Drop proc-macro server support for ~1.66.0 and older toolchains
2024-12-12 15:06:14 +01:00
Lukas Wirth
a6c291ed07
Merge pull request #18652 from Giga-Bowser/extract-constant
...
feat: Add an assist to extract an expression into a constant
2024-12-12 13:22:05 +00:00
Lukas Wirth
3bd459767c
Merge pull request #18669 from Veykril/push-qqkuxtvsmsut
...
internal: Only parse the object file once in proc-macro-srv
2024-12-12 12:46:29 +00:00
Lukas Wirth
8a86fa01ac
Fix clippy lints in proc-macro-srv
2024-12-12 13:30:42 +01:00
Lukas Wirth
c9314d4aff
Only parse the object file once
2024-12-12 13:23:25 +01:00
Lukas Wirth
096e3e55e3
Merge pull request #18668 from Veykril/push-tpkmsyllunqv
...
fix: Fix sourceroot construction for virtual manifests
2024-12-12 12:13:48 +00:00
Lukas Wirth
a8efb137a1
Merge pull request #18660 from Veykril/push-snumrtvzwqvw
...
fix: copied proc-macros not being cleaned up on exit
2024-12-12 12:09:41 +00:00
Lukas Wirth
ab46e97188
fix: Fix sourceroot construction for virtual manifests
2024-12-12 12:58:18 +01:00
1hakusai1
fc2b70132f
Generate implementation with items even if snippet text edit is disabled
2024-12-12 18:55:14 +09:00
Giga Bowser
21782b9a8d
minor: Group extract_function
with other extraction assists
2024-12-11 14:11:20 -05:00
Giga Bowser
0cad614b3b
feat: Add an assist to extract an expression into a static
2024-12-11 14:04:54 -05:00
Chayim Refael Friedman
0b7a6f38d7
Properly handle different defaults for severity of lints
...
Previously all lints were assumed to be `#[warn]`, and we had a hand-coded list of `#[allow]` exceptions. Now the severity is autogenerated from rustdoc output.
Also support lints that change status between editions, and the `warnings` lint group.
2024-12-11 20:48:41 +02:00
Giga Bowser
135e71fcb3
minor: Add item_static
constructor to SyntaxFactory
2024-12-11 10:32:32 -05:00
Giga Bowser
1979d3f9b5
feat: Add an assist to extract an expression into a constant
2024-12-11 09:52:03 -05:00
Giga Bowser
17e482b1a9
internal: Move is_body_const
to ide_assists::utils
2024-12-11 09:52:03 -05:00
Giga Bowser
27a2f9d594
minor: Add item_const
constructor to SyntaxFactory
2024-12-11 09:52:03 -05:00
Lukas Wirth
e7a4c99ce3
Merge pull request #18663 from Veykril/push-syoklzkntykn
...
fix: Swallow rustfmt parsing panics
2024-12-11 10:06:28 +00:00
Lukas Wirth
8963e9736b
fix: Swallow rustfmt parsing panics
2024-12-11 10:52:04 +01:00
Laurențiu Nicola
30262281eb
Merge from rust-lang/rust
2024-12-11 11:49:08 +02:00
Lukas Wirth
16c0f25579
Fix copied proc-macros not being cleaned up on exit
2024-12-11 10:17:33 +01:00
Lukas Wirth
f370550b0a
Unload proc-macro dlls on changed timestamp
2024-12-11 09:34:27 +01:00
Lukas Wirth
41f3319173
Merge pull request #18458 from Giga-Bowser/master
...
feat: Add diagnostic fix to remove unnecessary wrapper in type mismatch
2024-12-11 07:09:15 +00:00
Lukas Wirth
087cb629be
Merge pull request #18653 from SomeoneToIgnore/hash-completions
...
Hash completion items to properly match them during /resolve
2024-12-11 07:08:33 +00:00
Lukas Wirth
002fcea441
Merge pull request #18657 from Giga-Bowser/generate-enum-variant
...
minor: Migrate `generate_enum_variant` to `SyntaxEditor`
2024-12-11 07:07:22 +00:00
Lukas Wirth
b0c82c974d
Merge pull request #18656 from roife/fix-issue-18639
...
feat: preserve order of parameters in extract_functions
2024-12-11 07:00:17 +00:00
roife
78fb0e47ca
feat: preserve order of parameters in extract_functions
2024-12-11 02:26:58 +08:00
Giga Bowser
547f75a2ce
minor: Migrate generate_enum_variant
to SyntaxEditor
2024-12-10 13:11:33 -05:00
Giga Bowser
21b376583a
minor: Add ty_infer
constructor to SyntaxFactory
2024-12-10 12:33:32 -05:00
Giga Bowser
d7d68310c0
minor: Add whitespace
constructor to SyntaxFactory
2024-12-10 12:25:13 -05:00
Giga Bowser
c70bf568bb
minor: Add item_enum
constructor to SyntaxFactory
...
I recursively added all constructors it depends on. I also changed the old `make::` constructors to support more of the grammar.
2024-12-10 11:12:44 -05:00
Kirill Bulatov
4169926b3f
Address the feedback from pascalkuthe
...
* Use Base64 to minify the hash representation in the JSON data
* Do hash checks only for items with similar labels
2024-12-10 13:01:23 +02:00
Kirill Bulatov
2529e9e1e1
Address the feedback from Veykril
...
* Exclude documentation field from hashing
* Do less cloning during initial completion list generation
2024-12-10 12:33:30 +02:00
Laurențiu Nicola
7b4b83ba91
Merge pull request #18649 from roife/fix-issue-18648
...
minor: enhance name suggestion for `Arc<T>` and `Rc<T>`
2024-12-10 07:05:36 +00:00
Giga Bowser
68b85ce66f
minor: Migrate remove_unnecessary_wrapper
to SyntaxEditor
2024-12-09 21:16:31 -05:00
Giga Bowser
59cd717602
fix: Handle the final statement in SyntaxFactory::block_expr
properly
...
This caused a bug that was rather tricky to hunt down!
2024-12-09 21:15:15 -05:00
Giga Bowser
d881208d1b
Add diagnostic fix to remove unnecessary wrapper in type mismatch
...
I also reorganized the tests in a more logical order, and removed the redundant `test_` prefix from their names.
2024-12-09 21:15:15 -05:00
Kirill Bulatov
d8d35dbfcc
Clippy fixes
2024-12-10 01:04:02 +02:00
Kirill Bulatov
89c2aaed8c
Avoid hashing completion-related ranges as those may change during /resolve query
2024-12-10 00:45:57 +02:00
Yuki Sireneva
dff827741d
crates/r-a: Fix typo in debug message
2024-12-10 00:13:17 +03:00
Kirill Bulatov
b59b2fb469
Unite more bool hashing
2024-12-09 22:38:55 +02:00
Kirill Bulatov
5906bda975
Stop excluding Helix from the general resolve path
2024-12-09 22:26:00 +02:00
Kirill Bulatov
d348ffb480
Always compute the hash when r-a wants the imports to be resolved
2024-12-09 22:26:00 +02:00
Kirill Bulatov
62d97d9ba7
Draft completion hashing
2024-12-09 22:26:00 +02:00
roife
9c03cbb499
minor: enhance name suggestion for Arc<T>
and Rc<T>
2024-12-10 02:47:52 +08:00
Lukas Wirth
99a6ecd41e
Merge pull request #18647 from Veykril/push-nsrrmmnzzoym
...
internal: Disable pipe on typing handler
2024-12-09 15:06:29 +00:00
Lukas Wirth
f021ec3b96
Disable pipe on typing handler
2024-12-09 15:52:04 +01:00
Lukas Wirth
067b4a32dd
Merge pull request #18645 from Veykril/push-yruoyrvrsntw
...
fix: Non-exhaustive structs may be empty
2024-12-09 13:26:47 +00:00
Lukas Wirth
55a7ee8065
fix: Non-exhaustive structs may be empty
2024-12-09 14:12:22 +01:00
Lukas Wirth
d8248714dc
Merge pull request #18644 from Veykril/push-nolvpzqvoqwx
...
Remove patch sysroot cfg-if hack
2024-12-09 10:58:27 +00:00
Lukas Wirth
bdb2a3e182
Merge pull request #18643 from Veykril/push-muwuzmowptnn
...
internal: Rename test fixture crates to ra_test_fixture
2024-12-09 10:54:51 +00:00
Lukas Wirth
7085328185
Remove patch sysroot cfg-if hack
2024-12-09 11:42:51 +01:00
Lukas Wirth
956ff4d8c5
Rename test fixture crates to ra_test_fixture
2024-12-09 11:40:21 +01:00
Laurențiu Nicola
d5b96b7998
Remove unstable attributes in minicore
2024-12-09 11:17:17 +02:00
Lukas Wirth
94032e8c64
Merge pull request #18441 from Veykril/lw-psyvmlotlvqn
...
internal: Do not cache the config directory path
2024-12-09 08:47:20 +00:00
Lukas Wirth
10a07a443d
Fix config guard lock for ratoml tests
2024-12-09 09:33:02 +01:00
Lukas Wirth
1c3043bc8c
Merge pull request #18635 from ChayimFriedman2/fix-test
...
minor: Fix a test that didn't test what it should
2024-12-09 08:02:05 +00:00
Giga Bowser
e66b4f336d
fix: Map new replacement nodes to their mutable equivalents in SyntaxEditor
2024-12-08 15:55:34 -05:00
Chayim Refael Friedman
26333a467e
Fix a test that didn't test what it should
...
That is, fix the helper function and disable the tests for now.
2024-12-08 15:02:14 +02:00
Lukas Wirth
4c755e62a6
Merge pull request #18633 from ChayimFriedman2/unify-fn
...
fix: Coerce two `FnDef`s to fn pointers even if they are the same, if they are subtypes
2024-12-08 07:18:57 +00:00
Chayim Refael Friedman
a9e015f8ee
Coerce two FnDef
s to fn pointers even if they are the same, if they are subtypes
...
That's because they can be the same function but still different substs, which mandates them to coerce to fn pointers in order to unify.
2024-12-07 19:16:00 +02:00
Ali Bektas
4fcecbb55e
Watch for user config ratoml
2024-12-07 15:22:35 +01:00
Lukas Wirth
4a418837f2
Merge pull request #18575 from Giga-Bowser/flip-assists
...
minor: Migrate `flip_*` assists to `SyntaxEditor`
2024-12-07 12:27:40 +00:00
Lukas Wirth
02aca112e8
Merge pull request #18630 from Veykril/push-ystzsxpywnxn
...
fix: Temporarily disable completion resolve support for helix and neovim
2024-12-07 12:23:21 +00:00
Ben Kimock
0843b6f308
Remove polymorphization
2024-12-06 16:42:09 -05:00
Lukas Wirth
ad01392756
Temporarily disable completion resolve support for neovim
2024-12-06 17:37:39 +01:00
Lukas Wirth
c6208c86a5
Temporarily disable completion resolve support for helix
2024-12-06 17:07:22 +01:00
Lukas Wirth
17720acb90
Merge pull request #18629 from Veykril/push-wlsvxwomumpp
...
Highlight right angle as part of fat arrow in macro rules arm
2024-12-06 15:44:39 +00:00
Lukas Wirth
bf6547a77e
Highlight right angle as part of fat arrow in macro rules arm
2024-12-06 16:28:32 +01:00
Lukas Wirth
f37d0fa9d3
Merge pull request #18628 from Veykril/push-sqpymrtxysmw
...
Add typing handler for param list pipe
2024-12-06 15:03:41 +00:00
Giga Bowser
d329329b76
feat: Migrate flip_comma
assist to SyntaxEditor
2024-12-06 10:03:09 -05:00
Giga Bowser
8fd7790eb5
minor: Add token_tree
constructor to SyntaxFactory
2024-12-06 10:03:09 -05:00
Giga Bowser
d55879d1cb
feat: Migrate flip_trait_bound
assist to SyntaxEditor
2024-12-06 10:02:34 -05:00
Giga Bowser
09dee81412
feat: Migrate flip_binexpr
assist to SyntaxEditor
2024-12-06 10:02:34 -05:00
Giga Bowser
fbb392062a
minor: Add expr_bin
constructor to SyntaxFactory
2024-12-06 10:02:34 -05:00
Giga Bowser
6406048626
minor: Add token
constructor to SyntaxFactory
2024-12-06 10:02:34 -05:00
Giga Bowser
5eb8affdc5
fix: Don't produce ChangedAncestor
for SyntaxToken
s
2024-12-06 10:01:34 -05:00
Giga Bowser
ff1124918e
fix: Properly determine SyntaxEditor
replacement intersection
...
Bordering replacements should not be considered intersecting
2024-12-06 10:01:34 -05:00
Lukas Wirth
54dbf1b446
Add typing handler for param list pipe
2024-12-06 15:49:36 +01:00
Lukas Wirth
1b8360be51
Merge pull request #18627 from Veykril/push-tzvnrnytrksr
...
Improve heuristics for on typing semicolon insertion
2024-12-06 14:15:13 +00:00
Lukas Wirth
5dc5107e9c
Improve heuristics for on typing semicolon insertion
2024-12-06 15:00:09 +01:00
Lukas Wirth
4b350f2f11
Merge pull request #18551 from ShoyuVanilla/migrate-turbofish-assist
...
Migrate `add_turbo_fish` to `SyntaxEditor`
2024-12-06 13:44:54 +00:00
Lukas Wirth
c58548e92e
Merge pull request #18563 from alibektas/workspace_key_high_precedence
...
minor: run `FlycheckHandle::restart_workspace` when `check_workspace` true
2024-12-06 13:09:32 +00:00
Lukas Wirth
abc7147bb7
Merge pull request #18594 from ChayimFriedman2/async-closures
...
feat: Support `AsyncFnX` traits
2024-12-06 12:48:47 +00:00
Lukas Wirth
630e4ca44a
Merge pull request #18474 from Veykril/push-nvtxykxkwnvs
...
Make bracket typing handler work on more things
2024-12-06 12:03:52 +00:00
Lukas Wirth
632ca53df4
Merge pull request #18610 from Veykril/push-kynytqktmnxq
...
Add implict unsafety inlay hints for extern blocks
2024-12-06 12:01:49 +00:00
Lukas Wirth
19465b94f5
Add implict unsafety inlay hints for extern blocks
2024-12-06 12:49:03 +01:00
Lukas Wirth
bac0ed579f
Make bracket typing handler work on more things
2024-12-06 12:47:32 +01:00
Lukas Wirth
cddaf7485f
Merge pull request #18625 from Veykril/push-npnxwpxuzlqz
...
fix: Fix parser getting stuck for bad asm expressions
2024-12-06 05:11:08 +00:00
Lukas Wirth
4a24e729b0
fix: Fix parser getting stuck for bad asm expressions
2024-12-06 05:57:00 +01:00
Lukas Wirth
150b0e7292
Merge pull request #18622 from Veykril/push-wlzptrukvyup
...
fix: Fix parsing of dyn T in generic arg on 2015 edition
2024-12-05 19:41:34 +00:00
Lukas Wirth
a049941c1a
fix: Fix parsing of dyn T in generic arg on 2015 edition
2024-12-05 20:26:49 +01:00
David Barsky
5d23772649
Merge pull request #18538 from tareknaser/syntax_factory_sort_items
...
Migrate `sort_items` Assist to Use `SyntaxFactory`
2024-12-05 19:21:51 +00:00
David Barsky
2fd06545a6
Merge pull request #18483 from tareknaser/syntax_factory_introduce_named_generic
...
Migrate `introduce_named_generic` Assist to Use `SyntaxFactory`
2024-12-05 18:42:27 +00:00
Lukas Wirth
d6b62265b5
fix: Resolve generic parameters within use captures
2024-12-05 19:11:33 +01:00
Lukas Wirth
7f39ee3fce
Merge pull request #18620 from Veykril/push-pyulxnouvxkq
...
fix: Parse lifetime bounds in lifetime param into TypeBoundList
2024-12-05 17:06:02 +00:00
Lukas Wirth
f3d7415bd6
Parse lifetime bounds in lifetime param into TypeBoundList
...
This mainly aids in error recovery but also makes it a bit easier to handle lifetime resolution.
While doing so it also came apparent that we were not actually lowering lifetime outlives relationships within lifetime parameter declaration bounds, so this fixes that.
2024-12-05 17:52:02 +01:00
Lukas Wirth
0b5f51a264
Merge pull request #18619 from ShoyuVanilla/issue-18613
...
fix: Panic when displaying generic params with defaults
2024-12-05 16:31:33 +00:00
Shoyu Vanilla
405520150d
fix: Panic when displaying generic params with defaults
2024-12-06 01:10:46 +09:00
Lukas Wirth
4df6dc8f9c
Merge pull request #18618 from Veykril/push-ysklqzomkyvp
...
fix: Fix parsing of integer/keyword name refs in various places
2024-12-05 14:42:00 +00:00
Lukas Wirth
df7ab62a06
fix: Fix parsing of integer/keyword name refs in various places
2024-12-05 15:27:50 +01:00
Tarek
8954a7f9e9
fix: rename syntax_editor_add_generic_param
to add_generic_param
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-05 13:50:43 +02:00
Lukas Wirth
e7c8b2fd81
Merge pull request #18616 from Veykril/push-pkumxswtxspo
...
fix: Disable `<` typing handler again
2024-12-05 09:00:46 +00:00
Lukas Wirth
d71e41dba6
Disable <
typing handler again
2024-12-05 09:46:23 +01:00
Lukas Wirth
f499faf72b
Merge pull request #18611 from ChayimFriedman2/proc-macro-warn
...
fix: Do not report warnings from proc macros, ever
2024-12-04 16:39:54 +00:00
Oli Scherer
a035c6c3fb
Rename core_pattern_type
and core_pattern_types
lib feature gates to pattern_type_macro
...
That's what the gates are actually gating, and the single char difference in naming was not helpful either
2024-12-04 16:16:24 +00:00
Tarek
b7e613c0dc
fix: update introduce_named_generic
to use type_param
directly
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 16:02:03 +02:00
Chayim Refael Friedman
33c7e81e90
Do not report warnings from proc macros, ever
2024-12-04 15:25:01 +02:00
Tarek
9157761f5d
refactor: move editing for ast using SyntaxEditor
to a separate file
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:51:48 +02:00
Tarek
2fb563f192
fix: refactor introduce_named_generic
assist
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
5aaffe6dc9
fix: correct token type for closing angle bracket
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
70ef2f23c2
fix: refactor syntax_editor_add_generic_param
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
54f7ed13f5
fix: refactor syntax_editor_add_generic_param
to handle adding new generic parameters
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
98e10d76ca
fix: refactor syntax_editor_add_generic_param to handle new generic parameters
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
0990d5956d
fix: implement syntax_editor_create_generic_param_list
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
642d4f3385
define syntax_editor_add_generic_param
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
4af3d6f598
fix: remove make_mut from introduce_named_generic assist
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Tarek
1400aec433
feat: migrate introduce_named_generic assist to use SyntaxFactory
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 14:50:03 +02:00
Chayim Refael Friedman
21ad3b5b87
Complete diagnostics in ty lowering groundwork
...
Implement diagnostics in all places left: generics (predicates, defaults, const params' types), fields, and type aliases.
Unfortunately this results in a 20mb addition in `analysis-stats .` due to many type methods returning an addition diagnostics result now (even if it's `None` in most cases). I'm not sure if this can be improved.
An alternative strategy that can prevent the memory usage growth is to never produce diagnostics in hir-ty methods. Instead, lower all types in the hir crate when computing diagnostics from scratch (with diagnostics this time). But this has two serious disadvantages:
1. This can cause code duplication (although it can probably be not that bad, it will still mean a lot more code).
2. I believe we eventually want to compute diagnostics for the *entire* workspace (either on-type or on-save or something alike), so users can know when they have diagnostics even in inactive files. Choosing this approach will mean we lose all precomputed salsa queries. For one file this is fine, for the whole workspace this will be very slow.
2024-12-04 14:22:56 +02:00
Chayim Refael Friedman
5f25ae3d1b
Lay the foundation for diagnostics in ty lowering, and implement a first diagnostic
...
The diagnostic implemented is a simple one (E0109). It serves as a test for the new foundation.
This commit only implements diagnostics for type in bodies and body-carrying signatures; the next commit will include diagnostics in the rest of the things.
Also fix one weird bug that was detected when implementing this that caused `Fn::(A, B) -> C` (which is a valid, if bizarre, alternative syntax to `Fn(A, B) -> C` to lower incorrectly.
And also fix a maybe-bug where parentheses were sneaked into a code string needlessly; this was not detected until now because the parentheses were removed (by the make-AST family API), but with a change in this commit they are now inserted. So fix that too.
2024-12-04 14:22:56 +02:00
Chayim Refael Friedman
4e475a3245
Store some hir_def Paths in the type ref source maps
...
Most paths are types and therefore already are in the source map, but the trait in impl trait and in bounds are not.
We do this by storing them basically as `TypeRef`s. For convenience, I created a wrapper around `TypeRefId` called `PathId` that always stores a path, and implemented indexing from the types map to it.
Fortunately, this change impacts memory usage negligibly (adds 2mb to `analysis-stats .`, but that could be just fluff). Probably because there aren't that many trait bounds and impl traits, and this also shrinks `TypeBound` by 8 bytes.
I also added an accessor to `TypesSourceMap` to get the source code, which will be needed for diagnostics.
2024-12-04 14:09:50 +02:00
Lukas Wirth
65c0b29720
Fix parsing of parenthesized type args and RTN
2024-12-04 11:48:47 +01:00
Tarek
c43d565def
refactor: change target parameter to a reference in add_rewrite method
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 12:42:27 +02:00
Tarek
7149c4dab9
feat: migrate sort_items
assist to use SyntaxFactory
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04 12:42:26 +02:00
Lukas Wirth
edb432639b
Merge pull request #18609 from ChayimFriedman2/unsafe-coverage
...
feat: Extend reported unsafe operations
2024-12-04 06:40:40 +00:00
Lukas Wirth
99c9a9942a
Merge pull request #18604 from ChayimFriedman2/complete-helpers
...
feat: Complete derive helper attributes
2024-12-04 06:33:29 +00:00
Chayim Refael Friedman
327b8c9f93
Extend reported unsafe operations
...
We add union fields access (in both expressions and patterns) and inline assembly.
That completes the unsafe check (there are some other unsafe things but they are unstable), and so also opens the door to reporting unused unsafe without annoying people about their not-unused unsafe blocks.
2024-12-04 08:27:59 +02:00
Chayim Refael Friedman
890d155ffe
Complete derive helper attributes
...
Only their names, anything can go inside.
2024-12-04 08:20:41 +02:00
Lukas Wirth
ab652f7795
Merge pull request #18608 from Veykril/push-rrozmpnyknkx
...
Better parser recovery for paths
2024-12-04 06:18:39 +00:00
Lukas Wirth
83f5150978
Update mbe test output
2024-12-04 07:03:11 +01:00
Lukas Wirth
caba872f88
fix: Don't create empty path nodes
2024-12-04 07:01:45 +01:00
Lukas Wirth
b6fc9c14ac
Better parser recovery for incomplete attributes
2024-12-04 06:45:59 +01:00
Lukas Wirth
308f5e2814
Merge pull request #18522 from tareknaser/configure_typing_exclude_chars
...
Add Configurable Option to Exclude Trigger Characters for Typing Assists
2024-12-04 05:17:40 +00:00
Lukas Wirth
4b4cec882a
Merge pull request #18605 from ChayimFriedman2/wildcard-imports
...
fix: Fixed another bug with glob imports
2024-12-04 05:15:46 +00:00
Laurențiu Nicola
c195d843f4
Merge pull request #18595 from markmurphydev/remove_platform_intrinsic
...
Remove references to platform-intrinsic ABI
2024-12-04 04:07:25 +00:00
Laurențiu Nicola
273d481922
Merge pull request #18607 from ChayimFriedman2/pattern-record-no-record
...
fix: Fix shadowing of record enum variant in patterns
2024-12-04 03:51:41 +00:00
Chayim Refael Friedman
4ec7e61229
Fix shadowing of record enum variant in patterns
2024-12-04 04:02:54 +02:00
Chayim Refael Friedman
3aeb5e66c4
Improve soundness a bit by making TaggedArcPtr::try_as_arc_owned()
unsafe
...
Since the `ManuallyDrop` it returns can be safely used to consume the `Arc`, which is can cause UB if done incorrectly. See #18499 .
2024-12-04 03:38:37 +02:00
Chayim Refael Friedman
215cbe9e71
Fixed another bug with glob imports
...
When a glob import overriding the visibility of a previous glob import was not properly resolved when the items are only available in the next fixpoint iteration.
The bug was hidden until #18390 .
2024-12-04 03:15:32 +02:00
Mark Murphy
1dbe681757
Remove references to platform-intrinsic ABI
2024-12-03 17:30:17 -05:00
Tarek
9aff46632e
chore: deprecate typing.autoClosingAngleBrackets
configuration
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-03 22:38:51 +02:00
Tarek
d6b701e251
internal: Make exclude characters for typing assists configurable, default to None
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-03 22:38:51 +02:00
Chayim Refael Friedman
4049c3b6a9
Support AsyncFnX
traits
...
Only in calls, because to support them in bounds we need support from Chalk. However we don't yet report error from bounds anyway, so this is less severe.
The returned future is shown in its name within inlay hints instead of as a nicer `impl Future`, but that can wait for another PR.
2024-12-03 21:26:26 +02:00
Lukas Wirth
e6276c8b64
Merge pull request #18555 from ChayimFriedman2/issue-17321
...
fix: Fix a bug when synthetic AST node were searched in the AST ID map and caused panics
2024-12-03 15:39:52 +00:00
Kirill Bulatov
4261ac7856
Advertise completions and inlay hints resolve server capabilities based on the client capabilities.
2024-12-03 10:51:17 +02:00
Kornel
8e51a0a75c
Use c"lit" for CStrings without unwrap
2024-12-02 18:16:36 +00:00
Lukas Wirth
aa38be893c
Merge pull request #18561 from markmurphydev/macro_name_raw_variable
...
Add macro expansion test for raw variable names
2024-12-02 16:23:07 +00:00
Lukas Wirth
e7b96dd2de
fix: Fix syntax fixup inserting unnecessary semicolons
2024-12-02 13:35:58 +01:00
Michael Goulet
29d59c58d8
Remove redundant associated type bounds from dyn
2024-11-30 03:33:33 +00:00
Laurențiu Nicola
6db5e962ca
Fix proc macro test
2024-11-28 09:40:14 +02:00
Laurențiu Nicola
6f8286dcbc
Merge from rust-lang/rust
2024-11-28 08:37:36 +02:00
Ali Bektas
61e9c02dd8
Remove target.is_some() to handle it later inside ra::flycheck
2024-11-26 18:54:25 +01:00
Ali Bektas
4a910095da
Revert #18197
...
Our first attempt to make flycheck only check the current crate
if the crate is one of bin/bench/test targets had caused
`check_workspace` to be ignored, which should have been a config
with higher precedence all along. This commit revert #18197 and closes #18562
2024-11-26 18:37:39 +01:00
Laurențiu Nicola
8d5e91c94f
Merge pull request #18511 from darichey/sysroot-query-metadata
...
Re-add `rust-analyzer.cargo.sysrootQueryMetadata`
2024-11-26 15:11:44 +00:00
Mark Murphy
a53ee64e70
Add macro expansion test for raw variable names
2024-11-26 00:42:27 -05:00
Laurențiu Nicola
157c7d0114
Merge pull request #18559 from ChayimFriedman2/recur-unsized
...
fix: Fix a stack overflow when computing the sizedness of a struct that includes itself as the tail field
2024-11-25 19:24:00 +00:00
Chayim Refael Friedman
0d43932235
Fix a stack overflow when computing the sizedness of a struct that includes itself as the tail field
2024-11-25 20:49:35 +02:00
Shoyu Vanilla
6aa5ea5411
Migrate add_turbo_fish
to SyntaxEditor
2024-11-26 01:47:15 +09:00
Chayim Refael Friedman
b66bc91b4b
Fix a bug when synthetic AST node were searched in the AST ID map and caused panics
2024-11-25 14:52:58 +02:00
Laurențiu Nicola
8fc5f3deb5
Fix missing rust-src message
2024-11-24 18:27:40 +02:00
David Barsky
c0bbbb3e5d
Merge pull request #18485 from davidkurilla/feat-migrate-add_braces-to-use-SyntaxFactory
...
feat: convert add_braces to SyntaxFactory SyntaxEditor abstraction
2024-11-19 21:05:17 +00:00
David Barsky
84078238c1
Merge pull request #18521 from tareknaser/syntax_factory_reorder_impl_items
...
Migrate `reorder_impl_items` Assist to Use `SyntaxFactory`
2024-11-19 20:38:57 +00:00
Laurențiu Nicola
a9aaa90d45
Merge pull request #18529 from cmrschwarz/allow_leading_whitespace_in_merge_match_arms
...
Improve selection handling for the `merge_match_arms` assist
2024-11-19 17:45:52 +00:00
Laurențiu Nicola
e761618aa4
Merge pull request #18459 from Giga-Bowser/match-placeholders
...
feat: Use snippet placeholders for generated match arms
2024-11-19 17:12:16 +00:00
Christian Schwarz
f12d5e3f20
improve selection handling for merge_match_arms
2024-11-19 08:22:13 +01:00
Nicholas Nethercote
81aa2d2b10
Remove TokenKind::InvalidPrefix
.
...
It was added in #123752 to handle some cases involving emoji, but it
isn't necessary because it's always treated the same as
`TokenKind::InvalidIdent`. This commit removes it, which makes things a
little simpler.
2024-11-19 18:06:22 +11:00
David Richey
3c98b98ca7
Re-add rust-analyzer.cargo.sysrootQueryMetadata
2024-11-18 16:29:33 -06:00
Tarek
05c2c162a5
feat: migrate reorder_impl_items
assist to use SyntaxFactory
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-11-17 12:17:44 +02:00
Chayim Refael Friedman
72e280a5e7
Fix related documents diagnostics
...
They were converted to LSP position using the current file's line index, which is obviously wrong.
2024-11-16 21:17:15 +02:00
David Kurilla
888f9606d1
style: remove needless borrow
2024-11-15 19:08:01 +00:00
David Kurilla
b68ae2b150
style: cargo fmt
2024-11-15 18:02:16 +00:00