Commit Graph

27964 Commits

Author SHA1 Message Date
bors
2397e7a887 Auto merge of #16787 - pksunkara:remove-macro-call-check, r=lnicola
Remove unncessary check for macro call

Since `macro_rules` is a contextual keyword, it is an `IDENT` token and thus `is_path_start` already identifies it correctly. You can tell the previous check is unnecessary because the relevant tests still pass.
2024-03-08 13:23:31 +00:00
bors
2b7b44bf27 Auto merge of #16786 - pksunkara:improve-readability, r=lnicola
internal: Improve readability of the parser code

The code is basically equivalent to the previous version, but it improves the readability by making it much more simpler and concise.
2024-03-08 12:21:18 +00:00
bors
1487bc2af6 Auto merge of #16785 - pksunkara:remove-crate-visibility-recovery, r=lnicola
internal: Remove unused keyword from visibility recovery

We removed support `crate` visibility keyword, but forgot to remove it from the recovery token list.
2024-03-08 12:08:06 +00:00
Pavan Kumar Sunkara
a838e44032 Remove unncessary check for macro call 2024-03-08 12:03:35 +00:00
Pavan Kumar Sunkara
2a41b2cd94 Improve readability of the parser code 2024-03-08 12:00:24 +00:00
Pavan Kumar Sunkara
b37ccfce44 Remove unused keyword from visibility recovery 2024-03-08 11:53:03 +00:00
bors
00a0125372 Auto merge of #16782 - DropDemBits:format-string-exprs-comments, r=Veykril
fix: Preserve $ and \ in postfix format completions

