about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-07-28Merge from rust-lang/rustLaurențiu Nicola-0/+1
2024-07-28Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2024-07-28Auto merge of #17720 - ThouCheese:fix/doc-to-comment-naming, r=Veykrilbors-2/+2
flip the naming of the doc comment to comment assist I did this the wrong way around when I implemented these assists, so here is a quick fix for it
2024-07-2817470 - run test explorer tests at the package level and add missing ↵duncan-10/+54
extra_test_bin_args settings
2024-07-28Determine toolchain RA on agehuntc-16/+196
Selects a rust-toolchain declared RA based on its date. The earliest (oldest) RA wins and becomes the one that the workspace uses as a whole. In terms of precedence: nightly > stable-with-version > stable With stable-with-version, we invoke the RA with a `--version` arg and attempt to extract a date. Given the same date as a nightly, the nightly RA will win.
2024-07-27feat: add trace level to client logsJosh McKinney-0/+4
2024-07-27feat: use vscode log format for client logsJosh McKinney-46/+44
This change updates the log format to use the vscode log format instead of the custom log format, by replacing the `OutputChannel` with a `LogOutputChannel` and using the `debug`, `info`, `warn`, and `error` methods on it. This has the following benefits: - Each log level now has its own color and the timestamp is in a more standard format - Inspect output (e.g. the log of the config object) is now colored - Error stack traces are now shown in the output - The log level is now controlled on the output tab by clicking the gear icon and selecting "Debug" or by passing the `--log` parameter to vscode. The `trace.extension` setting has been marked as deprecated.
2024-07-28flip the naming of the doc comment to comment assistLuuk Wester-2/+2
2024-07-27Down to 1 failing testAli Bektas-80/+66
And that is due to a case where we have two ratomls in a source root, one of which is a `workspace_ratoml` and the other one is simple old ratoml. Since we are not checking to see if the source root is already populated with workspace ratoml, this test fails. Due to principles of clear code I believe it is reasonable to not have two HashMaps that are almost for the exact same thing. So next commit should remove `workspace_ratoml` and merge it with `krate_ratoml`s.
2024-07-28Fix for #17497 - Invalid RA diagnostic error: expected 2 arguments, found 1Francis McKenzie-3/+47
The issue occurs because in some configurations of traits where one of them has Deref as a supertrait, RA's type inference algorithm fails to resolve the Deref::Target type, and instead uses a TyKind::BoundVar (i.e. an unknown type). This "autoderefed" type then incorrectly acts as if it implements all traits in scope. The fix is to re-apply the same sanity-check that is done in iterate_method_candidates_with_autoref(), that is: don't try to resolve methods on unknown types. This same sanity-check is now done on each autoderefed type for which trait methods are about to be checked. If the autoderefed type is unknown, then the iterating of the trait methods for that type is skipped. Includes a unit test that only passes after applying the fixes in this commit. Includes a change to the assertion count in test syntax_highlighting::tests::benchmark_syntax_highlighting_parser as suggested by Lukas Wirth during review. Includes a change to the sanity-check code as suggested by Florian Diebold during review.
2024-07-27Auto merge of #17714 - Throne3d:patch-1, r=Veykrilbors-1/+1
docs: Reference cov_mark crate instead of test_utils/mark Seems this was switched over in https://github.com/rust-lang/rust-analyzer/issues/7922 I'm guessing this should skip the changelog because it's so minor, right? Reading through https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/style.md and trying to get up to speed here =)
2024-07-27fix: let glob imports override other globs' visibilityRyo Yoshida-32/+197
2024-07-26docs: Reference cov_mark crate instead of test_utils/markEdward Jones-1/+1
Seems this was switched over in https://github.com/rust-lang/rust-analyzer/issues/7922
2024-07-26early exit if unresolved field is an indexAli Bektas-3/+45
2024-07-26fix: tweak hover/tooltip linksYoung-Flash-6/+11
2024-07-26Internal: Cleanup proc-macro error handlingLukas Wirth-522/+380
2024-07-26fix: Fix includes not working with expr fragment inputsLukas Wirth-3/+18
2024-07-26Globals too are asking for sourcerootidAli Bektas-86/+93
2024-07-26Turn root_ratoml into workspace_ratomlsAli Bektas-74/+83
2024-07-25Remove unused trace moduleLukas Wirth-127/+46
2024-07-25Auto merge of #17676 - winstxnhdw:precise-capturing, r=Veykrilbors-89/+237
feat: add preliminary support for `+ use<..>` `precise_capturing` syntax ## Summary This PR adds basic support for the following syntax. ```rs fn captures<'a: 'a, 'b: 'b, T>() -> impl Sized + use<'b, T> {} // ~~~~~~~~~~~~~~~~~~~~~~~ // This opaque type does not capture `'a`. fn outlives<'o, T: 'o>(_: T) {} fn caller<'o, 'a, 'b: 'o, T: 'o>() { // ~~ // ^ Note that we don't need `'a: 'o`. outlives::<'o>(captures::<'a, 'b, T>()); } ``` Related to #17598
2024-07-25fix: handle new `TypeBoundKind` variantWinston H.-0/+1
2024-07-25Auto merge of #17697 - Veykril:cargo-env, r=Veykrilbors-2/+14
fix: Support new cargo config get env format Fixes https://github.com/rust-lang/rust-analyzer/issues/17686
2024-07-25fix: Support new cargo config get env formatLukas Wirth-2/+14
2024-07-25Make legacy_const_generics_indices thin by double boxing as its seldom usedLukas Wirth-8/+9
2024-07-25Reduce size of TypeRef by 8 bytesLukas Wirth-9/+9
2024-07-25Fix incorrect handling of cfg'd varargsLukas Wirth-16/+37
2024-07-25Remove Params and Fields from AstIdMapLukas Wirth-449/+494
2024-07-25Generate From impls for Any* nodesLukas Wirth-19/+634
2024-07-25fix: temporarily use `ast::GenericParamList`winstxnhdw-0/+4
2024-07-25Fix and enable unsafe_op_in_unsafe_fnLaurențiu Nicola-30/+29
2024-07-24Auto merge of #17674 - ↵bors-0/+7
davidbarsky:david/add-more-information-to-status-command, r=Veykril internal: add more output to the status command Bit of a lazy change, but this is was pretty handy. I think I should clean up the configuration into something a bit more legible (maybe serialize as JSON?), but I think this is a good enough starting point that we might as well start asking people for it in issue reports.
2024-07-24Auto merge of #17610 - regexident:impl-all_in_module, r=Veykrilbors-0/+4
Add method `Impl::all_in_module(…)` for allowing more localized querying This PR is motivated by an [outside use](https://github.com/regexident/cargo-modules) of the `ra_ap_hir` crate that would benefit from being able to more efficiently query for all impls of a given module (instead of having to query for its parent crate's impls and then filtering on `impl_hir.module(db) == module_hir`). I have the suspicion that the code as is won't quite work for file-level modules, since those don't have a block, afaict, but with all the crate-rename and version shenanigans around the `ra_ap_` release process I haven't yet been able to figure out how to patch a `ra_ap_` dependency from a third-party crate (let alone how to test this from inside of `rust-analyzer`), so haven't been able to actually run and test this. 😔 Any hints on how to make this (i.e. the code itself, as well as the testing) work are more than welcome!
2024-07-24Auto merge of #17661 - alibektas:read_ratoml_on_startup, r=Veykrilbors-8/+42
minor: Read workspace root ratomls on startup
2024-07-24fix: `use` cannot have optional genericsWinston H.-1/+1
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2024-07-23fix: move `use` parsing to outer match armwinstxnhdw-18/+19
2024-07-23chore: update codegenswinstxnhdw-89/+220
2024-07-23feat: add arm for `use` type boundwinstxnhdw-0/+6
2024-07-23feat: add `use` type bound grammarwinstxnhdw-0/+5
2024-07-23Auto merge of #17395 - ↵bors-366/+14
davidbarsky:david/remove-unindexed-project-notification, r=Veykril chore: remove `UnindexinedProject` notification This PR is split out from https://github.com/rust-lang/rust-analyzer/pull/17246/ (and contains its changes, which is a little annoying from a review perspective...). I'd like to land this change a week or so after #17246 lands in order to give any users of the unindexed project notification time to adopt migrate.
2024-07-23internal: remove UnindexedProject notificationDavid Barsky-366/+14
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
2024-07-23Auto merge of #17483 - alibektas:ratoml/fixes, r=alibektasbors-115/+92
minor : fixes for ratoml module This is a follow-up PR to #17058. - Parse errors are reflected as such by defining a new variant called `ConfigError::ParseError` - New error collection has been added to store config level agnostic errors. EDIT : Some things that this PR promised to solve are removed and will be addressed by other PRs
2024-07-23rename config::ConfigChange::other_errors to validation_errorsAli Bektas-6/+5
2024-07-23minor changesAli Bektas-6/+8
2024-07-23Add method `Impl::all_in_module(…)` for supporting more localized queryingVincent Esche-0/+4
2024-07-23Remove lens.forceCustomCommands configPaulDotSH-23/+2
2024-07-22internal: add more output to the status commandDavid Barsky-0/+7
2024-07-22internal: Shrink size of `Binding`Lukas Wirth-56/+94
2024-07-22Auto merge of #17670 - Veykril:mem, r=Veykrilbors-26/+19
LRU `body_with_source_map` query This query is being invalidated all the time anyways (we have an extra query on top of it for the body incrementality that is not source dependent), so there is little reason to keep these around all the time when only some IDE features are interested in them.
2024-07-22LRU `body_with_source_map` queryLukas Wirth-26/+19