aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge #5553bors[bot]2020-08-122-15/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+4
| |
| * Improve the ide diagnostics trait APIKirill Bulatov2020-08-111-4/+1
| |
| * Move the DiagnosticsWithFix trait on the ide levelKirill Bulatov2020-08-112-12/+4
| |
| * Make the fix AST source OptionalKirill Bulatov2020-08-112-5/+5
| |
| * Refactor the diagnosticsKirill Bulatov2020-08-111-18/+10
| |
| * Better namingKirill Bulatov2020-08-111-0/+11
| |
* | Merge #4743bors[bot]2020-08-123-2/+117
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4743: Add tracking of packed repr, use it to highlight unsafe refs r=matklad a=Nashenas88 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. Fixes #4600 Co-authored-by: Paul Daniel Faria <[email protected]> Co-authored-by: Paul Daniel Faria <[email protected]> Co-authored-by: Paul Daniel Faria <[email protected]>
| * | Fix type names broken by rebase, redo expected test because of rebasePaul Daniel Faria2020-08-101-9/+13
| | |
| * | Move unsafe semantics methods into `SemanticsImpl` and reference them in ↵Paul Daniel Faria2020-08-101-71/+83
| | | | | | | | | | | | `Semantics`
| * | Return bool from is_unsafe_method_call and cleanup usagesPaul Daniel Faria2020-08-101-19/+19
| | |
| * | Move semantic logic into Semantics, fix missing tag for safe amp operator, ↵Paul Daniel Faria2020-08-101-35/+75
| | | | | | | | | | | | using functional methods rather than clunky inline closure
| * | Move unsafe packed ref logic to Semantics, use `Attrs::by_key` to simplify ↵Paul Daniel Faria2020-08-101-0/+41
| | | | | | | | | | | | repr attr lookup
| * | Revert function structs back to using bool to track self param, use first ↵Paul Daniel Faria2020-08-102-4/+3
| | | | | | | | | | | | param for self information in syntax highlighting instead
| * | Unsafe borrow of packed fields: account for borrow through ref binding, auto ↵Paul Daniel Faria2020-08-101-2/+3
| | | | | | | | | | | | ref function calls
| * | Remove token tree from ReprKind::Other variant, expose ReprKind higher, ↵Paul Daniel Faria2020-08-101-3/+3
| | | | | | | | | | | | remove debug println.
| * | Add tracking of packed repr, use it to highlight unsafe refsPaul Daniel Faria2020-08-101-0/+18
| |/ | | | | | | | | | | 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.
* / MinorAleksey Kladov2020-08-121-4/+3
|/
* Remove Option<...> from result of Crate::root_modulePaul Daniel Faria2020-08-091-2/+2
| | | | | There doesn't seem to be any need for it, and removing it simplies several paths of code that depend on it.
* Add support for extern cratePaul Daniel Faria2020-08-081-3/+22
| | | | | This adds syntax highlighting, hover and goto def functionality for extern crate
* Use salsa's purge to account for all memoryAleksey Kladov2020-08-051-8/+1
|
* Rename BindPat -> IdentPatAleksey Kladov2020-07-314-6/+6
|
* Allign RecordPat with RecordExprAleksey Kladov2020-07-312-3/+3
|
* simplifyAleksey Kladov2020-07-301-6/+4
|
* Finalize impl GrammarAleksey Kladov2020-07-303-6/+6
|
* Finalize Trait grammarAleksey Kladov2020-07-303-7/+7
|
* Finalize const&static grammarAleksey Kladov2020-07-303-12/+12
|
* Rename EnumVariant -> VariantAleksey Kladov2020-07-303-5/+5
|
* Rename EnumDef -> EnumAleksey Kladov2020-07-303-6/+6
|
* Rename StructDef -> StructAleksey Kladov2020-07-303-6/+6
|
* Finalize union grammarAleksey Kladov2020-07-303-5/+5
|
* Rename FieldDef -> FieldAleksey Kladov2020-07-303-12/+6
|
* Rename RecordLit -> RecordExprAleksey Kladov2020-07-302-10/+13
|
* Rename TypeAliasDef -> TypeAliasAleksey Kladov2020-07-303-9/+6
|
* Rename FnDef -> FnAleksey Kladov2020-07-303-7/+7
|
* Add a builder for DiagnosticSinkJonas Schievink2020-07-241-1/+3
|
* Cache macro expansion in semanticsAleksey Kladov2020-07-241-2/+14
| | | | | #5497 accidentally made syntax highlighting quadratic, due to repeated tokentreeizing of macros.
* Add missing cancellation pointAleksey Kladov2020-07-241-0/+1
|
* Add profiling callAleksey Kladov2020-07-241-0/+1
|
* Store macro invocation parameters as text instead of ttLaurențiu Nicola2020-07-221-1/+1
|
* call_info works with closuresAleksey Kladov2020-07-171-14/+19
|
* Remove FunctionSignatureAleksey Kladov2020-07-161-1/+1
|
* Inlay hints use callablesAleksey Kladov2020-07-161-0/+3
|
* Redner self as param for call infor for assoc fn callAleksey Kladov2020-07-161-2/+12
|
* Semantical call infoAleksey Kladov2020-07-164-21/+99
|
* Align CallableDefId naming with other idsAleksey Kladov2020-07-162-3/+3
|
* Remove TypeCtor interningFlorian Diebold2020-07-151-3/+3
| | | | Our TypeCtor and Chalk's TypeName match now!
* Use Chalk closure supportFlorian Diebold2020-07-151-3/+3
|
* Cap macro expansion depth for IDE featuresAleksey Kladov2020-07-151-1/+1
| | | | closes #4453
* Cleanup visibilityAleksey Kladov2020-07-141-1/+1
|