Commit Graph

1185 Commits

Author SHA1 Message Date
Brian Wilkerson 01e0df71a8 Stop unnecessarily extending Object
Change-Id: Ib557755916b09be4e1ad1b1c2e4bed052a280513
Reviewed-on: https://dart-review.googlesource.com/c/84640
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-16 16:43:24 +00:00
Brian Wilkerson b12c125825 Export Future from dart:core in the mock sdk
Change-Id: I9b234e5834a6a6559b65b86140d60ea781ff8883
Reviewed-on: https://dart-review.googlesource.com/c/84501
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-11-15 19:32:30 +00:00
Konstantin Shcheglov da191665aa Issue 34709. Support generic type alias (AKA generic function type alias for now) in outline and completion.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34709
Change-Id: Ic18d98e07ba0cbd231ded27c4c32533ee013632b
Reviewed-on: https://dart-review.googlesource.com/c/84320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-13 21:20:08 +00:00
Konstantin Shcheglov d53f8c8789 Issue 34735. Fix completion in ConstructorFieldInitializer expression.
R=brianwilkerson@google.com, danrubel@google.com

Bug: https://github.com/dart-lang/sdk/issues/34735
Change-Id: I420822cce50b17807d1235de5d071942ce2e6076
Reviewed-on: https://dart-review.googlesource.com/c/84048
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-12 18:11:14 +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 dff53c12d0 Remove more uses of package:analyzer/analyzer.dart
Change-Id: I4b8abf72994d7a60b09529a740bd16b591813807
Reviewed-on: https://dart-review.googlesource.com/c/82800
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-04 19:36:36 +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 b71948faee Consolidate MockSdk(s) into one, living in analyzer/lib/src/test_utilities.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I70946b8e6f790608ad52c8f27cd6f506673f7b0d
Reviewed-on: https://dart-review.googlesource.com/c/82710
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-02 21:52:44 +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 57c185c89d Remove remaining uses of Element.context from server
Change-Id: Ibc383064951e181fa8e951714904526c2ea42f5f
Reviewed-on: https://dart-review.googlesource.com/c/81749
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-29 14:56:24 +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
Danny Tuppeny 9c3834d41c Remove unused import that shows a warning
Change-Id: Icc044234df59a2e1e148a531df59e952a221c8a3
Reviewed-on: https://dart-review.googlesource.com/c/81005
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-22 14:31:34 +00: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
Konstantin Shcheglov 7c80d22878 Make indexing in AnalysisDriver optional.
This makes my Flutter benchmark about 6% faster.

It will not affect performance of `flutter analyze`, because for now
Analysis Server always enables indexing and search. But we could make
this optional, for DAS clients that need only errors, but not search,
refactorings, etc.

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

Change-Id: I4eafc37592a3bb18bd2c6ab84dc2515a4d42697b
Reviewed-on: https://dart-review.googlesource.com/c/80880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-21 20:20:05 +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
Paul Berry fe5467092a Merge commit '7a3762d4a91aed0b3885259b297953d0c38ce849' into analyzer 2018-10-19 10:00:38 -07: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
Danny Tuppeny a502061c11 Add test and implementation for package: uris
Change-Id: Ibf114d83cade42ced7601befafec8a7e7c9f4bc7
Reviewed-on: https://dart-review.googlesource.com/c/78985
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-19 10:41:48 +00:00
Jaime Wren 2d397d1da6 Fix for dartbug.com/34821, variable_name_contributor.dart to complete "var SomeType |", to "someType" and "_someType", for declarations that can be denoted private.
Change-Id: I712ebc0f7a7288e1ace713f57b6694f0ed4874eb
Reviewed-on: https://dart-review.googlesource.com/c/80362
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-16 22:58:27 +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
Danny Tuppeny be39eacf00 Rename convertPathForImport -> convertAbsolutePathToUri
Also remove any calls that aren't required. The function still works if you pass it a relative path (for convenience, if you have a variable) but it's not required for relative paths.

Change-Id: I567e098f5956a7c2b5fe2d6d7d7fb16a263a72cc
Reviewed-on: https://dart-review.googlesource.com/c/79025
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-10 16:03:58 +00:00
Danny Tuppeny 3d06427075 Fix MOVE_FILE test paths for Windows
- Wrap all paths with separators in convertPath() for Windows
- Ensure convertPathForImport does the right thing for relative paths
- Use the correct convertPath for imports/exports/parts

Change-Id: Ie95e41686479f175c9ba661180fdf5ad90b409e8
Reviewed-on: https://dart-review.googlesource.com/c/78740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-09 15:00:07 +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
Peter von der Ahé 2a6b566ca2 Move byte store to package:analyzer
Change-Id: I1fc41cc0b2e2848565a5411d0512a4ca086ab659
Reviewed-on: https://dart-review.googlesource.com/c/77761
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-04 09:15:54 +00:00
Peter von der Ahé 45cb0815bc Move PerformanceLogger to package:analyzer
Change-Id: I89a60ae9ab639c7907a92976e1eb8007d0f4ee9b
Reviewed-on: https://dart-review.googlesource.com/c/77760
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-10-04 08:44:43 +00:00
Danny Tuppeny 878779e1a2 Fix test and add TODO for others that need updating
Change-Id: I381f442ec7ac5f5c69901c70e6a33dfd196d56b4
Reviewed-on: https://dart-review.googlesource.com/c/77884
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-03 19:44:40 +00:00
Danny Tuppeny 2dfe46fba2 Additional work on MOVE_FILE and associated tests
- Update outgoing part-of relative uris (may need changing)
- Add a helper for verifying failed refactor statuses
- Use the original file location for checking if in an analysis root
- Remove tests for functionality we're not yet supporting
- Remove forced failures and @failingTest for tests that work

Bug: https://github.com/dart-lang/sdk/issues/33605
Change-Id: I405bfcb92ce2ce66710caf934fc03e10eb66aea3
Reviewed-on: https://dart-review.googlesource.com/c/77541
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-03 14:22:11 +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
Brian Wilkerson 72d3798764 Improved completion support for mixins
Change-Id: I77aea1b03e00725c48458b0e6ee9b1936ea5685c
Reviewed-on: https://dart-review.googlesource.com/c/77661
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 18:27:33 +00:00