Commit Graph

2111 Commits

Author SHA1 Message Date
Kirill Bulatov
ad5e2cfa3b Do not return code lens data after resolving 2024-01-27 02:03:15 +02:00
Johann Hemmann
9e837790d1 redundant_locals 2024-01-19 18:36:32 +01:00
Johann Hemmann
b1a0c9ac40 single_match 2024-01-19 18:31:15 +01:00
Johann Hemmann
71d4dba960 redundant_pattern_matching 2024-01-19 17:31:01 +01:00
Johann Hemmann
bef355168a non_minimal_cfg 2024-01-19 17:31:01 +01:00
Johann Hemmann
2ae2512378 if_same_then_else 2024-01-19 17:31:01 +01:00
Johann Hemmann
84494d1c8e from_str_radix_10 2024-01-19 17:31:01 +01:00
Johann Hemmann
b5eca5f2fc collapsible_if 2024-01-19 17:31:00 +01:00
Johann Hemmann
3041164301 Temporarily allow all lints which occur
They will be removed one by one
2024-01-19 12:52:12 +01:00
bors
85c9a83262 Auto merge of #16398 - Urhengulas:satisfy-clippy, r=Veykril
`cargo clippy --fix`

This PR is the result of running `cargo clippy --fix && cargo fmt` in the root of the repository. I did not manually review all the changes, but just skimmed through a few of them. The tests still pass, so it seems fine.
2024-01-19 09:43:35 +00:00
bors
3f4c6dac3d Auto merge of #16372 - davidsemakula:import-granularity-one, r=Veykril
feat: Add "One" import granularity

Adds a new import granularity option "One" that merges all imports into a single use statement as long as they have the same visibility and attributes.

