Commit Graph

131 Commits

Author SHA1 Message Date
Konstantin Shcheglov a332c414f1 Switch server to using DeclarationsTracker for 'Import Library' quick fixes.
We need this to stop using UnlinkedUnit with summary2.

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

Change-Id: Iaca2f19e6a168818e171f09e6eeda71a75854232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 16:45:32 +00:00
Konstantin Shcheglov cfdcfe2bfe Update DeclarationsTracker when a context options change.
E.g. when .packages changes, we want to re-scan the context for new
available libraries. We also don't want to discard all context, and
resend everything.

R=brianwilkerson@google.com

Bug: https://github.com/Dart-Code/Dart-Code/issues/1723
Change-Id: I19ee71c1d021fb9bcda9d02d86b7cbb078704aa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-21 18:43:36 +00:00
Paul Berry e2d0f5a50b Add featureSet parameter to Parser constructor.
And deprecate old parser configuration setters.

Change-Id: Ib1507b8d2b20be7c883061e2a92ec9205d6a378f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100664
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-29 16:42:19 +00:00
Konstantin Shcheglov 91e9962699 Don't report libraries that became parts as changed libraries.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/36725
Change-Id: Idea33b07e513147930d1a41a3b3c8718066ce817
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-24 19:24:15 +00:00
Paul Berry cee1e41fe8 Plumb new FeatureSet class into Scanner.
And change clients of the scanner (within the SDK) to use it.

Long term, it would be better to store the FeatureSet object directly
in the Scanner and remove the existing flags `enableGtGt` and
`enableNonNullable`.  However there are analyzer clients that
currently use these flags.  So for now, we simply plumb in the
FeatureSet as a new way of setting AstBuilder flags.  Once we've
updated clients to use FeatureSet, we'll publish a breaking version of
the analyzer that removes the old flag API.

Change-Id: I9e662f4ed45668d9acd4f56e42d7d8dae6180d48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99975
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-23 16:13:43 +00:00
Brian Wilkerson af0fa108da Add support for required named parameters
Change-Id: Iebfd8da18c6f2158ed39043ab116e2670a7329c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99717
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-19 19:25:01 +00:00
Konstantin Shcheglov d4fee0a85e Issue 36576. Add returnType to constructor in available declarations.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/36576
Change-Id: I6acbf82bbaafc1ab5a1599cd415cdb11600064a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-11 18:59:43 +00:00
Konstantin Shcheglov ddbeda075f Rework storing constructors and enum constants.
I was adding default constructor to classes and found another problem
with shadowing exported declarations with local ones - we shadow
the class, but not its constructor. So, I'm changing it to keep
constructors and enum constants in corresponding parent declaratiosn.

R=brianwilkerson@google.com

Change-Id: I4e49b57f9fe1ac8bf611f241d2c279c746ad55ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-04 19:40:54 +00:00
Konstantin Shcheglov 0d0f5916f7 Issue 36439. Fix for incomplete generic type alias, without function type.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/36439
Change-Id: I6a3c5be2f412ce7fb4e5b9ce3ad463158c878106
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98436
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-02 21:15:35 +00:00
Brian Wilkerson f6768b6fb3 Update the data version to prevent the use of outdated cached data
Change-Id: Ie590959d2812b7e33854e8ad798cd43366f7bfa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98450
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-02 16:55:41 +00:00
Brian Wilkerson dd7a6320e3 Rework the way Dartdoc template information is gathered
Change-Id: Ia6ecde9cc317ae40e8876cdf39b49bd39a47b543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98365
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-01 21:46:52 +00:00
Konstantin Shcheglov 9b77e4c507 Include constructors into available suggestions.
R=brianwilkerson@google.com

Change-Id: I44a9ad96f40ff1c5bd42f41bdf03defae7608360
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94980
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-29 01:26:39 +00:00
Brian Wilkerson edf470bf83 Initial sketch of dartdoc support
Change-Id: I1250bfd56075d6575c0f268b4e335445b13b4605
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97443
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-28 20:52:29 +00:00
Konstantin Shcheglov cc1ddfb337 Issue 36212. Fix for updated part without library.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/36212
Change-Id: Ib0c43685c0b9f167591232d384a7fc5e426c07d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97007
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-16 02:13:12 +00:00
Paul Berry 095e651ff2 Eliminate uses of old AST node types from pkg/analyzer/lib/src/services
Change-Id: I5aefe213b22e9200aa2e3f24ae065ef9fc0f214c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-04 16:14:16 +00:00
pq 371d244273 linter version support
See: https://github.com/dart-lang/linter/issues/1440

Change-Id: I0198ea52fb9d5680e76a462d25d7302cd4aa6be8
Reviewed-on: https://dart-review.googlesource.com/c/93882
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-02-21 00:58:08 +00:00
Konstantin Shcheglov 8ac6114028 Sort AvailableDeclaration fields.
IntelliJ had a regression for a short time, so sorting did not work.

R=brianwilkerson@google.com

