Commit Graph

26748 Commits

Author SHA1 Message Date
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
Lukas Wirth
890eb17b4e Replace ID based TokenMap with proper relative text-ranges / spans 2023-11-28 10:55:39 +01:00
Lukas Wirth
f79439caed Infect proc-macro-api crate with generic span type parameter 2023-11-28 10:55:39 +01:00
Lukas Wirth
83f91f61b1 Infect mbe crate with generic span type parameter 2023-11-28 10:55:39 +01:00
bors
2ee17bc5f2 Auto merge of #15970 - Austaras:master, r=Veykril
fix variant resolve for type alias

Closes #15943
2023-11-27 16:26:19 +00:00
bors
4ab67291fa Auto merge of #15857 - Young-Flash:fix, r=Veykril
fix: remove parenthesis should ensure space

close https://github.com/rust-lang/rust-analyzer/issues/15844
2023-11-27 16:14:31 +00:00
bors
9aa867cd01 Auto merge of #15946 - roife:master, r=Veykril
internal: simplify the removal of dulicate workspaces.

### Summary:
Refactoring the duplicate removal process for `workspaces` in `fetch_workspaces`.

### Changes Made:

Replaced `[].iter().enumerate().skip(...).filter_map(...)` with a more concise `[i+1..].positions(...)` provided by `itertools`, which enhances clarity without changing functionality

### Impact:

This change aims to enhance the duplicate removal process for `workspaces`. This change has been tested on my machine.

Please review and provide feedback. Thanks!
2023-11-27 16:02:53 +00:00
bors
23dc01f958 Auto merge of #15976 - lnicola:sync-from-rust, r=lnicola
minor: Sync from rust
2023-11-27 15:03:48 +00:00
Laurențiu Nicola
57172f7b94 Merge branch 'master' into sync-from-rust 2023-11-27 17:01:38 +02:00
Laurențiu Nicola
81606ecf68 Merge commit '237712fa314237e428e7ef2ab83b979f928a43a1' into sync-from-ra 2023-11-27 12:40:39 +02:00
Young-Flash
cab91480b2 fix: don't make MissingMatchArms diagnostic for empty match body 2023-11-26 22:57:30 +08:00
austaras
2411f1383a fix variant resolve for type alias 2023-11-26 21:00:11 +08:00
bors
237712fa31 Auto merge of #15967 - lnicola:salsa-fork, r=lnicola
internal: Switch to our own `salsa` fork

This gets rid of `syn` 1, among others.
2023-11-26 11:11:54 +00:00