Commit Graph

251 Commits

Author SHA1 Message Date
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
Brian Wilkerson 1a9cafd85c Replace uses of FileBasedSource in cli
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2257023002 .
2016-08-18 06:11:28 -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
Paul Berry 902ce5e739 Record information about a summary's dependencies in the summary itself.
The idea is that we can use this information to help discover related
summary files, and determine when summaries need to be re-linked.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2226093002 .
2016-08-09 09:31:04 -07:00
Konstantin Shcheglov 43fef756ae Provide LINE_INFO from ResynthesizerResultProvider.
Also, to guarantee that LINE_INFO is computed, we need to replace
context.getLineInfo() with context.computeLineInfo() in the server.
This should be equivalently fast in both summary (from provider) and
non-summary cases (the source should have been scanned and parsed in
order to resolve references to its elements).

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2225893003 .
2016-08-09 09:12:24 -07:00
Konstantin Shcheglov b3588f44fe Add line starts into unlinked units.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2223113002 .
2016-08-08 11:40:05 -07:00
Brian Wilkerson b47d35d706 Clean up use of resource provider in cli
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2212813003 .
2016-08-04 12:31:10 -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 f8d7925ff2 Mark analyzer_cli as strong-mode clean
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2196393003 .
2016-08-01 12:44:59 -07:00
John Messerly 4b3c06f3c5 add no-implicit-casts and no-implicit-dynamic options
* adds these to dartanalyzer command line
* adds them to .analysis_options

R=leafp@google.com

Review URL: https://codereview.chromium.org/2144383002 .
2016-07-15 16:08:20 -07:00
Brian Wilkerson f14772d8c9 Fix NPE when a resolver provider is given
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/2136083003 .
2016-07-11 13:06:00 -07:00
Paul Berry a35c9415f5 Add option "--build-summary-output-semantic" to analyzer_cli.
This option has the same functionality as the flag
"--build-summary-exclude-informative", except it is an option rather
than a flag.  This makes it possible to get both a "full" summary and a
"semantic" summary by specifying both "--build-summary-output" and
"--build-summary-output-semantic".

The flag "--build-summary-exclude-informative" is kept around to ease in
transitioning tools, but it is deprecated.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2104003004 .
2016-06-29 10:25:50 -07:00
pq 1ec13d1548 Fix pipe escaping.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2109783003 .
2016-06-28 15:17:46 -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
Jaime Wren 7f244c8d39 Deprecate FileUriResolver and RelativeFileUriResolver in source_io.dart, replace the usages with ResourceUriResolver(PhysicalResourceProvider.INSTANCE).
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2060263006 .
2016-06-16 11:14:03 -07:00
Brian Wilkerson 34a71429d9 Remove hook for setting a provider for an EmbedderUriResolver
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/2075663002 .
2016-06-16 10:28:40 -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
Konstantin Shcheglov e2cb8df046 Compact incremental cache when we're done using it.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2064613004 .
2016-06-13 13:25:03 -07:00
Konstantin Shcheglov 6d49c787dc Stop tracking cache dependencies in analyzer_cli.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2058253002 .
2016-06-10 14:29:34 -07:00
Konstantin Shcheglov 676a9f7d60 Compute IGNORE_INFO and filter DART_ERRORS.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2048713002 .
2016-06-07 09:56:14 -07:00
Konstantin Shcheglov 1074d44c65 Serve DART_ERRORS from incremental cache.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2045793003 .
2016-06-06 20:25:33 -07:00
Konstantin Shcheglov a42317f2de Serve INCLUDED_PARTS from incremental cache.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2044513003 .
2016-06-06 16:00:37 -07:00
Konstantin Shcheglov e87a9c955c Start adding experimental incremental analysis mode into CLI analyzer.
At the moment it is not very useful, because it does not use or store
errors from incremental cache yet. But I hope to implement this soon.

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

Review URL: https://codereview.chromium.org/2039773004 .
2016-06-06 11:35:55 -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 ff857f1b71 CLI cleanup.
A little linting.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1986943002 .
2016-05-18 10:30:09 -07:00
Konstantin Shcheglov 34d5d4f55c When in strong mode, analyze with dart2js paths.
This would correspond to the code in build_sdk_summaries.dart, which
creates strong mode summaries.

R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/26466