Change-Id: I0b631e8061bc3139f0848492e35c583b6bfb4ec4
Reviewed-on: https://dart-review.googlesource.com/c/93747
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-20 22:51:58 +00:00
Konstantin Shcheglov 5722ca3126 Include defaultArgumentListString / defaultArgumentListTextRanges into AvailableSuggestion(s).
R=brianwilkerson@google.com

Change-Id: I114c3c53de5782fa72d033a39e0d96fa5134ea1c
Reviewed-on: https://dart-review.googlesource.com/c/93600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-20 00:15:21 +00:00
Konstantin Shcheglov 1ed9a34513 Add defaultArgumentListString / defaultArgumentListTextRanges to Declaration.
R=brianwilkerson@google.com

Change-Id: I1ce920bf3373634674f12b6e710f702214335e83
Reviewed-on: https://dart-review.googlesource.com/c/93371
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 21:17:31 +00:00
Brian Wilkerson 122aa43ef6 Convert ListLiteral and remove uses of ListLiteral2
Change-Id: I6c6f60ae969deb798cdbc8572341f2a51256b194
Reviewed-on: https://dart-review.googlesource.com/c/93341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-15 16:17:28 +00:00
Brian Wilkerson 30f9f5b1c7 Add SetOrMapLiteral to support the code-as-ui features
Change-Id: I6d3023855fea6da859af0815bfae6857f1546cb9
Reviewed-on: https://dart-review.googlesource.com/c/93062
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-13 20:14:24 +00:00
Konstantin Shcheglov 7f2f840a91 Don't include constants of private enums.
R=brianwilkerson@google.com

Change-Id: I477db71282da118a74844c7c3d8d7c5b992d61b1
Reviewed-on: https://dart-review.googlesource.com/c/93067
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-13 19:41:06 +00:00
Konstantin Shcheglov a31a72521b Don't include declarations of the library itself.
These declarations are already available through the library element
model.

R=brianwilkerson@google.com

Change-Id: I9d3d274a8bf4ad28c10f04afc30fa11436cd0f6a
Reviewed-on: https://dart-review.googlesource.com/c/92848
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-13 05:43:23 +00:00
Konstantin Shcheglov 80e85d06ab Fixes for enum constants in available declarations.
R=brianwilkerson@google.com

Change-Id: Ic1ad3846ecf82cdd5f1f0b0d0d5a69b0d5c43d81
Reviewed-on: https://dart-review.googlesource.com/c/92763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 17:43:58 +00:00
Konstantin Shcheglov 71e8588399 Include enum constants into available declarations.
R=brianwilkerson@google.com

Change-Id: I86c525981119a77ad8b69878f8134d927f873817
Reviewed-on: https://dart-review.googlesource.com/c/92662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-12 01:04:34 +00:00
Konstantin Shcheglov 3de72ae066 Added files, when in a context root, should be accessible through getLibraries().
R=brianwilkerson@google.com

Change-Id: I6d36ac4bed51b6e40307d2821780bb3fb08d540d
Reviewed-on: https://dart-review.googlesource.com/c/92624
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-11 21:04:44 +00:00
Konstantin Shcheglov 2bab9eab49 Guard against empty URIs.
Particularly, against empty `part` URIs, because this would cause us
to think that the library includes a part, which URI is... the library
itself, because `resolveUri(uri, '') === uri`.

R=brianwilkerson@google.com

Change-Id: Ie6bf0279c467b00d9b5540697e866d0e619d49b0
Reviewed-on: https://dart-review.googlesource.com/c/92443
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 23:07:50 +00:00
Konstantin Shcheglov 61ae86bce2 Add relevance tags to available declarations.
R=brianwilkerson@google.com

Change-Id: Ifa0fef7f9e572368c857fe972e007483782f119e
Reviewed-on: https://dart-review.googlesource.com/c/92405
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 19:56:36 +00:00
Konstantin Shcheglov 70283bdb3a Improve choosing context for changes files.
This should fix the Windows bot failure in Analysis Server.

R=brianwilkerson@google.com

Change-Id: I50cc69f7c0f60d955d8bb96cacc740e2d0c8d45e
Reviewed-on: https://dart-review.googlesource.com/c/92304
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-07 20:43:40 +00:00
Konstantin Shcheglov 67a1ce6b34 Notify DeclarationsTracker about file changes.
R=brianwilkerson@google.com

Change-Id: Iedbd695a184cefb384195ac56cffcf34c17806e7
Reviewed-on: https://dart-review.googlesource.com/c/92154
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-07 02:03:17 +00:00
Konstantin Shcheglov ae5bd68570 Lower relevance of deprecated suggestion sets.
R=brianwilkerson@google.com

Change-Id: I3b10c74d815c69f120238a6fd5028ae534fc7446
Reviewed-on: https://dart-review.googlesource.com/c/92142
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-06 19:38:30 +00:00
Konstantin Shcheglov adfa4791fc Improve storage for available declarations.
1. Getters and setters.

