aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics
Commit message (Collapse)AuthorAgeFilesLines
* Use chalk_ir::AdtIdLukas Wirth2021-03-042-9/+11
|
* Introduce Ty::AliasLukas Wirth2021-03-011-1/+1
|
* Inline TypeCtor into TyLukas Wirth2021-02-283-16/+9
|
* Update fixed testsJonas Schievink2021-02-101-15/+14
|
*-. Merge #7570 #7571bors[bot]2021-02-051-160/+119
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7570: Add doc gen to the `generate_enum_match_method` assist r=yoshuawuyts a=yoshuawuyts Implements a small extension to https://github.com/rust-analyzer/rust-analyzer/pull/7562, generating default comments. I wasn't sure if this would fit the goals of Rust-Analyzer, so I chose to split it into a separate PR. This is especially useful when writing code in a codebase which uses `#![warn(missing_docs)]` lint, as many production-grade libraries do. The comments we're generating here are similar to the ones found on [`Option::is_some`](https://doc.rust-lang.org/std/option/enum.Option.html#method.is_some) and [`Result::is_err`](https://doc.rust-lang.org/std/result/enum.Result.html#method.is_err). I briefly considered only generating these for `pub` types, but they seem small and unobtrusive enough that they're probably useful in the general case. Thanks! ## Example __input__ ```rust pub(crate) enum Variant { Undefined, Minor, // cursor here Major, } ``` __output__ ```rust pub(crate) enum Variant { Undefined, Minor, Major, } impl Variant { /// Returns `true` if the variant is [`Minor`]. pub(crate) fn is_minor(&self) -> bool { matches!(self, Self::Minor) } } ``` ## Future Directions This opens up the path to adding an assist for generating these comments on existing `is_` methods. This would make it both easy to document new code, and update existing code with documentation. 7571: Cleanup decl_check r=Veykril a=Veykril bors r+ Co-authored-by: Yoshua Wuyts <[email protected]> Co-authored-by: Lukas Wirth <[email protected]>
| | * Cleanup decl_checkLukas Wirth2021-02-051-160/+119
| |/
* / Remove unnecessary allocs in case_convLukas Wirth2021-02-051-18/+16
|/
* Classify function calls as functions when shadowed by typesLukas Wirth2021-01-281-9/+3
|
* Update tests to register the required standard library typesPhil Ellison2021-01-231-6/+10
|
* Identify methods using functions ids rather than string namesPhil Ellison2021-01-231-7/+27
|
* Implement fix, add testsPhil Ellison2021-01-231-20/+7
|
* Add diagnostic for filter_map followed by nextPhil Ellison2021-01-231-9/+61
|
* prepare to publish el libro de arenaAleksey Kladov2021-01-141-1/+1
|
* Fixed typos in local bindingsVincent Esche2021-01-091-2/+2
|
* Fixed typos in code commentsVincent Esche2021-01-091-2/+2
|
* cargo fmtPhil Ellison2021-01-071-6/+9
|
* Add fix to wrap return expression in SomePhil Ellison2021-01-071-6/+16
|
* Don't emit arg count diagnostics for method calls with unknown receiverFlorian Diebold2021-01-011-1/+25
| | | | Fixes #7098.
* decl_check: don't pass `db` around so oftenJonas Schievink2020-12-171-54/+49
|
* Merge #6769bors[bot]2020-12-101-3/+36
|\ | | | | | | | | | | | | | | | | | | 6769: Add native "remove this semicolon" diagnostics r=matklad a=ivan770 Closes #6739 ![demo2](https://user-images.githubusercontent.com/14003886/101530533-b76c3180-399a-11eb-9d18-5c8457721655.gif) Co-authored-by: ivan770 <[email protected]>
| * Cast to ExprStmt, style fixesivan7702020-12-101-6/+5
| |
| * Apply rustfmt changesivan7702020-12-091-9/+8
| |
| * Apply suggestions from code reviewivan7702020-12-091-17/+20
| | | | | | Co-authored-by: bjorn3 <[email protected]>
| * Format codeivan7702020-12-081-4/+13
| |
| * Remove use via superivan7702020-12-081-3/+1
| |
| * Remove this semicolonivan7702020-12-081-1/+26
| |
* | Use mark/hitJonas Schievink2020-12-101-0/+7
| |
* | Ignore extern items in incorrect-case checkJonas Schievink2020-12-101-0/+19
|/
* Check structs for match exhaustivenessLukas Wirth2020-11-241-31/+120
|
* Add middle ellipsis missing arm textLukas Wirth2020-11-241-0/+14
|
* Handle ellipsis in tuple patterns in match exhaustiveness checkingLukas Wirth2020-11-241-42/+41
|
* Improve decl_check module readabilityIgor Aleksanov2020-11-031-6/+6
|
* Remove numbers from comments in decl_check.rsIgor Aleksanov2020-11-031-15/+15
|
* Check for allow(..) attributes for case diagnosticIgor Aleksanov2020-11-031-25/+91
|
* Deny unreachable-pubAleksey Kladov2020-11-023-18/+11
| | | | | | | | It's very useful when `pub` is equivalent to "this is crate's public API", let's enforce this! Ideally, we should enforce it for local `cargo test`, and only during CI, but that needs https://github.com/rust-lang/cargo/issues/5034.
* Make IncorrectDiagnostic match rustc by copying rustc's code.Arif Roktim2020-10-251-126/+123
|
* Merge #6319bors[bot]2020-10-222-3/+34
|\ | | | | | | | | | | | | | | 6319: Properly identify camel cased acronyms as UpperCamelCase r=popzxc a=ArifRoktim This closes #6305. Co-authored-by: Arif Roktim <[email protected]>
| * Properly identify camel cased acronyms as UpperCamelCaseArif Roktim2020-10-212-3/+34
| |
* | Move safe intrinsic testsFrancesco Zardi2020-10-211-0/+18
|/
* Keep SyntaxNodePtr::range privateIgor Aleksanov2020-10-121-2/+11
|
* Replace 'if let' with 'match' in decl_check.rsIgor Aleksanov2020-10-121-30/+33
|
* Add to_upper_snake_case function to stdxIgor Aleksanov2020-10-122-4/+3
|
* Fix compilation errorIgor Aleksanov2020-10-121-2/+1
|
* Apply suggestions from code reviewIgor Aleksanov2020-10-121-2/+2
| | | Co-authored-by: Lukas Wirth <[email protected]>
* Fix code style issuesIgor Aleksanov2020-10-121-2/+6
|
* Fix issues with match arm bindingsIgor Aleksanov2020-10-121-7/+12
|
* Code style adjustmentsIgor Aleksanov2020-10-123-8/+88
|
* Make incorrect case diagnostic work inside of functionsIgor Aleksanov2020-10-121-32/+245
|
* Refactor string helpers for decl_check moduleIgor Aleksanov2020-10-121-32/+97
|
* Add diagnostics for enum names and variantsIgor Aleksanov2020-10-121-1/+146
|