This is similar to [rustfmt's `imports_granularity = "One"`](https://rust-lang.github.io/rustfmt/?version=v1.6.0&search=import#imports_granularity).

Fixes: #11361
2024-01-18 15:40:12 +00:00
bors
a5b89fffb6 Auto merge of #16391 - alibektas:15656/renaming_allowed_by_config, r=Veykril
Add a new config to allow renaming of non-local defs

With #15656 we started disallowing renaming of non-local items. Although this makes sense there are some false positives that impacted users' workflows. So this config aims to mitigate this by giving users the liberty to disable this feature.

The reason why this is a draft is that I saw one of the tests fail and I am not sure if the "got" result even syntactically makes sense

Test case is :

```rust
check(
            "Baz",
            r#"
//- /lib.rs crate:lib new_source_root:library
pub struct S;
//- /main.rs crate:main deps:lib new_source_root:local
use lib::S$0;
"#,
            "use lib::Baz;"
);
```

```
Left:
use lib::Baz;

Right:
use lib::Baz;Baz

Diff:
use lib::Baz;Baz
```
2024-01-18 13:49:14 +00:00
Johann Hemmann
fad4fa163c cargo clippy --fix 2024-01-18 13:59:49 +01:00
Ali Bektas
21020919e3 v2 2024-01-18 12:09:23 +01:00
roife
04ce4ce440 internal: speedup LineEndings calculation using 'memchr' 2024-01-18 17:03:29 +08:00
Ali Bektas
9bd9a17ce5 Add a new config to allow renaming of non-local items
With #15656 we started disallowing renaming of non-local items.
Although this makes sense there are some false positives that
impacted users' workflows. So this config aims to mitigate this
by giving users the liberty to disable this feature.
2024-01-18 00:26:22 +01:00
davidsemakula
4f176b3f7f update import granularity config and docs 2024-01-18 01:44:57 +03:00
Lukas Wirth
0bdbf497b6 fix: Fix progress reporting getting stuck 2024-01-17 13:23:00 +01:00
Lukas Wirth
21723cb051 Run metadata on sysroot for CI metrics 2024-01-17 09:43:04 +01:00
bors
2d5ce888de Auto merge of #16366 - Veykril:transp-queries, r=Veykril
internal: Make data queries transparent over their diagnostics variant

And a few other QoL things
2024-01-16 10:09:05 +00:00
Lukas Wirth
f675b5ead8 Don't early exit on panics in rustc_tests command 2024-01-16 11:05:50 +01:00
bors
c9afd41219 Auto merge of #15636 - 9999years:show-which-roots-are-scanned, r=Veykril
Show which roots are being scanned in progress messages

This changes the `Roots Scanned` message to include the directory being scanned.

Before: `Roots Scanned 206/210 (98%)`
After: `Roots Scanned 206/210: .direnv (98%)`

This makes it a lot easier to tell that `rust-analyzer` isn't crashed, it's just trying to scan a huge directory.

See: #12613
2024-01-16 09:44:56 +00:00
Lukas Wirth
398150827f Rename Message::Progress::file field to dir 2024-01-16 10:43:33 +01:00
bors
87e609aa9c Auto merge of #15868 - wasd96040501:fix/symlink2, r=Veykril
fix: failed to infer OUT_DIR when workspace root contains symlink

fix #15867
2024-01-16 09:23:54 +00:00
Lukas Wirth
c7eb52dd7b internal: Add unstable config for loading the sysroot sources via cargo metadata 2024-01-15 09:59:32 +01:00
YangzeLuo
22cda959b3 fix: failed to infer OUT_DIR when workspace root contains symlink 2024-01-12 13:35:53 +08:00
Rebecca Turner
1ceb2ea414
Show which roots are being scanned in progress messages
See: #12613
2024-01-09 09:16:26 -08:00
Lukas Wirth
e1c67485bf fix: Differentiate between vfs config load and file changed events 2024-01-09 10:30:16 +01:00
Laurențiu Nicola
f52f2f9c3c Merge branch 'master' into sync-from-rust 2024-01-09 08:46:16 +02:00
Lukas Wirth
1c40ac79c8 VFS no longer stores all source files in memory 2024-01-08 12:51:16 +01:00
Laurențiu Nicola
3afeb24198 Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
riverbl
3c378b9c70 Add inlay hint for exclusive ranges
Adds an inlay hint containing a '<' character to exclusive range expressions and patterns that specify an upper bound.
2024-01-07 09:33:56 +00:00
Lukas Wirth
2666349392 Remove limit from symbol_index::Query 2024-01-04 19:20:10 +01:00
Lukas Wirth
d480525ce8 Add extern crate rustc_driver to proc-macro-srv-cli 2024-01-04 11:02:23 +01:00
Nicolas Guichard
73d9c77f2a scip: Populate SymbolInformation::kind
SymbolInformation::kind is finer-grained than the SCIP symbol suffix.
This also fixes a bug where all type aliases where treated like type
parameters.

```
trait SomeTrait {
  type AssociatedType; // ← this is SomeTrait#[AssociatedType]
}

type MyTypeAlias = u8; // ← this used to be [MyTypeAlias]
                       //   and now is MyTypeAlias#
```
2024-01-03 13:05:36 +01:00
Nicolas Guichard
566bb77f91 scip: Populate SymbolInformation::signature_documentation 2024-01-03 10:56:12 +01:00
Nicolas Guichard
495a55689b scip: Populate SymbolInformation::enclosing_symbol
For local variables, this gets the moniker from the enclosing
definition and stores it into the TokenStaticData.
Then it builds the scip symbol for that moniker when building the
SymbolInformation.
2024-01-03 10:54:57 +01:00
Nicolas Guichard
62663e6d4b scip: Refactor token_to_symbol to moniker_to_symbol
This is meant to implement SymbolInformation::enclosing_symbol, so we
can build the enclosing symbol from the enclosing moniker without
having the full enclosing token's TokenStaticData.
2024-01-03 10:54:57 +01:00
Nicolas Guichard
375f1cca4f scip: Populate SymbolInformation::display_name 2024-01-03 10:54:57 +01:00
Laurențiu Nicola
932d85b529 Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2 2024-01-03 11:35:07 +02:00
bors
1a0b772a43 Auto merge of #16153 - Veykril:err-msg, r=Veykril
fix: Notify user that linkedProjects is set when failing to discover projects

Fixes https://github.com/rust-lang/rust-analyzer/issues/15171
2024-01-02 14:42:03 +00:00
Lukas Wirth
8136e739f5 fix: Notify user that linkedProjects is set when failing to discover projects 2024-01-02 15:24:21 +01:00
bors
9f46ff501d Auto merge of #16062 - davidbarsky:david/fix-references-to-removed-settings, r=Veykril
fix: Correct references from `rust-analyzer.cargo.check` to `rust-analyzer.check`

When reading the manual, I noticed that the documentation referenced configurations that have since been renamed. This PR updates those references to their new names.
2024-01-02 09:57:48 +00:00
bors
f1de7d7273 Auto merge of #16011 - ClSlaid:feat/settings/proc-macro/rebuild-on-save, r=Veykril
feat: add proc-macro rebuild on save option

Related: #15033

I need some advice on how to test it.
2024-01-02 09:46:21 +00:00
Lukas Wirth
c99089c2b3
Update crates/rust-analyzer/src/handlers/notification.rs 2024-01-02 10:27:41 +01:00
Lukas Wirth
3c8dd9e89e Expose whether a channel has been dropped in lsp-server errors 2024-01-01 14:10:46 +01:00
Martin Huschenbett
b9933fdaaa minor: Simplify implementation of apply_document_changes
While reading through the code base, I stumbled across a piece of code that I found hard to read despite its simple purpose. This is my attempt at making the code easier to understand for future readers.

I won't be offended if this is too minor and not worth your time.
2023-12-30 19:21:35 +01:00
Lukas Wirth
2a5b60b186 internal: Update world symbols request definiton, prefer focus range for macros 2023-12-22 11:42:08 +01:00
Lukas Wirth
7b804552a5 Remove Delimiter::DUMMY_INVISIBLE 2023-12-20 14:00:14 +01:00
Lukas Wirth
f49a2fed3f internal: Move out WithFixture into dev-dep only crate 2023-12-18 15:24:08 +01:00