about summary refs log tree commit diff
path: root/crates/rust-analyzer/src/diagnostics
AgeCommit message (Collapse)AuthorLines
2022-07-19Work around Code bug with empty diagnosticsLaurențiu Nicola-6/+1
2022-06-01fix(diagnostic): Don't remove diagnostic with empty messageMaan2003-4/+5
Use " " as message if it is empty
2022-05-18fix: calculate right range for Dos line ending in mapping rustc range to lsp ↵harpsword-22/+5
range
2022-05-14fix diagnostics location map incorrectly from rustc span to lsp position for ↵harpsword-26/+337
non-BMP char
2022-04-25Don't emit a quickfix for placeholder suggestionsJonas Schievink-67/+13
2022-04-19Allows triggering commands after an assist editJonas Schievink-0/+6
2022-03-31Add test against line number underflowFelix Maurer-0/+107
2022-03-31Prevent underflow when converting line numbersFelix Maurer-2/+8
Previously, when line numbers of Rust spans were converted to LSP ranges, they could underflow resulting in very large line numbers. As an underflow is always wrong, prevent it and use 0 instead.
2022-03-12fix clippy::needless_borrowMatthias Krüger-2/+2
2021-12-05Merge #10902bors[bot]-274/+360
10902: Handle multiple cargo check quick fix spans r=Veykril a=brandondong Resolves https://github.com/rust-analyzer/rust-analyzer/issues/10705. **Cause:** - For a cargo check diagnostic with multiple spans, only a single quick fix action would be created at the location of `spans[0]`. Additionally, the hover window details would only show the location of `spans[0]` next to the message. **Fix:** - Allow cargo check quick fix actions to be triggerable from multiple selection ranges. Specifically, if the selection intersects with any of the replacement spans, the quick fix action is shown. - No change in behavior for the hover window details. It's pretty minor and I think showing multiple locations next to the message may be more confusing anyways. Co-authored-by: Brandon <brandondong604@hotmail.com>
2021-12-04Update expected test resultsBrandon-256/+336
2021-12-04Handle multiple cargo check quick fix spansBrandon-15/+21
2021-12-04Refactor away unnecessary VecBrandon-4/+4
2021-11-22Make lint groups work correctly with `warningsAsInfo` and `warningsAsHint`Emil Gardström-2/+12
2021-11-06Bump depsLaurențiu Nicola-69/+23
2021-10-18Fix testsLaurențiu Nicola-23/+69
2021-10-18Pull in new lsp-types for VS compatLaurențiu Nicola-11/+11
2021-08-06Bless testsJonas Schievink-15/+15
2021-08-06Don't include empty suggestionsJonas Schievink-1/+3
2021-08-06Include suggested replacement in diagnosticsJonas Schievink-3/+16
2021-07-17internal: a bit more of cwd safety for flycheckAleksey Kladov-11/+15
2021-06-17simplifyLukas Wirth-2/+2
2021-06-13clippy::redudant_borrowMaan2003-3/+3
2021-05-24Update test fixturesLaurențiu Nicola-0/+56
2021-04-21Code review feedback.James Leitch-4/+6
2021-04-21Diagnostic Remap Path Prefixes added.James Leitch-35/+32
2021-04-21Diagnostic paths attempt to use VSCode's path join behavior before ↵James Leitch-3/+30
defaulting to Rust's path join behavior.
2021-04-18Prevent being able to rename items that are not part of the workspaceLukas Wirth-0/+6
2021-04-01Check for and skip dummy macro filesJonas Schievink-120/+16
2021-04-01Adjust message when pointing at location in macroJonas Schievink-2/+10
2021-03-31Search for a suitable primary locationJonas Schievink-9/+27
2021-03-31Rename `convert_location` -> `location`Jonas Schievink-11/+11
2021-03-30Improve rustc diagnostic mappingJonas Schievink-49/+272
2021-03-17don't clone types that are copy (clippy::clone_on_copy)Matthias Krüger-1/+1
2021-03-02Bump cargo_metadataLaurențiu Nicola-1/+1
2021-02-20Update testsJeremy Kolb-0/+104
2021-02-01Update Test DataChristopher Serr-1/+46
2021-02-01Don't filter code suggestions on ApplicabilityChristopher Serr-4/+2
I've noticed that there are various suggestions that rust-analyzer seems to filter out, even if they make sense. Here's an example of where it seems like there should be a suggestion, but there isn't: ![https://i.imgur.com/wsjM6iz.png](https://i.imgur.com/wsjM6iz.png) It turns out that this specific suggestion is not considered `MachineApplicable`, which are the only suggestions that rust-analyzer accepts. However if you read the documentation for `MachineApplicable`, https://github.com/rust-lang/rust/blob/b3897e3d1302391ed02efbac1dce8073646b8173/compiler/rustc_lint_defs/src/lib.rs#L27-L29 then you realize that these are specifically only those suggestions that rust-analyzer could even automatically apply (in some distant future, behind some setting or so). Other suggestions that may have some semantic impact do not use `MachineApplicable`. So all other suggestions are still intended to be suggested to the user, just not automatically applied without the user being consulted. https://github.com/rust-lang/rust/blob/b3897e3d1302391ed02efbac1dce8073646b8173/compiler/rustc_lint_defs/src/lib.rs#L22-L24 So with that in mind, rust-analyzer should almost definitely not filter out `MaybeIncorrect` (which honestly is named horribly, it just means that it's a semantic change, not just a syntactical one). Then there's `HasPlaceholders` which basically is just another semantic one, but with placeholders. The user will have to make some adjustments, but the suggestion still is perfectly valid. rust-analyzer could probably detect those placeholders and put proper "tab through" markers there for the IDE, but that's not necessary for now. Then the last one is `Unspecified` which is so unknown that I don't even know how to judge it, meaning that the suggestion should probably also just be suggested to the user and then they can decide. So with all that in mind, I'm proposing to get rid of the check for Applicability entirely.
2021-01-15Don't duplicate rustc diagnostics fixesJonas Schievink-282/+32
2020-12-21Filter out empty rustc spansJonas Schievink-0/+4
2020-12-06Apply suggestions from code reviewJonas Schievink-2/+2
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-12-06Update expect testsJonas Schievink-46/+977
2020-12-06Emit additional diagnostics for hints/help/etcJonas Schievink-73/+116
2020-11-18update diagnostics test_data with code_description changesLukas Wirth-6/+108
2020-11-18Link clippy lint codes in diagnosticsLukas Wirth-7/+22
2020-11-18Link rustc error codes in diagnosticsLukas Wirth-3/+19
2020-11-16Latest LSP 3.16 protocolkjeremy-2/+2
Pulls in https://github.com/gluon-lang/lsp-types/pull/186
2020-11-12Update testsAleksey Kladov-21/+168
2020-11-10Switch to upstream protocol for resolving code actionAleksey Kladov-5/+5
Note that we have to maintain custom implementation on the client side: I don't see how to marry bulitin resolve support with groups and snippets.
2020-10-26Update testsJeremy A. Kolb-0/+22