Commit Graph

65 Commits

Author SHA1 Message Date
Brian Wilkerson 61b4c0f770 Cleanup hints and lints in analyzer packages
Change-Id: I7f1a6ad1ed3610da9616683576ebfb5efd543fd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119164
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-09-27 16:12:44 +00:00
Konstantin Shcheglov 605709ac31 Fix _isDynamicExpression() in DartUnitHighlightsComputer2.
The staticType of an "expression" can be `null` if it is not really
an expression, e.g. an import prefix, or a name of an extension.

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

Change-Id: I9eb328453e77fa51ff0f2d289972ad1274a9a5e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114558
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-26 21:54:52 +00:00
Brian Wilkerson 17e15ee9a4 Add outline support for extensions
Change-Id: I1b7145e899614b3d73d3fc2bfbe3dd7f773d38d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109880
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-07-22 21:12:40 +00:00
Brian Wilkerson b4e66ed3d0 Add highlighting for extensions
Change-Id: Ifa790e8e0830276cd794aa903aa5b2a9c1e03a97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109464
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-07-17 22:03:07 +00:00
pq 52abcd3dd2 apply prefer_equal_for_default_values
Change-Id: I9b6fd3ee18ec834a5db3d0d25455b6db9ea4fbe2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108664
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-07-10 19:31:40 +00:00
Brian Wilkerson 6602764dc8 Add folding for asserts and for extensions
Change-Id: I9d0a3d21b441dcef967ece5fbcd6fe9ebd932e13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107342
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-27 16:57:07 +00:00
Konstantin Shcheglov 3124125008 Move Flutter utility methods into a class, which can be instantiated either with regular package:flutter, or with package_flutter_web.
The factory constructors does not yet choose one, will do in a
following CL.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/36056
Change-Id: I7fabe9da571ea80ce993d9303217ccd8b085e8a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95283
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-05 05:51:41 +00:00
Brian Wilkerson 4a144e631f Fix production of outline for incomplete generic function types (issue 36059)
Change-Id: Ie8e5279fb7b9094377197ee9d0f568f8baad3d10
Reviewed-on: https://dart-review.googlesource.com/c/95080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-02 01:37:32 +00:00
Brian Wilkerson 28eb8604e3 Correctly handle invocations of top-level functions with an import prefix
Change-Id: I7e75dc79bf8104af974881bf9f8e3cd8de86b961
Reviewed-on: https://dart-review.googlesource.com/c/93370
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 17:50:31 +00:00
Brian Wilkerson 1d1654592a Do not compute any imports for use on paste if import directives are being copied
Change-Id: I1e4aa232c2dac4acb6d9bc5c556fbaf619160cac
Reviewed-on: https://dart-review.googlesource.com/c/93483
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-18 20:21:33 +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
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 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 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 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 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
Peter von der Ahé ed42aab273 Move source.dart to package:analyzer
Change-Id: Ide66d4f69b8588f04967c510eae0a733b4b3f0c5
Reviewed-on: https://dart-review.googlesource.com/c/77860
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-03 12:56:49 +00:00
Konstantin Shcheglov 215e80eb0a Fix Analysis Server tests on Windows bot.
R=brianwilkerson@google.com

Change-Id: I0afc4ee40d8b1030bbcfc35bfb43a13d2db3accd
Reviewed-on: https://dart-review.googlesource.com/77266
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-10-01 01:09:28 +00:00
Brian Wilkerson e9504d2857 Add outline support for the new mixin syntax
Change-Id: I75d020f613daf37812ccf805d75e35091a28c198
Reviewed-on: https://dart-review.googlesource.com/72524
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-31 21:53:15 +00:00
Brian Wilkerson 4461b7cbcc Add folding support for the new mixin syntax
Change-Id: I8f37a391cc47a2203730c81acd5f1776cb386e2e
Reviewed-on: https://dart-review.googlesource.com/72521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-31 17:33:36 +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
Dan Rubel 825df975a0 Revise fasta type arg/param parsing to ignore "<".endGroup
The scanner associates '<' with '>' and '>>',
but the parser cannot use '<'.endToken/endGroup reliably
and wastes time updating that token's endToken/endGroup field.

This CL updates type info parsing to ignore '<'.endGroup
and step through the token stream (which it has to do anyway),
for improved parsing.