Review URL: https://codereview.chromium.org/1988853002 .
2016-05-17 12:20:39 -07:00
pq 31a03ec31b Skip SDK summaries in the presence of SDK extenders (#26448).
Works around crash provoked by mojo: https://github.com/dart-lang/sdk/issues/26448.

The rub is that using SDK summaries in the presence of SDK extenders (and embedders) is unsafe.

Greater context: https://github.com/dart-lang/sdk/issues/26467.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1990463002 .
2016-05-17 11:10:43 -07:00
Konstantin Shcheglov 048d396f1b Fix for analyzer-cli and the new SummaryBasedDartSdk 'strongMode' parameter.
I broke the build :-(

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1979193010 .
2016-05-16 15:03:35 -07:00
pq 7937623063 Don't use SDK summaries with embedders (#26448).
Addresses the issue seen in https://github.com/dart-lang/sdk/issues/26448.

Ultimately we want a better story for summaries in the presence of embedded SDKs; in the short-term this simply disables them.

The trick (and reason for all of the changes here) is that there is *a lot* of temporal coupling in the initiailization of contexts, sdks, resolvers, etc.  With this change, embedder processing is pulled out to where it can be done before the SDK is configured.  Hopefully this even makes this a bit more clear as resolver setup is less complex.

Open question: I think the logic that calls `pub list-dirs` is dead and can safely be removed.  Comments there welcome.

Thanks!

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

Review URL: https://codereview.chromium.org/1984733003 .
2016-05-16 14:13:40 -07:00
Konstantin Shcheglov a4862dd22a Add '--dart-sdk-summary' option to analyzer-cli and use SummaryBasedDartSdk.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1974323003 .
2016-05-13 12:56:09 -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
Jacob MacDonald 6b7139d896 Dont search for the sdk on startup in worker mode
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1974993002 .
2016-05-12 15:07:01 -07:00
Paul Berry 92f5fc8836 Handle missing sources properly when building AST-based summaries.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1966443002 .
2016-05-10 14:15:14 -07:00
pq 7913968725 Fix CLI SDK option config timing (#26129).
Fixes: https://github.com/dart-lang/sdk/issues/26129

The issue was that we were creating the SDK and populating its options (notably `strong-mode`) *before* options processors were called.  The result was that client code analysis contexts and SDK contexts were getting configured differently causing confusion when client code was getting analyzed with a non-strong-mode SDK.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1962403002 .
2016-05-10 13:35:40 -07:00
Konstantin Shcheglov e7b51f7bd1 Issue 26426. Don't use SDK summarie when analyzing SDK itself.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/26426

Review URL: https://codereview.chromium.org/1963023002 .
2016-05-10 09:54:24 -07:00
Paul Berry baa7dac310 Allow zero analyzer args in build mode.
This simplifies the integration with build systems such as Bazel, in
which it is sometimes convenient to have a build unit which depends on
other build units but doesn't introduce any additional source files of
its own.

R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1960263003 .
2016-05-09 12:39:06 -07:00
Konstantin Shcheglov d7f14a639d Turn on using SDK summaries in the command line analyzer.
We pass all of the shared tests now.
We used to pass too, but there was a couple small regressions.
The regressions have been fixed, so if you don't see a reason not to
turn using summaries on, I think we could do this.

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

Review URL: https://codereview.chromium.org/1945013002 .
2016-05-03 15:15:52 -07:00
Paul Berry a8e665eaf5 Don't compute hashes in "--build-summary-exclude-informative" mode.
The hashes were being thrown away anyway; computing them just wastes
time.

Cuts the runtime of generating an AST-based summary of the analyzer
package (with a warm VM) by about 19%.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1910553002 .
2016-04-20 11:04:58 -07:00
Paul Berry 2d1dbd4d5b Sort build_mode.dart.
No functional change; just code motion.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1903053003 .
2016-04-20 10:55:24 -07:00
Paul Berry 48c8d84357 Clear analyzer caches after each persistent worker build step.
Without this, a persistent worker that runs too long will eventually
overflow memory.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1897973005 .
2016-04-19 13:41:53 -07:00
Brian Wilkerson 21a1b757c1 Clean up hints after a new hint was introduced
R=jwren@google.com

Review URL: https://codereview.chromium.org/1890973002 .
2016-04-14 13:15:34 -07:00
Brian Wilkerson 3084ceae83 Clean up flags for conditional directives
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1892523002 .
2016-04-14 11:47:28 -07:00
Jacob MacDonald d2e2241fc1 update to use bazel_worker package
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1885073002 .
2016-04-14 07:46:33 -07:00
Jacob MacDonald 09c6fcebc0 Use the provided dart sdk path in worker mode
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1882373003 .
2016-04-14 07:24:53 -07:00
Paul Berry 2a5db6841b Turn off summaries in context when building summary from AST.
When building summaries from ASTs, we only use the context to read
source files; we don't need it to provide an element model.  Therefore,
we can save some time by turning off the context's use of summaries,
because this prevents it from trying to eagerly deserialize the
summaries of dart:async and dart:core.

Saves a significant amount of time when building a summary of a small
package using ASTs.  For example, saves ~37% of time when building a
strong mode summary of the "yaml" package.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1882263002 .
2016-04-14 05:59:01 -07:00
Konstantin Shcheglov bc54ea8c23 Disable computing errors for .pub-cache sources.
R=brianwilkerson@google.com, pquitslund@google.com
BUG=

Review URL: https://codereview.chromium.org/1888583002 .
2016-04-13 17:01:38 -07:00
Paul Berry 3b65dacd6c Modify build mode to use the linker when building summaries from ASTs.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1877133002 .
2016-04-11 17:04:10 -07:00