aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into add-disable-diagnosticsIgor Aleksanov2020-08-122-5/+39
|\
| * Merge #5553bors[bot]2020-08-121-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5553: Add fix ranges for diagnostics r=matklad a=SomeoneToIgnore A follow-up of https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Less.20red.20in.20the.20code Now diagnostics can apply fixes in a range that's different from the range used to highlight the diagnostics. Previous logic did not consider the fix range, having both ranges equal, which could cause a lot of red noise in the editor. Now, the fix range gets used with the fix, the diagnostics range is used for everything else which allows to improve the error highlighting. before: <img width="191" alt="image" src="https://user-images.githubusercontent.com/2690773/88590727-df9a6a00-d063-11ea-97ed-9809c1c5e6e6.png"> after: <img width="222" alt="image" src="https://user-images.githubusercontent.com/2690773/88590734-e1fcc400-d063-11ea-9b7c-25701cbd5352.png"> `MissingFields` and `MissingPatFields` diagnostics now have the fix range as `ast::RecordFieldList` of the expression with an error (as it was before this PR), and the diagnostics range as a `ast::Path` of the expression, if it's present (do you have any example of `ast::Expr::RecordLit` that has no path btw?). The rest of the diagnostics have both ranges equal, same as it was before this PR. Co-authored-by: Kirill Bulatov <[email protected]>
| | * Better naming and docsKirill Bulatov2020-08-111-1/+1
| | |
| | * Move the DiagnosticsWithFix trait on the ide levelKirill Bulatov2020-08-111-9/+1
| | |
| | * Make the fix AST source OptionalKirill Bulatov2020-08-111-5/+5
| | |
| | * Refactor the diagnosticsKirill Bulatov2020-08-111-2/+10
| | |
| | * Require source implementations for DiagnosticKirill Bulatov2020-08-111-1/+1
| | |
| | * Better namingKirill Bulatov2020-08-111-1/+1
| | |
| * | Move unsafe packed ref logic to Semantics, use `Attrs::by_key` to simplify ↵Paul Daniel Faria2020-08-101-22/+3
| | | | | | | | | | | | repr attr lookup
| * | Revert function structs back to using bool to track self param, use first ↵Paul Daniel Faria2020-08-103-16/+7
| | | | | | | | | | | | param for self information in syntax highlighting instead
| * | Unsafe borrow of packed fields: account for borrow through ref binding, auto ↵Paul Daniel Faria2020-08-103-7/+16
| | | | | | | | | | | | ref function calls
| * | Cleanup repr check, fix packed repr check and testPaul Daniel Faria2020-08-101-3/+8
| | |
| * | Add tracking of packed repr, use it to highlight unsafe refsPaul Daniel Faria2020-08-101-4/+52
| |/ | | | | | | | | | | Taking a reference to a misaligned field on a packed struct is an unsafe operation. Highlight that behavior. Currently, the misaligned part isn't tracked, so this highlight is a bit too aggressive.
* | Replace String with &'static strIgor Aleksanov2020-08-121-2/+2
| |
* | Add names for diagnostics and add a possibility to disable themIgor Aleksanov2020-08-071-0/+3
|/
* Update grammarAleksey Kladov2020-08-011-3/+3
|
* Finish renameAleksey Kladov2020-07-311-3/+3
|
* Unify naming of tuple fieldsAleksey Kladov2020-07-311-3/+3
|
* Rename DotDotPat -> RestPatAleksey Kladov2020-07-311-3/+3
|
* RenameAleksey Kladov2020-07-311-2/+2
|
* Rename BindPat -> IdentPatAleksey Kladov2020-07-311-1/+1
|
* Rename PalceholderPat -> WildcardPatAleksey Kladov2020-07-311-1/+1
|
* ReorderAleksey Kladov2020-07-311-1/+0
|
* Allign RecordPat with RecordExprAleksey Kladov2020-07-311-21/+18
|
* Fix GenericArgs grammarAleksey Kladov2020-07-311-19/+23
|
* Rename TypeArgList -> GenericArgListAleksey Kladov2020-07-313-4/+4
|
* MinorAleksey Kladov2020-07-311-3/+0
|
* Rename LambdaExpr -> ClosureExprAleksey Kladov2020-07-311-1/+1
|
* Work on expressions grammarAleksey Kladov2020-07-311-5/+17
|
* Item is a StmtAleksey Kladov2020-07-311-10/+20
|
* Finalize TypeBound grammarAleksey Kladov2020-07-311-1/+1
|
* "Finalize" Types grammarAleksey Kladov2020-07-311-1/+0
| | | | | | | Note that `for` type is rust-analyzer's own invention. Both the reference and syn allow `for` only for fnptr types, and we allow them everywhere. This needs to be checked with respect to type bounds grammar...
* Reame PlaceholderType -> InferTypeAleksey Kladov2020-07-311-1/+1
|
* Rename TypeRef -> TypeAleksey Kladov2020-07-314-20/+20
| | | | | | | | | | The TypeRef name comes from IntelliJ days, where you often have both type *syntax* as well as *semantical* representation of types in scope. And naming both Type is confusing. In rust-analyzer however, we use ast types as `ast::Type`, and have many more semantic counterparts to ast types, so avoiding name clash here is just confusing.
* Use ty to access most TypeRefsAleksey Kladov2020-07-305-17/+15
|
* Remove TypeAscriptionOwnerAleksey Kladov2020-07-306-20/+15
|
* Finalize attribute grammarAleksey Kladov2020-07-301-11/+8
|
* Finaize item grammarAleksey Kladov2020-07-301-0/+1
|
* Finalize impl GrammarAleksey Kladov2020-07-305-10/+10
|
* Finalize Trait grammarAleksey Kladov2020-07-306-12/+12
|
* Finalize const&static grammarAleksey Kladov2020-07-305-17/+17
|
* Rename EnumVariant -> VariantAleksey Kladov2020-07-304-6/+6
|
* Rename EnumDef -> EnumAleksey Kladov2020-07-306-9/+9
|
* Rename StructDef -> StructAleksey Kladov2020-07-305-10/+10
|
* Finalize union grammarAleksey Kladov2020-07-305-8/+8
|
* Rename FieldDef -> FieldAleksey Kladov2020-07-303-19/+20
|
* Rename RecordLit -> RecordExprAleksey Kladov2020-07-302-4/+4
|
* Rename TypeParamList -> GenericParamListAleksey Kladov2020-07-302-7/+7
|
* Rename TypeAliasDef -> TypeAliasAleksey Kladov2020-07-305-9/+9
|
* Rename FnDef -> FnAleksey Kladov2020-07-305-21/+21
|