This CL causes a handful of existing tests to fail (marked as @failingTest)
and test failures will be addressed in a subsequent CL.

Change-Id: I788e9a74cd2891f98f44bba15d5669febfec6c64
Reviewed-on: https://dart-review.googlesource.com/70001
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 22:16:40 +00:00
Brian Wilkerson 978f12c17f Use void in place of Null in analysis_server
Change-Id: Ifef805cb3c0111e237a6147f71a968958d5651e5
Reviewed-on: https://dart-review.googlesource.com/69560
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-13 13:16:53 +00:00
Brian Wilkerson 19a90c2c8b More CFE tests for server
Change-Id: I829032909ce3c9244c8b204ca12b8aeef61e997e
Reviewed-on: https://dart-review.googlesource.com/68844
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-08 15:21:50 +00:00
Brian Wilkerson 31765bf56f Clean up some hints in server code
Change-Id: Ia620cfd7c4cb116ca55ce8a4405820007bc69160
Reviewed-on: https://dart-review.googlesource.com/68740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-07 18:35:33 +00:00
Brian Wilkerson bc8a8386af Fix tests that reference the flutter package
Change-Id: Idd1949db259d747abb063328901f42be29ba57b2
Reviewed-on: https://dart-review.googlesource.com/68581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 15:48:37 +00:00
Danny Tuppeny 3dc201e168 Update ChangeBuilder to not include empty edits (Take 2)
Combination of Brian's change:
https://dart-review.googlesource.com/c/sdk/+/63901

and Devon's change:
https://dart-review.googlesource.com/c/sdk/+/66405

Change-Id: I57e5d1f7d3a653f225aba2d690190fe1ff18a5b1
Reviewed-on: https://dart-review.googlesource.com/67344
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-07-31 13:44:06 +00:00
Danny Tuppeny 111b621828 Handle folding for function expression invocations
Change-Id: Id93004c1ea218b1768d649a2a806ce58a9d7f0a5
Reviewed-on: https://dart-review.googlesource.com/59061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-06-07 14:42:42 +00:00
Danny Tuppeny 3af09b5b26 Add support for invocation + list/map literal folding
Bug: https://github.com/Dart-Code/Dart-Code/issues/966
Change-Id: Id85471f095b26349e60e0b10f89b4465d4c9b138
Reviewed-on: https://dart-review.googlesource.com/58740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-06-07 09:05:33 +00:00
Konstantin Shcheglov 819b212318 Issue 33228. Fix Dart2 error in outline computer.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33228
Change-Id: Ifa328eee5cbc398ada9cfee0a582f169b140434e
Reviewed-on: https://dart-review.googlesource.com/56625
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-24 21:36:32 +00:00
Danny Tuppeny 39fa25cbe2 Implement FILE_HEADER folding
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: I66833cc73b4adecf1743c623cfc2c7fbd9af45bc
Reviewed-on: https://dart-review.googlesource.com/55284
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-16 15:37:20 +00:00
Danny Tuppeny 9b8776763c Add some (marked) failing tests for FILE_HEADER
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: I89d358dd1dc41d8bece7f16ed49fb98b9b8c0aa5
Reviewed-on: https://dart-review.googlesource.com/55104
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-16 07:35:48 +00:00
Danny Tuppeny 5a3aff60b6 Update annotations to be a single region for all
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: I41586b53814d335046cc18c24936a3d32277deda
Reviewed-on: https://dart-review.googlesource.com/55100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-15 13:39:54 +00:00
Danny Tuppeny 568e977a35 Update FoldingKinds enum, update specs and increase version number
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: Ieccfd90ead67a9803744c54db4eec8eea0b0403c
Reviewed-on: https://dart-review.googlesource.com/54920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-14 16:48:48 +00:00
Danny Tuppeny 68229b862f NPE fix for annotations with no arguments
Change-Id: I93254aeef708157566a3adf942ebc84902e3c02c
Reviewed-on: https://dart-review.googlesource.com/54680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-11 13:38:27 +00:00
Danny Tuppeny d5f76cc963 Add annotations to folding regions
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: Ie1917e3bd29b5cc2b6ecbed1238818e4e49f822a
Reviewed-on: https://dart-review.googlesource.com/54580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-10 14:22:41 +00:00
Danny Tuppeny 46043004d6 Move folding regions to actual blocks
This puts the region inside the braces; eg. the bit the user would expect to disappear when the region is collapsed.

Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: I58b347d2e1582bb4a6a35cf45c17085ea1739816
Reviewed-on: https://dart-review.googlesource.com/54402
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-10 07:44:10 +00:00
Danny Tuppeny b73541cffe Add a skeleton for Dart Folding
Only currently adds a single region around Directives.

Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: Ibde0400c5815c00b1f94bf592d8cc9eb7cb592cf
Reviewed-on: https://dart-review.googlesource.com/54232
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-05-08 16:59:03 +00:00
Konstantin Shcheglov 67d3e4e3a1 Use actual names of the @isTest of isTestGroup executable in outlines.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: Ifcd9d2398ca4e80cdace115e36f0d27df1afaad4
Reviewed-on: https://dart-review.googlesource.com/53825
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-05-04 20:11:16 +00:00
Konstantin Shcheglov b7a63c8d52 Use @isTest and @isTestGroup to understand executable element as a test/group.
R=brianwilkerson@google.com, devoncarew@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2055
Change-Id: I7c8e7639d111eca63df0780ebdec182573493047
Reviewed-on: https://dart-review.googlesource.com/53690
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-04 17:09:06 +00:00
Brian Wilkerson 39395f911b Send type parameters for functions in outlines
Change-Id: Ie11d739a41408903390ac2c1434d05fd7dccca0e
Reviewed-on: https://dart-review.googlesource.com/48267
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-24 14:54:13 +00:00
Konstantin Shcheglov e1909cb52a Update Outline protocol - change offset/length, add codeOffset/codeLength.
R=brianwilkerson@google.com