2. Parameters.

3. Restore null where should when reading from flatbuffers.

R=brianwilkerson@google.com

Change-Id: I934e828ced6ae21c1c633c2a94e3336078eb2747
Reviewed-on: https://dart-review.googlesource.com/c/92084
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-06 17:35:45 +00:00
Konstantin Shcheglov 931051814c Partial implementation of the 'available suggestion sets' protocol.
R=brianwilkerson@google.com

Change-Id: I856b6a39c2464caf6750e0b0abb0cfa29311e97c
Reviewed-on: https://dart-review.googlesource.com/c/91769
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-01 17:55:27 +00:00
Konstantin Shcheglov f903ee6dc0 Don't crash on formal parameters without name, exclude private SDK lbiraries.
R=brianwilkerson@google.com

Change-Id: Ie5d72458c6d19fb250591550d47c4076082dff1e
Reviewed-on: https://dart-review.googlesource.com/c/91683
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-30 19:48:28 +00:00
Konstantin Shcheglov e8a0a209e3 Include into Declaration data that we will need for pre-cached suggestions.
R=brianwilkerson@google.com

Change-Id: Ie4419e785c06fa7b3913359e5831e97c611f46a7
Reviewed-on: https://dart-review.googlesource.com/c/91587
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-30 16:31:34 +00:00
Konstantin Shcheglov 25d8456c48 Small improvements for DeclarationsTracker.
R=brianwilkerson@google.com

Change-Id: Ic35e7cead9a50b9eb8ae590f9fbf85df0a8f7fc1
Reviewed-on: https://dart-review.googlesource.com/c/91583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-29 22:33:34 +00:00
Konstantin Shcheglov 95b017a888 Implement changeFile() and recompute available libraries and declarations.
Some renames in tests.

R=brianwilkerson@google.com

Change-Id: Ia54752c816bbc62f99a200d62658b6f4dfb26480
Reviewed-on: https://dart-review.googlesource.com/c/91381
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-28 18:05:17 +00:00
Konstantin Shcheglov d927333c52 Add all SDK libraries, and context files belonging to the package / potions of it.
R=brianwilkerson@google.com

Change-Id: I7e5d6cc12657c92f16d65e89f4b60eacf16c51b6
Reviewed-on: https://dart-review.googlesource.com/c/91260
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-27 22:33:04 +00:00
Konstantin Shcheglov f8fef94243 Authomatically add dependencies from pubspec.yaml files.
In addition to (path, modification) also cache on the content hash.

Implement getLibraries().

R=brianwilkerson@google.com

Change-Id: I263b5479f867aa28d5e43bc0c1bb02702ab6c915
Reviewed-on: https://dart-review.googlesource.com/c/91160
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-25 19:03:51 +00:00
Konstantin Shcheglov 0f459af6ca Available libraries and their declarations.
Initial version for backend, will add more implementation in
following CLs.

Change-Id: I4fe1b88f87451e387ae9774f12c9496cc8c2b8db
Reviewed-on: https://dart-review.googlesource.com/c/90361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-23 22:02:30 +00:00
Brian Wilkerson 469e1e2e64 Remove unnecessary library directives
Change-Id: I7a157080e4d7fd80d64489a13de4e996b5870930
Reviewed-on: https://dart-review.googlesource.com/c/79474
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-13 00:44:04 +00:00
Brian Wilkerson b81564b623 Add support for generating lints when using the new driver
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2545553007 .
2016-12-03 07:25:42 -08:00
Brian Wilkerson e63105555b Remove uses of configuration data
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2522543007 .
2016-11-22 11:26:08 -08:00
Brian Wilkerson ecc84b26a4 Break up another large file
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2342733002 .
2016-09-15 07:49:27 -07:00
Brian Wilkerson 3024554b3c Improve type information and minor clean up
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1977413002 .
2016-05-16 08:43:58 -07:00
Brian Wilkerson 5309d86424 First batch of changes to make analyzer package strong mode error free
Review URL: https://codereview.chromium.org/1808123005 .
2016-03-18 07:47:58 -07:00
pq 9a042501c9 Timing hooks to profile linters (#24548).
Adds a `TimedAstVisitor` that wraps and times base visitors.  The perf hit for collecting timing was neglible so I opted to NOT surface a way to not collect the data.  We can add that if needed.

Once this is published in a new analyzer, I can bake client support into (for example) the linter.

More context and a client mock here: https://github.com/dart-lang/sdk/issues/24548

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1807723002 .
2016-03-15 16:10:35 -07:00
Brian Wilkerson 76d22fe363 Move DelegatingAstVisitor into the public API
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1747093002 .
2016-03-01 07:57:01 -08:00
Brian Wilkerson 21ecb14548 Clean-up imports
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1602803002 .
2016-01-18 15:42:16 -08:00
Brian Wilkerson f0d249e269 Clean up package imports and library names
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1513643009 .
2015-12-10 08:11:56 -08:00