Commit Graph

448 Commits

Author SHA1 Message Date
Konstantin Shcheglov bdb52a8f33 Fix 'Organize Directives' handling end-of-line comments.
R=brianwilkerson@google.com

Change-Id: Iaec35a52c74229f00560ccfc7613c2f2e9cf4d41
Reviewed-on: https://dart-review.googlesource.com/c/93841
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-21 01:04:18 +00:00
Brian Wilkerson 47e988b781 Clean up the remaining copyright notices in analysis_server
Change-Id: Iee3110f92ab0f24312ddd1eff407d2229f895321
Reviewed-on: https://dart-review.googlesource.com/c/89101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-11 15:38:56 +00:00
Brian Wilkerson 51f34ea580 Split up the tests for fixes related to lints
Change-Id: Icb299b43a745f02ecbc11c0421866f112033ca6a
Reviewed-on: https://dart-review.googlesource.com/c/84054
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-12 17:29:56 +00:00
Konstantin Shcheglov 09435f21fc Update member sorter to support mixins and generic type aliases.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ia417b003321d4b92f92b125a4607634fa6d21206
Reviewed-on: https://dart-review.googlesource.com/c/83464
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-07 19:36:06 +00:00
Brian Wilkerson 25e0c7b3f9 Split apart the assist tests
Change-Id: I249064b4c9215bdb2ed8bc7a68d9cca4e47d6bcd
Reviewed-on: https://dart-review.googlesource.com/c/82791
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-11-03 19:10:40 +00:00
Konstantin Shcheglov 1fb58ad61b Fix CONVERT_DOCUMENTATION_INTO_LINE when there is an empty line.
R=brianwilkerson@google.com

Change-Id: Ib5c103426bf5ebb84945816c01e9f5bbcef941ba
Reviewed-on: https://dart-review.googlesource.com/c/82472
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-01 20:25:29 +00:00
Konstantin Shcheglov 0299b98197 Renames for addPackageFile() / addPackageMeta().
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I9d710d76186f5e54592457ac8708551ac096a43a
Reviewed-on: https://dart-review.googlesource.com/c/82465
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-01 17:24:26 +00:00
Konstantin Shcheglov 5711a1d539 Move implementations of analysis results into src/results.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I7527dfb597ff54802517093b4aa526b14e7b705c
Reviewed-on: https://dart-review.googlesource.com/c/82461
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-01 16:11:23 +00:00
Konstantin Shcheglov d6d312cca6 Add 'Wrap with StreamBuilder' quick assist.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I109bfe41344943b6d1b456cb178f1db4d5e92858
Reviewed-on: https://dart-review.googlesource.com/c/82341
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-01 15:33:04 +00:00
Konstantin Shcheglov c843a4fdbd Replace resourceProvider.convertPath() with just convertPath() where possible.
R=brianwilkerson@google.com

