Commit Graph

140 Commits

Author SHA1 Message Date
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 1f10422fd5 Update uses of deprecated API in ddc
R=jmesserly@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2338883002 .
2016-09-13 11:44:38 -07:00
Brian Wilkerson 5bd4de469e Clean up warnings and hints
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2324463006 .
2016-09-09 09:09:59 -07:00
Konstantin Shcheglov 9cf47ce04c Remove parseUriWithException() and URISyntaxException.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2321263003 .
2016-09-09 08:30:01 -07:00
Brian Wilkerson fe02411930 Remove several references to JavaFile
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2323173002 .
2016-09-09 07:45:40 -07:00
Paul Berry 94309733cd Revert "Remove unnecessary hide clauses"
The `Resource` class wasn't removed from the SDK until version
1.20.0-dev.0.0, which was only recently published.  Reverting this
change to allow people using older SDK releases a little more time to
upgrade.

This reverts commit 2cdafd82c2.

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

Review URL: https://codereview.chromium.org/2299243002 .
2016-09-01 16:08:43 -07:00
Brian Wilkerson 2cdafd82c2 Remove unnecessary hide clauses
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2305453002 .
2016-08-31 16:44:52 -07:00
Konstantin Shcheglov a3a031195a Add DartSdk.getLinkedBundle() and use it in PubSummaryManager.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2242963002 .
2016-08-12 12:11:03 -07:00
Brian Wilkerson c41427383b Deprecate DirectoryBasedDartSdk and transition existing uses to the new API
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2242853002 .
2016-08-12 09:18:12 -07:00
Brian Wilkerson 5b26441dbf Convert server and cli and deprecate the old implementation
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2214613003 .
2016-08-04 11:28:16 -07:00
Brian Wilkerson b888675b55 Move embedder locator and convert context builder to use the new API
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2208503004 .
2016-08-04 10:41:53 -07:00
Konstantin Shcheglov 94a41e0d2e Fixes for context_manager_test on Windows.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2142143002 .
2016-07-12 12:26:29 -07:00
Brian Wilkerson 2eae1b611c Handle SDK extensions in the SDK
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2133873003 .
2016-07-11 07:44:11 -07:00
John Messerly 1b9bf0769d fix #26122, classify strong mode errors correctly
StaticTypeWarningCode was being handled, but many warnings with StaticWarningCode also need to be treated as errors.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2108823002 .
2016-06-28 14:35:44 -07:00
Brian Wilkerson 5c97a88ddd Remove embedder locator from analysis context
R=pquitslund@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2078993002 .
2016-06-17 09:42:27 -07:00
Brian Wilkerson 2b522d50d0 Deprecate EmbedderUriResolver
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/2076743002 .
2016-06-17 07:44:02 -07:00
Brian Wilkerson dc7fb35bd4 Refactor common portions of the two SDK implementations into a base class
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/2069483002 .
2016-06-16 08:57:32 -07:00
Brian Wilkerson 62eb45dc32 Display additional context information in status pages
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2030573002 .
2016-06-01 08:11:31 -07:00
pq fba5cbc425 Analyzer 0.27.4-alpha.9 (API fixes) (#26562).
Restores `EmbedderUriResolver` API.

Addresses breakages in `dartdoc` and any other downstream dependencies.

See: https://github.com/dart-lang/sdk/issues/26562.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2021453003 .
2016-05-29 06:57:42 -07:00
pq 53fe39137f Embedder support refactoring (phase 1).
A bunch of changes to pave the way for emebdder SDK summary creation.

* Moves _embedder.yaml processing into the embedder SDK (out of the resolver).
* Changes EmbedderUriResolver to compose rather than extend a DartUriResolver.
* Fixes the wierd handling (dropping to add back) of `dart:` URIs.
* Fixes the incorrect overriding docs for `SDKLibraryImpl.shortName`.
* Updates embedder test to include a definition of `dart:core` in anticipation of adding some embedder SDK tests.

Some API work TODO in a follow-up CL (notably the way we check for the presence of embedders by querying the resolver is odd).

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2009303002 .
2016-05-25 10:52:53 -07:00
pq c07b21d03b Dangling comment reference cleanup in analyzer.
First pass with the new `comment_reference` lint.

BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1994243002 .
2016-05-19 10:24:53 -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 44836f8538 Support the name analysis_options.yaml for analysis options files
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1975963002 .
2016-05-13 07:33:06 -07:00
Brian Wilkerson 24d23680d1 Use null-aware operators to clean up the code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1933763002 .
2016-04-29 08:48:12 -07:00
pq 870aa5e4f4 Pubspec-specified analysis configuration (#26359).
Provides support for pubspec-specified analysis configurations.

Context: https://github.com/dart-lang/sdk/issues/26359

TODO:
  * docs
  * CLI support

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1923973004 .
2016-04-28 13:10:45 -07:00
Brian Wilkerson 7ca7c9d9e6 Remove more type casts
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1917203002 .
2016-04-26 10:10:57 -07:00
Brian Wilkerson cda79ce966 Remove unnecessary casts and general code clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1918923003 .
2016-04-25 12:24:34 -07:00
Konstantin Shcheglov d097a6e1cd Allow Analysis Server crawl up the folders to search .analysis_options file.
R=brianwilkerson@google.com, jwren@google.com, pquitslund@google.com
BUG=

Review URL: https://codereview.chromium.org/1832643002 .
2016-03-23 17:09:48 -07:00
Konstantin Shcheglov c675ba270f Pass AnalysisOptions into SdkCreator, disable changing afterwards.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1830703002 .
2016-03-23 13:11:49 -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
Bob Nystrom a602585097 Don't upgrade the severity of *everything* to an error in strong mode.
Oops!

Fixes #26026.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1813973002 .
2016-03-17 12:58:18 -07:00
Bob Nystrom 2ef00b0c3d Don't report redundant type errors in strong mode.
Currently, "sideways casts" -- type errors where one type is assigned
to an unrelated type -- are reported by both ErrorVerifier and strong
mode's Checker. This leads to duplicate errors that the user can see.

ErrorVerifier's errors are generally better: they give the user more
contextual information and are easier to read. So this CL eliminates
Checker's reporting of these errors and only uses ErrorVerifier's.

However, in strong mode, type errors like this are fatal: DDC can't
generate correct code. So this also automatically upgrades all static
type warnings to errors when strong mode is enabled.

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

Review URL: https://codereview.chromium.org/1780783002 .
2016-03-15 12:14:11 -07:00
pq 9ea17184ad Add @overrides to (a lot of) analyzer.
This gets us roughly half+ way there.  We should defintely consider automating this to speed up the rest.  (Even with the quick-fix it's VERY tedious and slow going.)

Once we've done this in bulk, I'd like to add the  `annotate_overrides` lint to analyzer and server `.analysis_options`.

BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1749143003 .
2016-03-01 16:33:20 -08:00
pq fa08150ca6 Support for embedder dependency changes (#25606).
Adds logic to detect when a library embedder is added as a dependency and reconfigures the `SourceFactory` appropriately.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1653733002 .
2016-02-09 09:39:59 -08:00
pq 9b1fa223a8 Embedded libs key rename to defuse server landmine.
1.13 stable builds of the SDK contain a version of server that fails catastrophically when analyzing source that imports packages that define embedded libraries. Since we can't pragmatically require more recent SDKs for flutter development we have been prevented from landing embedded libs in the flutter engine.  By renaming the key we use to identify contributed libraries, this change avoids the issue.  Old versions of server will simply ignore the new key and new ones will process it properly.  Win-win!

BUG=
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1643023002 .
2016-01-29 09:52:04 -08:00
danrubel d486870787 * fixes embedder bugs on Windows
* updates embedder tests to properly test Windows

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1612393002 .
2016-01-28 10:50:57 -05:00
danrubel 0e3416fffe fix embedder url mapping on Windows
see https://github.com/dart-lang/sdk/issues/25498

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1600933007 .
2016-01-21 09:56:42 -08:00
Dan Rubel 1ef8fc8cec simplify EmbedderUrlResolver
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1596693002 .
2016-01-15 21:21:11 -05:00
danrubel ebd1736c58 Add EmbedderSdk to EmbedderUriResolver
R=brianwilkerson@google.com, johnmccutchan@google.com, pquitslund@google.com

Review URL: https://codereview.chromium.org/1584663006 .
2016-01-14 14:51:43 -05:00
pq 34780784f2 Error code validation updates.
Updates validation to handle configured severities (`error`, `info`, and `warning`).

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1541453002 .
2015-12-18 12:58:25 -08:00
pq 62656833d4 Wraps up the server-side of the 'Allow a user to configure which hints are "fatal"' ask (#24452).
* migrates error filtering from a predicate to a process that can customize severities.
* moves filtering/processing from the `dart` task into the `getErrors` request and the errors notification.

See: https://github.com/dart-lang/sdk/issues/24452

(Pending a thumbs-up, support for CLI to follow.)

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1517723002 .
2015-12-10 13:35:11 -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
Konstantin Shcheglov ac24bd115c Don't run 'pub list-package-dirs' if there is no pubpsec.lock file.
This should help on DAS startup - if we don't have to run Pub, this saves as much as 400ms for each pubspec.yaml file.
Without pubspec.yaml we won't get any results anyway.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1470793002 .
2015-11-23 09:19:10 -08:00
John McCutchan bb4d547a5d Add _embedder.yaml support to analyzer and analysis_server
- If a package has an '_embedder.yaml'  file with an 'embedder_libs' key two things happen:
  1) We do not use the DartUriResolver to resolve dart: libraries.
  2) We use the EmbedderUriResolver to resolve all dart: libraries

- If multiple packages have an '_embedder.yaml' file we merge them.
  - This might not be the final behaviour that we want but I'm not sure how to surface errors to the end user.

- The '_embedder.yaml' file has a top level key 'embedder_libs' which is a map from dart: library uri to source path. Other keys are ignored by the EmbedderUriResolver.

- Unit tests for analyzer
- Integration test for analysis_server.

R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1437893003 .
2015-11-16 15:30:17 -08:00
Konstantin Shcheglov 508b70bdab Replace Glob implementation.
This makes MDL analysis another 5% faster.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1452473002 .
2015-11-15 12:17:17 -08:00
pq b0a08827aa Improves options validation type safety (#24885).
Fixes #24885.

https://github.com/dart-lang/sdk/issues/24885

BUG=24885
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1437703003 .
2015-11-12 09:44:25 -08:00
pq 67dc108f39 Map merging.
Basic YAML map merging suitable for merging a default map with an overriding one.

The semantics favor the overrider with a twist to support a short-hand for lists that stand-in for maps of scalars to booleans.  Specifically, lint rules can be enumerated as a list or as a map.  To make this work, lists can be "promoted" to maps.  In particular, if

linter:
  rules:
    - camel_case_types
    - one_member_abstracts

is merged with

linter:
  rules:
    one_member_abstracts: false
    always_specify_return_types: true

the right thing is done to get us to:

linter:
  rules:
    camel_case_types: true
    one_member_abstracts: false
    always_specify_return_types: true

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

Review URL: https://codereview.chromium.org/1425393002 .
2015-11-03 10:42:18 -08:00
pq ffeacec73d Improved YAML doc exception handling.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1415153004 .
2015-10-28 11:24:42 -07:00
pq 6c85fe785a Analysis Options error notifications.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1411013003 .
2015-10-21 09:59:19 -07:00
pq bf0ba96027 Analysis Options processing task and manager.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1413973003 .
2015-10-20 15:38:55 -07:00