Change-Id: I4b5c03a21254f7c497adc4c043641b18599c5c39
Reviewed-on: https://dart-review.googlesource.com/45764
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-09 01:52:57 +00:00
Danny Tuppeny 40e3f9addc Convert paths for mock SDK libraries to fix tests on Windows
The other lines on this method are calling `provider.convertPath` around their paths but these ones do not, which is causing almost all analysis server tests to fail on Windows (for me - I can't explain them not
failing builds). This causes the hard-coded paths like `/lib/core/core.dart` to be fixed up to `C:\lib\core\core.dart` which is what the server is looking for (because at the other end the paths *have* been fixed up).

See #32226.

Closes #32230
https://github.com/dart-lang/sdk/pull/32230

GitOrigin-RevId: 1adeee23f8ac8efc8acf61caf5f769e4ec44c030
Change-Id: Id9bf195967db0912c6f4b67bd79d504e627b8aab
Reviewed-on: https://dart-review.googlesource.com/42300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-20 18:55:38 +00:00
Brian Wilkerson b44989cd57 Fix exception (issue 31922)
Change-Id: Id2d64ec1f92611e44b3c6e22c94efd1711b1a30e
Reviewed-on: https://dart-review.googlesource.com/37083
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-27 15:58:20 +00:00
Konstantin Shcheglov 07367d05cd Basic implementation of FlutterOutlineComputer.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I22c96c2a35c086814aace13f0121cc0361f3386f
Reviewed-on: https://dart-review.googlesource.com/36140
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-21 18:12:58 +00:00
Brian Wilkerson 8e7781ea9e Convert remaining tests to use ResourceProviderMixin
Change-Id: I7bd0941a415737bd3c9c55e9650f2a982937f777
Reviewed-on: https://dart-review.googlesource.com/31961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-02 16:33:14 +00:00
Devon Carew 38df6ea1f4 Only show closing labels that have nesting.
Bug:
Change-Id: Ifc9177973961f2a74be3e2871aa2d58c28007478
Reviewed-on: https://dart-review.googlesource.com/29540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-14 15:54:50 +00:00
Konstantin Shcheglov 6b1658906e Support for Flutter is not limited to code correction. Move to utilities.
R=brianwilkerson@google.com

Bug:
Change-Id: Idaa90946710fcbec2a35a91eb35b5ead68cf4170
Reviewed-on: https://dart-review.googlesource.com/16621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-25 19:11:38 +00:00
Konstantin Shcheglov c2f1af6378 First steps for computing Flutter outlines.
R=brianwilkerson@google.com, devoncarew@google.com

Bug:
Change-Id: Ib8151df40439a28da536d467a5c0e7354fcfba51
Reviewed-on: https://dart-review.googlesource.com/16338
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-25 17:00:56 +00:00