Change-Id: I80c349b0ed9092e455ca2d811f5828765361ffc7
Reviewed-on: https://dart-review.googlesource.com/c/82163
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-30 23:55:26 +00:00
Brian Wilkerson 298d22f4ab remove async parse method
Change-Id: I7a2e633b43283221790fb88a12065fed3dcdabb7
Reviewed-on: https://dart-review.googlesource.com/c/82120
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-30 19:26:00 +00:00
Konstantin Shcheglov ff25f47862 Remove processRequiredPlugins() and configurePreviewDart2().
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ic93ba6b148e7bb6e7fc001dc2aceb4feaf8fa29f
Reviewed-on: https://dart-review.googlesource.com/c/82081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-30 17:40:29 +00:00
Konstantin Shcheglov 1c6774ba34 Create AnalysisDriver in AbstractContextTest using the new API.
Change-Id: Ia3b8e0fa297026f8d002cf4b29f179e686876d8c
Reviewed-on: https://dart-review.googlesource.com/c/81980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-30 15:57:59 +00:00
Brian Wilkerson faa8bcd78c Finish spliting out the non-lint fix tests
Change-Id: I793a9663ad3a9adfec4248844a5881f857fb4c4c
Reviewed-on: https://dart-review.googlesource.com/c/81748
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-28 18:11:37 +00:00
Konstantin Shcheglov 5b1641432d Create CorrectionUtils only for ResolveResult.
So, it is always self-consistent, never ask AnalysisContext for the
unit file content.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I93e71f7f8fa577b8e123c91252f3038a50cdccef
Reviewed-on: https://dart-review.googlesource.com/c/81580
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-26 14:04:12 +00:00
Konstantin Shcheglov 20d81452e5 Remove AstProvider, use AnalysisSessionHelper.
This is a step toward making CorrectionUtils constructor accept full
ResolveResult, instead of partial (and potentially inconsistent) unit
and AnalysisContext.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ic386d48af2d00ecaf9ef13b8480e7e78c7d52efc
Reviewed-on: https://dart-review.googlesource.com/c/81382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-25 19:09:11 +00:00
Brian Wilkerson 721f70ce29 Convert fix tests to separate classes, part 3
Change-Id: I4b8ec67484aab323e8bd7d51d4fe58c346914c2b
Reviewed-on: https://dart-review.googlesource.com/c/81420
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-25 16:57:03 +00:00
Paul Berry 2e2c360371 Merge commit '0b15595913ff89d8486e6677af0254dd6feab350' into analyzer 2018-10-24 06:09:47 -07:00
Dan Rubel 4f2a4e69a8 new convert-to-int-literal assist
Change-Id: I25f08d82fd4afaba485059e558536b37855bb6c9
Reviewed-on: https://dart-review.googlesource.com/c/81301
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-23 20:29:27 +00:00
Brian Wilkerson fbe7d10a51 Move the fix tests into separate classes, part 2
Change-Id: Ic3a1d6d806a733dfc08d4f4e2c5554b1a4acd394
Reviewed-on: https://dart-review.googlesource.com/c/81300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-23 17:55:10 +00:00
Paul Berry 5665636983 Merge commit '7fd78ed5b606e64d30ec201de9adce6fdf8856ba' into analyzer 2018-10-22 13:07:24 -07:00
Brian Wilkerson 330abc9eb1 Split out first set of fix tests
Change-Id: Iddba4f4e9f86153277a17bb48bfbd9acf5a21d41
Reviewed-on: https://dart-review.googlesource.com/c/80986
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-22 02:31:03 +00:00
Konstantin Shcheglov 02651515eb Fix identifyWidgetExpression() for Flutter.
Probably a bit pessimistic approach, allow only cases that we know
to be valid and useful.

R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2714
Change-Id: I8835c03d919c1f00a986ff3ef677c7f69995682f
Reviewed-on: https://dart-review.googlesource.com/c/80985
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-21 21:12:13 +00:00
Brian Wilkerson 4e36069271 Add fixes for missing implementation of a superclass constraint
Change-Id: I5ea1e961dbb98c034131c15d1945f21bcfa0df1d
Reviewed-on: https://dart-review.googlesource.com/c/80980
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-21 15:03:16 +00:00
Brian Wilkerson 20c75ccfb1 Remove more dead code from server
Change-Id: I20689dc5fefd3a636f78b38929a886ea96d01e0f
Reviewed-on: https://dart-review.googlesource.com/c/80961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-20 00:30:51 +00:00
Brian Wilkerson b35e717fae Clean up the fix processor hierarchy
Change-Id: I2ca593397f061aa1cb0d91c98874451c8f53a206
Reviewed-on: https://dart-review.googlesource.com/c/80841
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-19 16:21:23 +00:00
Konstantin Shcheglov a2a3c36b77 Switch CREATE_MISSING_OVERRIDES to writeOverrideOfInheritedMember() and using FunctionType signatures.
This fixes the issue, and simplifies code generation.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34729
Change-Id: I65928b5e68e44e4db77eb9c371aa1e6d27d66635
Reviewed-on: https://dart-review.googlesource.com/c/79468
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-12 20:45:42 +00:00
Brian Wilkerson 0e001641a9 Re-write invalid ASTs and update fix to reflect new AST structure for invalid type arguments on named constructors
Change-Id: I66e5f6b6022356eb31a327d1c989950c360492f7
Reviewed-on: https://dart-review.googlesource.com/c/79463
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-12 16:38:51 +00:00
Dan Rubel e4c3fa0a9c Improve recovery when parsing named constructor invocation with invalid type arguments
The parser now generates a ConstructorWithTypeArguments error and a new
handleInvalidTypeArguments event after a begin/endTypeArguments event pair
when those type arguments are in a syntatically invalid location.

