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
Tarek
5c41c20c11
feat: migrate reorder_fields
assist to use SyntaxFactory
...
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-11-13 15:02:08 +02:00
David Kurilla
c768a24673
fix: remove unused imports
2024-11-13 00:06:12 +00:00
David Kurilla
f3715c1d22
fix: fix indentation error
2024-11-12 23:58:24 +00:00
David Kurilla
9a805a2abd
fix: fix immutable tree error
2024-11-12 22:43:48 +00:00
Kirill Bulatov
81636f1fd1
Use completion item indices instead of property matching when searching for the completion item to resolve
2024-11-11 15:50:04 +01:00
Laurențiu Nicola
aabab29274
Merge pull request #18482 from regexident/hir_trait_supertraits_accessors
...
internal: Add public `direct_supertraits(…)` & `all_supertraits(…)` accessor methods to `hir::Trait`
2024-11-11 06:58:17 +00:00
Laurențiu Nicola
1042a8c22c
Merge pull request #18490 from ShoyuVanilla/dyn-compat-rename
...
minor: Rename `dyn compatible` to `dyn-compatible`
2024-11-07 14:21:40 +00:00
Shoyu Vanilla
05e5f9e4fd
minor: Rename dyn compatible
to dyn-compatible
2024-11-07 23:00:29 +09:00
David Kurilla
9f87bdc08a
feat: convert add_braces to SyntaxFactory SyntaxEditor abstraction
2024-11-06 14:45:00 +00:00
Vincent Esche
e6461522bc
Add direct_supertraits(…)
HIR-level method to hir::Trait
type
2024-11-06 10:02:13 +01:00
Vincent Esche
c1155213f3
Add pub fn direct_super_traits(db, trait_id)
to hir_ty
crate
2024-11-06 10:02:13 +01:00
Vincent Esche
5a9767b115
Refactor hir::Trait
's existing items_with_supertraits(…)
method based on new all_supertraits(…)
method
2024-11-06 10:02:13 +01:00
Vincent Esche
89a002ef9b
Add pub fn all_supertraits(…)
HIR-level method to hir::Trait
type
2024-11-06 10:02:13 +01:00
Giga Bowser
494bde3c13
Properly use final tabstop when adding missing match arms
2024-11-05 12:19:20 -05:00
Lukas Wirth
1d65cd466f
Merge pull request #18475 from Veykril/push-zkvkpxttozup
...
Support new #[rustc_intrinsic] attribute and fallback bodies
2024-11-04 12:48:00 +00:00
Lukas Wirth
36d68c5d0f
Support new #[rustc_intrinsic] attribute and fallback bodies
2024-11-04 13:33:55 +01:00
Lukas Wirth
9ad98df61d
Merge pull request #18473 from Veykril/push-xnlzukoqttvz
...
Render extern blocks in `file_structure`
2024-11-04 11:34:35 +00:00
Lukas Wirth
3ceaf1fb68
Render extern blocks in file_structure
2024-11-04 12:21:05 +01:00
Laurențiu Nicola
881ef8bf13
Fix feature name casing
2024-11-04 10:27:32 +02:00
Lukas Wirth
78f3112626
Allow interpreting consts and statics with interpret function command
2024-11-03 15:35:45 +01:00
Lukas Wirth
20ab9708b4
Merge pull request #18469 from Veykril/push-zwnywqmvtuts
...
feat: Show `static` values on hover
2024-11-03 13:00:32 +00:00
benluiwj
1c71a50e01
Improve error message for too new proc-macro server
2024-11-02 21:46:05 +08:00
Lukas Wirth
94c35f6138
Allow static initializers to be const evaluated
2024-11-02 12:43:11 +01:00
Giga Bowser
92b2b3d26b
Use snippet placeholders for generated match arms
2024-11-01 12:35:01 -04:00
Laurențiu Nicola
b385bf2e53
Format code
2024-11-01 14:12:18 +02:00
Laurențiu Nicola
fabe447c7d
Merge from rust-lang/rust
2024-11-01 13:14:25 +02:00
Chayim Refael Friedman
210ead8454
Parse patterns with leading pipe properly in all places
2024-10-31 15:32:37 +02:00
Lukas Wirth
86a850d49e
Merge pull request #18447 from ChayimFriedman2/cleanup-tylowerctx
...
Avoid interior mutability in `TyLoweringContext`
2024-10-31 12:48:17 +00:00
bjorn3
ad858841e7
Remove support for compressed dylib metadata from rust-analyzer
2024-10-31 12:48:09 +00:00
Lukas Wirth
1aac2c637b
Merge pull request #18448 from Veykril/push-zwuuoytnmnqz
...
Move `child_by_source` from `hir-def` to `hir`
2024-10-31 08:42:59 +00:00
Lukas Wirth
70348faf2b
Move child_by_source from hir-def to hir
2024-10-31 09:28:08 +01:00
Lukas Wirth
fb8ca32d06
Merge pull request #18437 from sam-mccall/publish_fixture
...
Publish test-fixture => ra_ap_test_fixture
2024-10-31 08:03:44 +00:00
Chayim Refael Friedman
4317927231
Avoid interior mutability in TyLoweringContext
...
This requires some serious code juggling.
2024-10-30 21:24:19 +02:00
Chayim Refael Friedman
3a8dc27e72
Only parse safe
as contextual kw in extern blocks
...
I don't like the party of `bool`s that is becoming, but two isn't worth a refactoring yet IMO.
2024-10-30 19:28:33 +02:00
Lukas Wirth
223979bf97
Merge pull request #18382 from dqkqd/issue-17042
...
fix: auto-complete import for aliased function and module
2024-10-30 09:42:46 +00:00
Lukas Wirth
bb3239d415
Merge pull request #18385 from Giga-Bowser/master
...
feat: Add assist to generate a type alias for a function
2024-10-30 09:36:55 +00:00
Lukas Wirth
436ace3ecb
Merge pull request #18436 from Veykril/lw-yvkqwpnwsouo
...
Do not render meta info when hovering usages
2024-10-30 09:21:35 +00:00
Jubilee Young
92faf55954
rust-analyzer: rustc_abi::Abi
=> BackendRepr
2024-10-29 15:01:01 -07:00
Lukas Wirth
a953875f49
Style hover messages a bit differently
2024-10-29 16:59:48 +01:00
Sam McCall
98f3304831
Publish test-fixture => ra_ap_test_fixture
2024-10-29 16:26:18 +01:00
Lukas Wirth
3741b863a6
Do not render meta info when hovering usages
2024-10-29 15:34:17 +01:00
Lukas Wirth
468b5cd430
Merge pull request #18432 from Veykril/lw-yptzmuxyvxxt
...
fix: Fix the server not honoring diagnostic refresh support
2024-10-29 10:32:11 +00:00
Lukas Wirth
1da6138b40
fix: Fix the server not honoring diagnostic refresh support
2024-10-29 11:06:16 +01:00
Lukas Wirth
3fd6a72556
Merge pull request #18427 from ChayimFriedman2/cleanup-ty
...
Cleanup TypeRef lowering
2024-10-29 10:00:44 +00:00
Laurențiu Nicola
779074df51
Merge from rust-lang/rust
2024-10-29 08:13:34 +02:00
Chayim Refael Friedman
41658de227
Cleanup TypeRef lowering
...
By removing interior mutability from it.
2024-10-28 17:38:37 +02:00
Lukas Wirth
cf8f950baa
Merge pull request #18420 from ChayimFriedman2/cfg-true-false
...
feat: Support `cfg(true)` and `cfg(false)`
2024-10-28 13:56:41 +00:00
Lukas Wirth
8672eb8adb
Merge pull request #18421 from Veykril/push-uxxwvwnqvomr
...
Move text-edit into ide-db
2024-10-28 13:52:16 +00:00
Lukas Wirth
09547e9ea5
Merge pull request #18413 from ShoyuVanilla/extern-crate-reexport
...
fix: Allow public re-export of `extern crate` import
2024-10-28 13:51:26 +00:00
Lukas Wirth
343abd9193
Merge pull request #18422 from ChayimFriedman2/cursed-name-res
...
fix: Properly resolve prelude paths inside modules inside blocks
2024-10-28 13:45:19 +00:00
Lukas Wirth
68e2d8465f
Merge pull request #18312 from LastExceed/symbolkind-variable
...
Report document symbols of kind `variable` for let statements
2024-10-28 13:40:42 +00:00
Lukas Wirth
27306c5e4b
Reformat
2024-10-28 14:37:52 +01:00
Lukas Wirth
64f56f458f
Move text-edit into ide-db
2024-10-28 14:37:41 +01:00
Lukas Wirth
80e9d014be
Merge pull request #18074 from ChayimFriedman2/typeref-source-map
...
internal: Build source map for `hir_def::TypeRef`s
2024-10-28 11:01:12 +00:00
Laurențiu Nicola
ae86e6a229
Merge pull request #18256 from MoskalykA/use-is_none_or
...
Start using `Option::is_none_or`
2024-10-28 10:12:36 +00:00
Jubilee Young
f806406728
rust-analyzer: Rename LayoutS to LayoutData
2024-10-27 22:32:58 -07:00
LastExceed
167fe5fd7c
add test
2024-10-27 23:29:14 +01:00
LastExceed
7c8c28ce96
add LetStmt arm
2024-10-27 23:29:14 +01:00
Chayim Refael Friedman
1fed2403d1
Properly resolve prelude paths inside modules inside blocks
...
I.e. the following situation:
```
fn foo() {
mod bar {
fn qux() {
// Prelude path here (e.g. macro use prelude or extern prelude).
}
}
}
```
Those were previously unresolved, because, in order to support `self` and `super` properly, since #15148 we do not ascend block paths when there is a module in between, but only crate def maps register preludes, not block def maps, and we can't change this because block def map prelude can always be overridden by another block. E.g.
```
fn foo() {
struct WithTheSameNameAsPreludeItem;
{
WithTheSameNameAsPreludeItem
}
}
```
Here `WithTheSameNameAsPreludeItem` refer to the item from the top block, but if we would register prelude items in each block the child block would overwrite it incorrectly.
2024-10-27 19:23:12 +02:00
Shoyu Vanilla
eb2a50e75d
fix: Allow public re-export of extern crate
import
2024-10-27 23:44:44 +09:00
Lukas Wirth
3b3a87fe9b
Merge pull request #18419 from ChayimFriedman2/leading-or
...
fix: Put leading `|` in patterns under `OrPat`
2024-10-27 11:25:16 +00:00
Chayim Refael Friedman
e12a001b55
Put leading |
in patterns under OrPat
...
Previously it was one level above, and that caused problems with macros that expand to it, because macros expect to get only one top-level node.
2024-10-27 13:11:38 +02:00
Lukas Wirth
715b67c425
Merge pull request #18410 from Veykril/veykril/push-lvwxpnowqrxk
...
internal: Invert token iteration order in macro mapping
2024-10-27 10:44:32 +00:00
Lukas Wirth
20ac30fb75
Invert token iteration order in macro mapping
2024-10-27 11:32:12 +01:00
Lukas Wirth
79b86f25b4
Merge pull request #18418 from ChayimFriedman2/explicitly-disable
...
feat: Split `macro-error` diagnostic so users can ignore only parts of it
2024-10-27 09:37:56 +00:00
Lukas Wirth
8d10e248c8
Merge pull request #18417 from ChayimFriedman2/hash-string
...
fix: Correctly handle `#""` in edition <2024
2024-10-27 09:28:47 +00:00
Chayim Refael Friedman
074050c242
Support cfg(true)
and cfg(false)
...
As per RFC 3695.
2024-10-27 10:46:49 +02:00
Chayim Refael Friedman
f4585ea023
Split macro-error
diagnostic so users can ignore only parts of it
...
Split it into `macro-error`, `proc-macros-disabled` and `proc-macro-disabled`.
2024-10-27 02:24:15 +02:00
Chayim Refael Friedman
3b3beaab31
Correctly handle #""
in edition <2024
2024-10-27 00:47:13 +03:00
MoskalykA
feba680c39
Use method syntax
2024-10-26 09:39:04 +03:00
MoskalykA
41fa877362
Start using Option::is_none_or
2024-10-26 09:39:04 +03:00
Laurențiu Nicola
4e3c331d86
Turn Remove dbg into a quick fix for better prioritization
2024-10-26 09:06:10 +03:00
Lukas Wirth
ca3699bd50
Factor out token ranking
2024-10-25 12:03:12 +02:00
Lukas Wirth
a12f1781eb
Only construct a resolver in macro descension when needed
2024-10-25 10:23:59 +02:00
Lukas Wirth
52a03ec237
Merge pull request #18408 from Veykril/veykril/push-ulxyznwzokut
...
fix: Don't compute diagnostics for non local files
2024-10-25 05:55:32 +00:00
Lukas Wirth
8eef1c5275
Add server cancellation support to pull diagnostic handler
2024-10-25 07:39:28 +02:00
Lukas Wirth
eac7840810
Don't compute diagnostics for non local files
2024-10-25 07:28:29 +02:00
Chayim Refael Friedman
bf7edd3783
Shrink TypeRef
from 16 from 32 bytes
...
Only references and arrays need to be boxed, and they comprise only 9.4% of the types (according to counting on r-a's code).
This saves 17mb.
2024-10-25 06:44:56 +03:00
Chayim Refael Friedman
061e5d7f71
Shrink Path
to 16 bytes
...
Thanks to the observation (supported by counting) that the vast majority paths have neither generics no type anchors, and thanks to a new datastructure `ThinVecWithHeader` that is essentially `(T, Box<[U]>)` but with the size of a single pointer, we are able to reach this feat.
This (together with `ThinVecWithHeader`) makes the possibility to shrink `TypeRef`, because most types are paths.
2024-10-25 06:44:56 +03:00
Chayim Refael Friedman
bccf0062b7
Do not allocate attributes entry if there are no attributes
...
This saves 8mb.
2024-10-25 06:15:06 +03:00
Chayim Refael Friedman
d0933cc097
Shrink ItemTreeSourceMaps
...
This saves 16mb on `analysis-stats .`.
2024-10-25 06:15:06 +03:00
Chayim Refael Friedman
39747cb518
Reuse empty GenericParams
...
This saves back 15mb that went for typeref source maps.
2024-10-25 06:15:06 +03:00
Chayim Refael Friedman
1fae57fa55
Fix memory usage calculation's queries list
2024-10-25 06:15:06 +03:00
Chayim Refael Friedman
89c0ffa6b0
Build source map for hir_def::TypeRef
s
...
So that given a `TypeRef` we will be able to trace it back to source code.
This is necessary to be able to provide diagnostics for lowering to chalk tys, since the input to that is `TypeRef`.
This means that `TypeRef`s now have an identity, which means storing them in arena and not interning them, which is an unfortunate (but necessary) loss but also a pretty massive change. Luckily, because of the separation layer we have for IDE and HIR, this change never crosses the IDE boundary.
2024-10-25 06:15:04 +03:00
Giga Bowser
f753ff2242
Rework generate_fn_type_alias
2024-10-24 17:54:58 -04:00
Giga Bowser
a87e1aad81
Add ty_fn_ptr
function to create function pointer type
2024-10-24 17:46:14 -04:00
Lukas Wirth
58e9871038
Merge pull request #18404 from Veykril/veykril/push-swpmkoqqxrvu
...
feat: Implement diagnostics pull model
2024-10-24 15:22:49 +00:00
Lukas Wirth
8b59541237
feat: Implement diagnostics pull model
2024-10-24 17:09:43 +02:00
Lukas Wirth
6005446327
Merge pull request #18402 from Veykril/veykril/push-wrvtystlszlr
...
internal: Improve proc-macro error msg for failed build scripts
2024-10-24 12:01:29 +00:00
Lukas Wirth
fc4586e3b6
Merge pull request #18401 from Veykril/veykril/push-ulpowvsymyys
...
minor: Remove intermediate allocations
2024-10-24 11:48:27 +00:00
Lukas Wirth
e4a6efb9e0
internal: Improve proc-macro error msg for failed build scripts
2024-10-24 13:45:11 +02:00
Lukas Wirth
98935325ca
minor: Remove intermediate allocations
2024-10-24 13:34:32 +02:00
Khanh Duong Quoc
962d340460
fix: handle aliased pattern and simplify testcase
2024-10-24 20:17:24 +09:00
Khanh Duong Quoc
cf5f1e8620
refactor: separate function for getting import name
2024-10-24 19:57:53 +09:00
Lukas Wirth
c212423912
Merge pull request #18399 from Veykril/veykril/push-nnsoxqrwqkmv
...
Fix diagnostic enable config being ignored
2024-10-24 10:01:22 +00:00
Lukas Wirth
7d0196c35f
Fix diagnostic enable config being ignored
2024-10-24 11:47:12 +02:00
Lukas Wirth
b12fead6da
Merge pull request #18390 from ShoyuVanilla/issue-18308
...
fix: Prevent public re-export of private item
2024-10-24 09:25:06 +00:00
Laurențiu Nicola
bf26f58720
Hide default config in Debug impl
2024-10-24 10:07:54 +03:00
Lukas Wirth
6342667ce1
Merge pull request #18395 from Wilfred/missing_cfg_for_core
...
fix: Add missing cfg flags for `core` crate
2024-10-24 06:14:17 +00:00
Lukas Wirth
3f6b0fae83
Merge pull request #18394 from Wilfred/pretty_print_status
...
internal: Pretty-print Config in status command
2024-10-24 06:12:19 +00:00
Wilfred Hughes
3e51d145c3
fix: Add missing cfg flags for core
crate
...
Some types in `core` are conditionally compiled based on
`target_has_atomic` or `target_has_atomic_load_store` without an
argument, for example `AtomicU64`.
This is less noticeable in Cargo projects, where rust-analyzer adds
the output `RUSTC_BOOTSTRAP=1 cargo rustc --print cfg` so it gets the
full set of cfg flags.
This fixes go-to-definition on `std::sync::atomic::AtomicU64` in
non-cargo projects.
2024-10-23 16:43:08 -07:00
Wilfred Hughes
909144f606
internal: Pretty-print Config in status command
...
Config can become very big, even for relatively small rust project,
and printing everything on one line makes reading the output in VS Code
harder.
2024-10-23 15:18:43 -07:00
Lukas Wirth
40492e15d4
Merge pull request #18392 from Veykril/veykril/push-wktpkuklnzot
...
Swap query call order in `file_item_tree_query`
2024-10-23 20:31:49 +00:00
Lukas Wirth
3936dc59f0
Swap query call order in file_item_tree_query
2024-10-23 22:17:37 +02:00
David Barsky
e5c656d804
internal: log original syntax on panic
2024-10-23 12:56:00 -07:00
Shoyu Vanilla
685fe4b8dc
fix: Prevent public reexport of private item
2024-10-24 04:26:17 +09:00
Jason Boatman
eed86dd597
Rewrite label_details_support
condition to be consistent with other parts of the codebase.
2024-10-23 13:19:53 -05:00
Jason Boatman
d5ca001578
Fix checking for false
labelDetailsSupport
value.
2024-10-23 12:57:11 -05:00
Wilfred Hughes
2b676bfbd7
fix: Handle missing time offsets gracefully
...
The tracing_subscribe docs state that missing offsets likely mean
that we're in a multithreaded context:
https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/time/struct.OffsetTime.html#method.local_rfc_3339
We're not in a multithreaded context at this point, but some platforms
(e.g. OpenBSD) still don't have time offsets available.
Since this is only a rust-analyzer debugging convenience, just use
system time logging in this situation.
Fixes #18384
2024-10-23 09:57:57 -07:00
Giga Bowser
3f48da27dd
Fix alphabetical order of handlers
...
No idea how this slipped past me
2024-10-23 11:54:48 -04:00
Giga Bowser
7b72a82bcb
Add assist to generate a type alias for a function
2024-10-23 11:31:15 -04:00
Khanh Duong Quoc
c4b097719d
fix: auto-complete import for aliased function and module
2024-10-23 22:11:08 +09:00
Lukas Wirth
f9935be013
Merge pull request #18264 from ChayimFriedman2/semi-transparent
...
fix: Implement mixed site hygiene
2024-10-23 12:33:50 +00:00
usamoi
b32127e0b0
fix dyn incompatible hint message
2024-10-23 18:10:14 +08:00
Lukas Wirth
af7c97f97a
Merge pull request #18376 from Veykril/veykril/push-ptmnsoqzsmqk
...
feat: Add text edits to more inlay hints
2024-10-23 08:39:25 +00:00
Lukas Wirth
b837ea4985
Don't emit edits for postfix adjustment hints
2024-10-23 10:24:58 +02:00
Lukas Wirth
47d2359afa
Add text edit to implicit 'static hints
2024-10-23 09:58:20 +02:00
Lukas Wirth
bfaad1431b
Add text edit to discriminant hints
2024-10-23 09:57:00 +02:00
Lukas Wirth
fd17fa10a2
Add text edit to binding mode hints
2024-10-23 09:52:03 +02:00
Lukas Wirth
f086fa9c02
Add text edit to adjustment hints
2024-10-23 09:30:36 +02:00
Chayim Refael Friedman
4ac3dc1a2f
Correctly resolve variables and labels from before macro definition in macro expansion
...
E.g.:
```rust
let v;
macro_rules! m { () => { v }; }
```
This was an existing bug, but it was less severe because unless the variable was shadowed it would be correctly resolved. With hygiene however, without this fix the variable is never resolved.
2024-10-22 21:49:17 +03:00
Chayim Refael Friedman
8adcbdcc49
Implement semitransparent hygiene
...
Or macro_rules hygiene, or mixed site hygiene. In other words, hygiene for variables and labels but not items.
The realization that made me implement this was that while "full" hygiene (aka. def site hygiene) is really hard for us to implement, and will likely involve intrusive changes and performance losses, since every `Name` will have to carry hygiene, mixed site hygiene is very local: it applies only to bodies, and we very well can save it in a side map with minor losses.
This fixes one diagnostic in r-a that was about `izip!()` using hygiene (yay!) but it introduces a huge number of others, because of #18262 . Up until now this issue wasn't a major problem because it only affected few cases, but with hygiene identifiers referred by macros like that are not resolved at all. The next commit will fix that.
2024-10-22 21:26:56 +03:00
Lukas Wirth
c286786888
Merge pull request #18254 from ChayimFriedman2/fix-mut
...
fix: Nail destructuring assignment once and for all
2024-10-22 17:40:52 +00:00
Chayim Refael Friedman
0beec9081d
Add test for tuple struct destructuring assignment where the path comes from a macro
2024-10-22 20:27:09 +03:00
Lukas Wirth
3ae93bcb82
Merge binding_mode inlay hints into one
2024-10-22 17:12:16 +02:00
Lukas Wirth
db60fb42bb
Merge adjustment inlay hints into one
2024-10-22 16:56:13 +02:00
Lukas Wirth
13acfbfae4
Merge closure capture inlay hints into one
2024-10-22 16:29:15 +02:00
bors
d509449d7e
Auto merge of #18370 - duncpro:goto-def-ranges, r=Veykril
...
feat: resolve range patterns to their structs
Closes #18367
2024-10-22 12:24:25 +00:00
bors
4c4f186e23
Auto merge of #18368 - Veykril:test-lsif_contains_generated_macros, r=lnicola
...
tests: Add `lsif_contains_generated_constant` test
Closes https://github.com/rust-lang/rust-analyzer/pull/18309
2024-10-22 12:10:07 +00:00
bors
eddab6e98c
Auto merge of #18349 - dqkqd:issue-18344, r=Veykril
...
feat: render docs from aliased type when type has no docs
Trying to close #18344
- [x] ~Find the docs by traversing upwards if the type itself has none but aliasing for another type that might have.~
- [x] Show docs from aliased type.
- [x] Showing description that we are displaying documentation for different definition in hover box.
![image](https://github.com/user-attachments/assets/820d6f97-aa2c-4dc4-8a25-75746e32d950 )
2024-10-22 11:56:16 +00:00
bors
c58427ff94
Auto merge of #18371 - Veykril:veykril/push-kwttrusywysp, r=Veykril
...
fix: Fix incorrect parsing of use bounds
Fixes https://github.com/rust-lang/rust-analyzer/issues/18357
2024-10-22 11:42:11 +00:00
Lukas Wirth
95298a2e61
fix: Fix incorrect parsing of use bounds
...
Also lower them a bit more
2024-10-22 13:34:26 +02:00
Khanh Duong Quoc
44e48d75dd
feat: render docs from aliased type when docs are missing
2024-10-22 20:27:05 +09:00
Duncan Proctor
4fd471c571
tidy
2024-10-22 06:54:44 -04:00
Duncan Proctor
2e0fae3579
tidy
2024-10-22 06:37:12 -04:00
Duncan Proctor
c679551d6b
remove duplicate test
2024-10-22 06:25:13 -04:00
Duncan Proctor
271f64f94d
resolve range patterns to the their struct types
2024-10-22 06:20:16 -04:00
Lukas Wirth
6c23f25e7f
Fix new nightly lints
2024-10-22 11:48:41 +02:00
Johann Hemmann
505c9c9fb3
tests: Add lsif_contains_generated_constant
test
2024-10-22 11:38:54 +02:00
Lukas Wirth
232432411e
Cleanup file structure proto handling
2024-10-22 10:51:08 +02:00
bors
17055aaca9
Auto merge of #18362 - duncpro:goto-def-ranges, r=Veykril
...
feat: goto definition on range operators
Closes #18342
2024-10-22 07:49:18 +00:00
Duncan Proctor
2f6923b844
tidy
2024-10-22 03:19:47 -04:00
Laurențiu Nicola
a32039278f
Replace some LayoutError variants with the rustc_abi errors
2024-10-22 10:19:25 +03:00
Laurențiu Nicola
250bf98d58
Merge from rust-lang/rust
2024-10-22 10:12:22 +03:00
Duncan Proctor
f54a863965
goto definition on RangeFrom, RangeFull, RangeTo, and RangeToInclusive links to respective struct
2024-10-22 03:11:23 -04:00
duncanproctor
c7a8be110d
Move explicit range handling out of goto_definition, use OperatorClass instead
2024-10-21 20:07:07 -04:00
bors
de2ff17bc5
Auto merge of #18360 - roife:safe-kw-3, r=Veykril
...
feat: better completions for extern blcoks
This PR refactors `add_keywords` (making it much clearer!) and enhances completion for `extern` blocks.
It is recommended to reviewing the changes in order of the commits:
- The first commit (f3c4dde0a4
) doesn’t change any logic but refactors parts of the `add_keywords` function and adds detailed comments.
- The second commit (5dcc1ab649
) improves completion for `extern` kw and extern blocks.
2024-10-21 17:59:05 +00:00
roife
cf3544a0ec
minor: refactor completions in item_list
2024-10-22 01:31:57 +08:00
duncanproctor
3bc6e27993
GotoDefinition on a Range or InclusiveRange operator will link to the struct definition
2024-10-21 11:29:05 -04:00
bors
487152b90f
Auto merge of #18361 - Veykril:veykril/push-uzsokssoyznx, r=Veykril
...
fix: Fix token downmapping failing for include! inputs
Supercedes https://github.com/rust-lang/rust-analyzer/pull/18325
Fixes https://github.com/rust-lang/rust-analyzer/pull/18325
Fixes https://github.com/rust-lang/rust-analyzer/issues/18313
Fixes https://github.com/rust-lang/rust-analyzer/issues/18314
2024-10-21 15:27:42 +00:00
Lukas Wirth
d878b8caad
fix: Fix token downmapping failing for include! inputs
2024-10-21 17:22:18 +02:00
roife
5dcc1ab649
feat: better completions for extern blcoks
2024-10-21 22:23:16 +08:00
roife
f3c4dde0a4
refactor add_keywords in ide-completions for clarity
2024-10-21 22:23:01 +08:00
bors
546da8a5ad
Auto merge of #18294 - Giga-Bowser:master, r=Veykril
...
Add wrap/unwrap return type in Option
I pretty much just copied over the code and tests for wrapping/unwrapping return types in `Result` and then did a bunch of find and replace changes.
I handled unwrapping statements returning `None` by just replacing `None` with the unit type, but I'm open to suggestions for more intuitive behavior here.
2024-10-21 13:56:01 +00:00
bors
dc2a348bdd
Auto merge of #18337 - dqkqd:issue-18287, r=Veykril
...
fix: private items are shown in completions for modules in fn body
Close : #18287
2024-10-21 13:41:27 +00:00