`parse_format_exprs` doesn't escape these two as of #16781, so they have to be escaped as a separate step.
2024-03-08 08:23:04 +00:00
DropDemBits
bc381837e3
fix: Preserve $ and \ in postfix format completions
`parse_format_exprs` doesn't escape these two anymore, so they have to be escaped as a separate step.
2024-03-07 16:55:09 -05:00
DropDemBits
7dadc64d1c
minor: Update comments in format_string_exprs
`parse_format_exprs` no longer handles escaping `$` and `\`
2024-03-07 16:08:20 -05:00
bors
48cb059182 Auto merge of #16781 - DropDemBits:extract-format-args-escaping, r=Veykril
fix: Don't escape `\` and `$` in "Extract format expressions" assist

Fixes #16745
2024-03-07 20:04:33 +00:00
DropDemBits
1f37e5ac9a
fix: Don't escape \ and $ in "Extract format expressions" assist 2024-03-07 14:20:23 -05:00
bors
7f19beb9b4 Auto merge of #16779 - lnicola:skip-unknown-types-match-diagnostics, r=Veykril
minor: Skip match diagnostics for partially unknown types

CC https://github.com/rust-lang/rust-analyzer/issues/16746#issuecomment-1981071008
2024-03-07 17:26:16 +00:00
Laurențiu Nicola
cd2347e132 Skip match diagnostics for partially unknown types 2024-03-07 19:11:23 +02:00
bors
bbb441ec6d Auto merge of #16778 - Nadrieril:update-pat-ana, r=lnicola
Update `rustc_pattern_analysis` to 0.42.0

There was an important API change in 0.41.0, and (hopefully) a fix for https://github.com/rust-lang/rust-analyzer/issues/16774 in 0.42.0.
2024-03-07 16:22:26 +00:00
Nadrieril
e31484c108 Update the other crates too 2024-03-07 16:44:46 +01:00
Nadrieril
1b0b4220fd Update rustc_pattern_analysis to 0.42.0 2024-03-07 16:33:31 +01:00
bors
b1f6d56e44 Auto merge of #16777 - Veykril:body-invalid, r=Veykril
fix: Don't invalid body query results when generating desugared names

The hack remains until we get hygiene, but with this the generated names are stable across bodies
2024-03-07 14:21:26 +00:00
Lukas Wirth
09b9a921a8 fix: Don't invalid body query results when generating desugared names 2024-03-07 15:03:16 +01:00
bors
e101f24798 Auto merge of #16776 - Veykril:parse-macro-parse, r=Veykril
fix: Don't force draw a dependency edge to the real_span_map query

This can cause extra invalidations as like direct `AstIdMap` dependencies
2024-03-07 13:19:36 +00:00
Lukas Wirth
c04c0dd5ba fix: Don't force draw a dependency edge to the real_span_map query 2024-03-07 14:14:59 +01:00
bors
0ffc1ef115 Auto merge of #16775 - Veykril:parse-macro-parse, r=Veykril
fix: Remove accidental dependency between `parse_macro_expansion` and `parse`

Turns out my idea from https://github.com/rust-lang/rust-analyzer/pull/15251 causes all builtin derive expansions to obviously rely on the main parse, meaning the entire `macro_arg` layer becomes kind of pointless. So this reverts that PR again.
2024-03-07 10:47:35 +00:00
bors
a1fda6476c Auto merge of #16742 - alibektas:13529/source_root_tree, r=Veykril
internal: Implement parent-child relation for `SourceRoot`s

This commit adds the said relation by keeping a map of type `FxHashMap<SourceRootId,Option<SourceRootId>>` inside the `GlobalState`. Its primary use case is reading `rust-analyzer.toml`(#13529)  files that can be placed in every local source root. As a config will be found by traversing this "tree" we need the parent information for every local source root. This commit omits defining this relation for library source roots entirely.
2024-03-07 10:30:08 +00:00
bors
00f6a7aced Auto merge of #16772 - Veykril:salsa-tracing, r=Veykril
internal: Add tracing spans to macro generated database
2024-03-07 10:16:53 +00:00
Lukas Wirth
bd0ffb0248 Remove accidental dependency between parse_macro_expansion and parse 2024-03-07 11:16:40 +01:00
Lukas Wirth
9c2fa76c84 Dedup hprof stuff 2024-03-07 10:21:50 +01:00
Lukas Wirth
09d33f3e1e Add diagnostics integrated benchmark 2024-03-07 09:33:48 +01:00
Lukas Wirth
a3b6e891ea Add tracing spans to macro generated database 2024-03-06 20:19:36 +01:00
Ali Bektas
9c50d129da Opt for FxHashMap<Id,Id> instead of <Id,Option<Id>> and apply requested changes 2024-03-06 19:55:04 +01:00
Ali Bektas
a15cc86c64 Implement parent-child relation for SourceRoots
This commit adds the said relation by keeping a map of type `FxHashMap<SourceRootId,Option<SourceRootId>>`
inside the `GlobalState`. Its primary use case is reading the rust-analyzer.toml files that can be
placed under every local source root. As a config will be found by traversing this "tree" we need the parent information
for every local source root. This commit omits defining this relation for library source roots entirely.
2024-03-06 19:55:04 +01:00
bors
ce15e73a8e Auto merge of #16773 - Veykril:text-explorer, r=Veykril
fix: Add config and capability for test explorer
2024-03-06 18:26:40 +00:00
Lukas Wirth
1c6d1b4f2a fix: Add config and capability for test explorer 2024-03-06 19:20:58 +01:00
Wyatt Herkamp
4f0bc1a314 Typo 2024-03-06 11:51:45 -05:00
Wyatt Herkamp
255ba692aa Added tests, added Union Support, and code cleanup 2024-03-06 10:55:47 -05:00
bors
e5889c9b43 Auto merge of #16770 - roife:fix-issue-16278, r=Veykril
fix: panic when using float numbers without dots in chain calls

Fix #16278.

This PR fixes the panic caused by using floating-point numbers without a dot (such as `1e2`) in chain calls.

-------------

Although this syntax is very odd 🤣, r-a should not panic.
2024-03-06 15:38:35 +00:00
roife
91d181feff minor: fmt and clippy 2024-03-06 23:32:40 +08:00
roife
e2daee61bc test: add test for float_split_scientific_notation 2024-03-06 22:51:22 +08:00
roife
03420c330e fix: panic when split float numbers in scientific notation 2024-03-06 22:50:50 +08:00
bors
b85d38f7d6 Auto merge of #16755 - Veykril:rustup-bins, r=Veykril
For toolchain binaries use the full path found in $PATH

Fixes https://github.com/rust-lang/rust-analyzer/issues/16754
2024-03-06 14:47:32 +00:00
bors
1a55ab30f6 Auto merge of #16769 - ShoyuVanilla:issue-15412, r=Veykril
fix: Function argument type inference with associated type impl trait

Fixes #15412
2024-03-06 12:51:10 +00:00
Shoyu Vanilla
a8f56112ea fix: Function argument type inference with associated type impl trait 2024-03-06 21:16:41 +09:00
bors
52d8ae791d Auto merge of #16766 - roife:fix-issue-15198, r=Veykril
fix: keep attributes in assist 'generate_delegate_trait'

fix #15198.

This PR address the issue that `impl` generated by `generate_delegate_trait` doesn't keep attributes.
2024-03-06 09:27:49 +00:00
roife
5c9ce7b11f test: add tests for keeping attrs in assist 'generate_delegate_trait' 2024-03-06 15:32:49 +08:00
roife
faea7fca01 fix: keep attrs for assist 'generate_delegate_trait' 2024-03-06 15:32:26 +08:00
bors
767d5d3eab Auto merge of #16662 - HKalbasi:test-explorer, r=HKalbasi
Add test explorer

This PR implements the vscode testing api similar to #14589, this time using a set of lsp extensions in order to make it useful for clients other than vscode, and make the vscode client side logic simpler (its now around ~100 line of TS code)

Fix #3601
2024-03-05 20:50:26 +00:00
hkalbasi
44be2432f5 Add test explorer 2024-03-06 00:05:29 +03:30
bors
916914418a Auto merge of #16763 - regexident:param-accessors, r=Veykril
Add `fn index()` and `fn parent_fn()` accessors for `hir::Param`/`hir::SelfParam`

(the PR is motivated by an outside use of the `ra_ap_hir` crate that would benefit from being able to access a `hir::Param`'s/`hir::SelfParam`'s index and parent function)
2024-03-05 15:12:18 +00:00
Vincent Esche
bf141310f8 Add fn index() accessor for hir::Param 2024-03-05 16:02:22 +01:00
Vincent Esche
1afeea85ff Add fn parent_fn() accessors for hir::Param & hir::SelfParam 2024-03-05 16:01:01 +01:00
Wyatt Herkamp
6027eae51e Fix Tests + Fix Warnings 2024-03-05 08:34:52 -05:00
Wyatt Herkamp
b45cfe15b5 Added quickfix for unresolved field. 2024-03-05 08:07:21 -05:00