Commit Graph

26760 Commits

Author SHA1 Message Date
dfireBird
20c6f27024
Insert fn call parens only if the parens inserted around field name 2023-12-04 22:37:34 +05:30
werifu
05e8b926e6 fix: bug in extract_function: should not import ControlFlow in some cases 2023-12-04 16:23:18 +08:00
Laurențiu Nicola
30fc9329d1 Merge commit 'e402c494b7c7d94a37c6d789a216187aaf9ccd3e' into sync-from-ra 2023-12-04 09:19:15 +02:00
Lukas Wirth
18f1a3c3c6 Some final touches 2023-12-03 20:20:59 +01:00
Lukas Wirth
81410ab500 Cleanup FileId stuff 2023-12-02 19:32:53 +01:00
Lukas Wirth
02a3a9438a Some more minor cleanups 2023-12-02 17:04:13 +01:00
Lukas Wirth
5edf7bddc6 Fix mod item in included file resolving incorrectly 2023-12-02 13:49:09 +01:00
Lukas Wirth
d2a31acda1 Fix macro expansion expression parenthesis wrapping 2023-12-02 13:03:46 +01:00
Nicholas Nethercote
40da288eb0 Rename LayoutCalculator::delay_bug as LayoutCalculator::delayed_bug.
To match with the previous commits.
2023-12-02 09:01:34 +11:00
Nicholas Nethercote
4375419b24 Rename HandlerInner::delay_span_bug as HandlerInner::span_delayed_bug.
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug`
follows the pattern used everywhere else: `span_err`, `span_warning`,
etc.
2023-12-02 09:01:19 +11:00
bors
e402c494b7 Auto merge of #15879 - dfireBird:fix-14656, r=Veykril
Implement completion for the callable fields.

Fixes #14656

PR is opened with basic changes. It could be improved by having a new `SymbolKind` for the callable fields and implementing a separate render function similar to the `render_method` for the new `SymbolKind`.
It could also be done without any changes to the `SymbolKind` of course, have the new function called based on the type of field.
I prefer the former method.

Please give any thoughts or changes you think is appropriate for this method. I could start working on that in this same PR.
2023-12-01 16:20:36 +00:00
Lukas Wirth
efa67294ed Fix eager macro input spans being discarded 2023-12-01 16:29:58 +01:00
Lukas Wirth
c11737cd63 Simplify include handling 2023-12-01 14:58:57 +01:00
bors
6e6a0b0a3d Auto merge of #16000 - HKalbasi:drop-inlay-hint, r=HKalbasi
Initial support for implicit drop inlay hint

cc #15785
2023-12-01 13:36:08 +00:00
dfireBird
b7effe54ee
fix close parens position to move after field access 2023-12-01 18:55:26 +05:30
Lukas Wirth
0003e568ca Pass calling span through to builtin macro expansions 2023-12-01 14:11:57 +01:00
hkalbasi
4d55cac466 Initial support for implicit drop inlay hint 2023-12-01 16:16:46 +03:30
bors
c2f133489c Auto merge of #15912 - Sarrus1:master, r=HKalbasi
chore: remove unused `PhantomData`

This PR removes an unused `PhantomData` in `FileItemTreeId`.

*Note:* I am not sure how this should be implemented, maybe as a type instead of a wrapper struct? I'd be happy to do so if needed 👍
2023-12-01 11:07:35 +00:00
bors
57e90240a5 Auto merge of #15961 - ohno418:top-level-let-stmt, r=Veykril
Improve error handling for top-level `let` statements

This commit addresses the issue of excessive and unrelated errors generated by top-level `let` statements. Now, only a single error is produced, indicating that `let` statements are invalid at the top level.

---

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

While I'm not really sure if handling a particular case in a special manner is appropriate, it would be good to suppress the excessive number of annoying and unrelated errors.
2023-12-01 10:41:16 +00:00
Yutaro Ohno
e076192dd8 Improve error handling for top-level let statements
This commit addresses the issue of excessive and unrelated errors
generated by top-level `let` statements. Now, only a single error is
produced, indicating that `let` statements are invalid at the top level.
2023-12-01 10:37:21 +09:00
bors
c9d189d137 Auto merge of #15993 - meowtec:fix/workspaces-debug-cwd, r=Veykril
Debug use cargo workspace root as `cwd`

fixes #13022
2023-11-30 19:31:15 +00:00
bors
1c51e25a5a Auto merge of #15994 - ChayimFriedman2:err-comma-after-fus, r=Veykril
fix: Err for comma after functional update syntax

Error message copied from rustc, https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=20aeedb2db504c4e4ced54b665e761d6.

Fixes #15989.
2023-11-30 15:59:31 +00:00
bors
56abc0a29c Auto merge of #15971 - Young-Flash:fix_match_arm, r=lnicola
fix: don't make `MissingMatchArms` diagnostic for empty match body

before
<img width="423" alt="before" src="https://github.com/rust-lang/rust-analyzer/assets/71162630/5c0e46fb-0c03-42f2-96ff-8e5245c25965">

after
<img width="423" alt="after" src="https://github.com/rust-lang/rust-analyzer/assets/71162630/e2479dc5-3634-479b-af29-0b0ec7dc4a4f">

close https://github.com/rust-lang/rust-analyzer/issues/15954
2023-11-30 12:10:45 +00:00
Chayim Refael Friedman
2fd19ed598 Err for comma after functional update syntax 2023-11-30 14:04:36 +02:00
Young-Flash
b46f37854e update: filter out syntax error in test 2023-11-30 19:35:25 +08:00
meowtec
4ca86edac9 Debug use cargo workspace root as cwd. fixes #13022 2023-11-30 19:21:59 +08:00
Lukas Wirth
f48fa0c6cb Re-implement syntax fixups 2023-11-29 16:00:39 +01:00
Ben Kimock
5ef5e55749 Use a u64 for the rmeta root position 2023-11-28 18:03:50 -05:00
dfireBird
21c09eb544
update dot tests function with check_edit 2023-11-28 22:21:57 +05:30
dfireBird
5c0c8ceaf7
refactor complete_fn_fields function and correct branch checks 2023-11-28 22:21:57 +05:30
dfireBird
8296b16f38
fix the insertion of the surronding parens
Before it was inserting whenever function field is found but it should
happend only in the case of function call.
2023-11-28 22:21:57 +05:30
dfireBird
aa1cf8d357
add tests for tuple fields and expect fn type cases 2023-11-28 22:21:57 +05:30
dfireBird
eedeb58a4e
refactor obtaining receivers into idiomatic way
variable name change for clearer usage indication
2023-11-28 22:21:57 +05:30
dfireBird
5bcafd7dc0
add tests for the completion of the callable field 2023-11-28 22:21:57 +05:30
dfireBird
7cf3ab4bd2
implement completion render for callable fields 2023-11-28 22:21:57 +05:30
dfireBird
a0e690a7e9
add different completion for fn fields 2023-11-28 22:21:57 +05:30
Lukas Wirth
7a8c4c001b Turn macro_expand from query to normal function 2023-11-28 17:23:51 +01:00
bors
c7c582afb5 Auto merge of #15985 - davidbarsky:david/bump-triomphe, r=lnicola
internal: bump triomphe to 0.1.10
2023-11-28 15:44:44 +00:00
Lukas Wirth
b98597f06d Re-enable proc-macros 2023-11-28 16:28:56 +01:00
David Barsky
914a1570e2 internal: bump triomphe to 0.1.10 2023-11-28 10:27:17 -05:00
Lukas Wirth
98cfdde8ba Thinner TokenMap 2023-11-28 10:56:25 +01:00
Lukas Wirth
92d447f976 🧹 2023-11-28 10:55:40 +01:00
Lukas Wirth
ab8f12e169 Rename hygiene vars and fields to span_map 2023-11-28 10:55:40 +01:00
Lukas Wirth
6208960c48 Deduplicate dummy test span maps 2023-11-28 10:55:40 +01:00
Lukas Wirth
c43078f99d Re-implement InFile wrappers as type aliases over generic InFileWrapper 2023-11-28 10:55:40 +01:00
Lukas Wirth
30093a6d81 spans always come from real file 2023-11-28 10:55:39 +01:00
Lukas Wirth
394d11b0fa Fix float-split hack not setting up spans correctly 2023-11-28 10:55:39 +01:00
Lukas Wirth
8423893d1c More incremental tests 2023-11-28 10:55:39 +01:00
Lukas Wirth
05f375eae2 hygiene 2.0 2023-11-28 10:55:39 +01:00
Lukas Wirth
e36b3f7b8c Proper span representation with syntax context 2023-11-28 10:55:39 +01:00