For example: `new C.n<int>();` in
```
class C<T> { T f; C.n() {} }
main() { var x = new C.n<int>(); }

Most listeners handle this event by dropping the invalid type arguments,
but AstBuilder now preserves those invalid type arguments in the AST
to support better code quick-fixes/quick-assists/refactoring.

Change-Id: I5b22bd4903cd9ee3645936b9a108598b603cf9ca
Reviewed-on: https://dart-review.googlesource.com/c/79300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-11 19:57:22 +00:00
Brian Wilkerson f11e746c2e Initial implementation of fixes for type arguments on named constructor invocations
Change-Id: I71fe90c53c5a15e7172bcc27abfbfffd8119d7ff
Reviewed-on: https://dart-review.googlesource.com/c/79061
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-10 17:11:36 +00:00
Dan Rubel b6a8e31492 Improve error message when var is used as a type name
... and Address comments in
https://dart-review.googlesource.com/c/sdk/+/78101

Change-Id: I8b3bc9888185d9802a389baa3f197f9b29927b7f
Reviewed-on: https://dart-review.googlesource.com/c/78103
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-05 11:56:26 +00:00
Brian Wilkerson bd7b776bb4 Fix more quick fix tests
Change-Id: I07c9900be8dc3510d729f77b98c95acd06159043
Reviewed-on: https://dart-review.googlesource.com/c/77671
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-03 00:16:15 +00:00
Brian Wilkerson edd86ef7a1 Generate quick fix for await in non-async (issue 34647)
Change-Id: Iabf8f11c8c477d1642e5122a5748b04bcdc5efa3
Reviewed-on: https://dart-review.googlesource.com/c/77669
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 20:46:36 +00:00
Dan Rubel 7c46a28505 Update convert class to mixin assist to remove "abstract"
Change-Id: I27ff36228b6c93d13a2f6d5f0a4c15414c130687
Reviewed-on: https://dart-review.googlesource.com/77022
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-27 21:07:03 +00:00
Mike Fairhurst 71ad670754 Provide quickfixes for imprecise integer literals.
Important to do, I think, because its easy for computers and hard for
humans.

Change-Id: Ic8c770c6a99f004d29c2fd24bddb122a70aeba3f
Reviewed-on: https://dart-review.googlesource.com/75240
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-18 17:52:17 +00:00
Brian Wilkerson 6c712f157b Add a fix to create a mixin
Change-Id: Id0f31949a5639a00e884abc61b2cfcb5bc552b44
Reviewed-on: https://dart-review.googlesource.com/75130
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-17 12:43:41 +00:00
Brian Wilkerson a80b13e2f9 Add an assist to convert from a class to a mixin
Change-Id: Id47de8ffe8c381973c5a4ca53f7459782e62d37f
Reviewed-on: https://dart-review.googlesource.com/74963
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-15 16:12:22 +00:00
Konstantin Shcheglov dbb1b2f4a6 Add 'Wrap with Container' quick assist.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I860a3a92024b349153266fd9e70b56beea426ee2
Bug: https://github.com/flutter/flutter-intellij/issues/2566
Reviewed-on: https://dart-review.googlesource.com/72260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-30 21:47:32 +00:00
Konstantin Shcheglov 1f52372bfa Remove CFE integration from analyzer, analysis_server, and analyzer_cli.
AnalysisDriverResolutionTest is partially updated, about 30 failing
tests added. I will get back to it in a following CL, it is not
directly CFE integration, but updated understanding how we want to
resolve. For example we don't need types for non-expression identifiers.

Change-Id: I3daddbb6c66ffad7a726f3313a1199fd7387aa04
Reviewed-on: https://dart-review.googlesource.com/71883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 13:46:45 +00:00
Janice Collins f40ff153a9 Enable --use-fasta-parser with the analyzer by default.
Based on Devon's change at:

https://dart-review.googlesource.com/c/sdk/+/67090

Change-Id: I80b7943826e248bf37d9bbbb769330d24b0dd6ae
Reviewed-on: https://dart-review.googlesource.com/70160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2018-08-28 19:29:17 +00:00
Konstantin Shcheglov 8b3a0a8476 Issue 2558. Fixes for 'convert to async function body'.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2558
Change-Id: I6e1931a226732b922c2c1695f378d3b59ae09c09
Reviewed-on: https://dart-review.googlesource.com/71560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-27 16:31:14 +00:00
Konstantin Shcheglov 34e6aa8ad2 Fix mock SDK and front-end targer in analyzer.
R=brianwilkerson@google.com

Change-Id: I7d4a1948fe21720c237f6e36997d29e63dd7ab28
Reviewed-on: https://dart-review.googlesource.com/70983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-21 21:42:23 +00:00
Aske Simon Christensen f8a96b88e9 It is an error if a final field is not initialized.
Bug: https://github.com/dart-lang/sdk/issues/33022

This commit adds an error when a final field is not initialized at all
(and there is at least one generative constructor). A later commit
will add an error for the case where a field is initialized by some,
but not all, generative constructors.

A number of classes in the Dart2js and DDC support libraries use
uninitialized final fields to indicate getters in the corresponding
native classes. This commit adds a temporary whitelist for the
affected files, which can be removed when the fields have been
replaced by external getters.

This is tracked by https://github.com/dart-lang/sdk/issues/33762

Change-Id: I6b5cee230c7cd5554da2b61da7ebddb6b0b9396e
Reviewed-on: https://dart-review.googlesource.com/63781
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-08-17 12:37:52 +00:00
Brian Wilkerson 0bcf767d4d Clean up more preview-dart-2 related code
Change-Id: Id1f81a635727f0f2fafb5dea4178f303c6ca4659
Reviewed-on: https://dart-review.googlesource.com/70143
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 14:43:12 +00:00
Brian Wilkerson 964a2fb9bb Produce fix when super constructor does not exist
Change-Id: I8186b42a938a3ad814e624ba5b378c130422209f
Reviewed-on: https://dart-review.googlesource.com/70080
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 13:24:32 +00:00
Brian Wilkerson 49437e3bae Split TooManyArguments to support quick fixes
Change-Id: I31511f619cafbce01f68d6e182328567a2bc3523
Reviewed-on: https://dart-review.googlesource.com/70021
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 13:24:22 +00:00
Brian Wilkerson 817e2cacb5 Base fixes on UNDEFINED_GETTER rather than UNDEFINED_IDENTIFIER
Change-Id: Icf951cbb8b046985df4f6cae6e7e7e1cfab7766a
Reviewed-on: https://dart-review.googlesource.com/69980
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-14 17:50:48 +00:00
Brian Wilkerson ecad8d67b3 Add fix for getters on parameters
Change-Id: I42b34534d9a83dd6802e5a79ea1d69bd4bbef887
Reviewed-on: https://dart-review.googlesource.com/69981
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-14 17:50:14 +00:00
Brian Wilkerson 8f768e7305 Fix an NPE when creating a fix to add a method for an undefined identifier that is not in a class context
Change-Id: Id7989b1dc0dc80b820aaf57a746247ac7525ed56
Reviewed-on: https://dart-review.googlesource.com/69660
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-13 17:32:59 +00:00
Brian Wilkerson d72334e6a2 Prevent NPEs in the fix processor
Change-Id: I2a5c12bf6f3aec4c8a504590f39b666c9934e4e4
Reviewed-on: https://dart-review.googlesource.com/68435
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-13 17:30:10 +00:00