Commit Graph

8489 Commits

Author SHA1 Message Date
John Messerly 4c44096bf6 move TypeSystem classes to their own file
also sorted members per analyzer style (?)

figured it would be easier to work on as a 0.5k file vs ~15k resolver.dart :)

For now I left TypeProvider where it was. Not sure if it should move here or into its own file as well.

For backwards compat, all of the types are re-exported from resolver.dart.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1407923009 .
2015-11-03 11:38:34 -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
Paul Berry cebb0dfb91 Refactor code for checking that generated files are up to date.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1430723002 .
2015-11-02 10:46:23 -08:00
Brian Wilkerson 323ce5d693 Fix null pointer (issue 24790)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1426943005 .
2015-11-02 08:05:07 -08:00
Brian Wilkerson e37a7bddfc Remove unused support for disabling error messages
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1424793008 .
2015-10-31 08:53:40 -07:00
pq fc78375928 More error codes.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1421953003 .
2015-10-30 08:28:59 -07:00
Konstantin Shcheglov 1bc7f93009 Adding a not explicit source makes it explicit.
When we add a new file in IDEA and open it in the editor, this causes
analysis.setSubscriptions to be send immediately, even before watcher
notices it. The server reacts by requesting the fully resolved unit, and
so causes creation of a not-explicit CacheEntry. So, when later we handle
applyChanges(), the entry already exists. In this case we still need to
mark it as explicit.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1411243010 .
2015-10-30 08:04:27 -07:00
pq af7017e585 Option support for enableSuperMixins (and more).
* Adds language configuration support to `.analysis_options`:

  analyzer:
    language:
      enableSuperMixins: true

  (with validation).

* Extracts context configuration out of `server` context_manager and into `analyzer` where it can be re-used by `analyzer_cli`.
* Some general cleanup of option validation (with more to come!)

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1423333002 .
2015-10-29 14:11:26 -07:00
Brian Wilkerson a7f2f5b4e1 Revert "Compute propagated type for final instance fields (partially addresses issue 23001)"
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1428803004 .
2015-10-29 14:02:38 -07:00
Brian Wilkerson 677d4b5bbc Compute documentation offsets for library, import, and export directive elements (issue 24756)
R=keertip@google.com

Review URL: https://codereview.chromium.org/1427513003 .
2015-10-29 14:00:02 -07:00
Konstantin Shcheglov 851dc4ea97 Quick Fix for CAN_BE_NULL_AFTER_NULL_AWARE.
Also fix for false positive :-(

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1423993005 .
2015-10-29 13:47:17 -07:00
Paul Berry 06ef697a0b Rework codegen tools to avoid relying on CWD; integrate with task model graph.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1428673004 .
2015-10-29 13:12:44 -07:00
John Messerly 36b471a638 fix type annotation in _lookUpMemberInInterfaces
Review URL: https://codereview.chromium.org/1426083002 .
2015-10-29 12:08:33 -07:00
Brian Wilkerson 8e80648c56 Compute propagated type for final instance fields (partially addresses issue 23001)
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1410493006 .
2015-10-29 11:36:11 -07:00
John Messerly 2503cb8eeb improve static type analysis for await for
This tries to do a full fix for https://github.com/dart-lang/sdk/issues/24191

The refactoring tries to unify how generic type substitutions are handled, so they always go through the (correct) mechanisms in the Element model.

This additionally should make it easier to add generic method type parameters in a future CL.

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

Review URL: https://codereview.chromium.org/1405143006 .
2015-10-29 11:17:18 -07:00
Konstantin Shcheglov 2529e684f0 Report hint when target of an invocation uses '?.', so can be null.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1423623005 .
2015-10-28 16:45:19 -07:00
pq 5accd7a72e Error code validation for error filters.
Screenshots and background can be found on the tracking bug: https://github.com/dart-lang/sdk/issues/24618

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

Review URL: https://codereview.chromium.org/1411053003 .
2015-10-28 16:37:34 -07:00
Konstantin Shcheglov 8f94e36a74 Check for potential null operand in Not expressions.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1427783003 .
2015-10-28 13:09:30 -07:00
pq ff08fe58b6 Stop unwanted sharing between filter closures.
BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1414863004 .
2015-10-28 13:02:28 -07: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 2f9c4af993 Error Suppression FTW.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1420363005 .
2015-10-28 09:59:05 -07:00
Brian Wilkerson c687f29555 Add hint for use of ?. in conditions (issue 24649)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1422813003 .
2015-10-28 08:28:42 -07:00
Konstantin Shcheglov c095ba1f91 Extract 'computeLineStarts' utility.
R=brianwilkerson@google.com, pquitslund@google.com
BUG=

Review URL: https://codereview.chromium.org/1411253007 .
2015-10-27 14:03:44 -07:00
Konstantin Shcheglov cee3f13ae0 Fix for leaking AnalysisCache and AnalysisContext instances.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1426843002 .
2015-10-27 11:43:05 -07:00
Konstantin Shcheglov e2f905e11d Memory leak fix. Use correct analysis context for annotation constants.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1410573005 .
2015-10-27 11:04:27 -07:00
pq c4ccdb462a LineInfo line-end detection fixes.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1413783005 .
2015-10-27 09:39:30 -07:00
pq 808f32d61d Fix to give LineInfo to options error spans.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1417363007 .
2015-10-26 21:09:48 -07:00
pq 68dc36a3e7 OptionsValidator plugin extension and linter service.
* Adds a new extension point to allow for contributing OptionsValidators.
* Adds a new linter 'service' to server that contributes a lint-aware validator.

You'll notice that the warning code I added is NOT in `errors.dart`.  I did that in anticipation of plugin-specifc warnings living elsewhere.  If that's not the right angle, happy to un-do!

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1418333002 .
2015-10-26 08:50:55 -07:00
Konstantin Shcheglov 2d8d0e1ed7 Clean up - remove unused inputs and tweak comments.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1419363002 .
2015-10-24 20:18:45 -07:00
John Messerly 396ed51cf0 fixes #24713, remove old generic substitution code in _getTypeOfProperty
it looks like some old code was hanging around that tried to substitute generic type parameters by name. This is unnecessary because we already have a substituted type at this point, and the type variable we were substituting had no relationship at all with the parameter. After removing the code, all tests seem to be passing.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1409143009 .
2015-10-24 12:48:53 -07:00
Konstantin Shcheglov c43f292dd9 Remove IMPORT_EXPORT_SOURCE_CLOSURE and IS_CLIENT results.
This improves warm VM analysis time (i.e. 99% of all analyzis that happens in IDEs) from 7200 ms to 6600 ms.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1417143003 .
2015-10-24 08:35:26 -07:00
Konstantin Shcheglov 4653d9bb76 Replace some LIBRARY_ELEMENTx dependency for closure with READY_LIBRARY_ELEMENTx.
This helps to improve analysis time from about 39100 to 37000 ms.

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

Review URL: https://codereview.chromium.org/1406923006 .
2015-10-23 14:56:25 -07:00
keertip c133bf9467 add work item info to context status page
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1415503006 .
2015-10-23 13:27:10 -07:00
Konstantin Shcheglov 041e61a0f6 Ensure that RESOLVED_UNITx ready once for every library.
...instead of ensuring this separately for complete closures of every library.

This improves initial analysis performance from about 44 seconds to 39.
This also makes WorkOrder.moveNext less expensive - to about 5.6% during initial analysis.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1412273004 .
2015-10-23 13:25:56 -07:00
pq d12abed5d7 Last performed task diagnostics.
Adds a new block of status that reports the last 10 performed tasks.

For example:

<p>Recent Tasks</p>
GatherUsedLocalElementsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GatherUsedImportedElementsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GenerateHintsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GenerateLintsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

VerifyUnitTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

LibraryUnitErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

DartErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

LibraryErrorsReadyTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GetContentTask for source /Users/pquitslund/src/git/clones/analyzer_cli/.analysis_options

GenerateOptionsErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/.analysis_options

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

Review URL: https://codereview.chromium.org/1420783004 .
2015-10-23 10:31:26 -07:00
Konstantin Shcheglov 07acac8b8e Compute and display tasks input timings.
It's not perfectly useful - it computes just cumulative timings.
So, it includes not just time for extracting and gathering inputs, but also actual time to compute them.
But it is still useful to compare between runs after changes to tasks inputs, because computing time
should be the same, so the difference is this extracting/gathering time.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1406983007 .
2015-10-23 09:38:24 -07:00
Brian Wilkerson a4a3053afd Backout earlier change to task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1420113004 .
2015-10-23 09:34:15 -07:00
Konstantin Shcheglov f09778528a Use LIBRARY_SPECIFIC_UNITS instead of UNITS.
This reduces number of LibrarySpecificUnit instances from 10,000,000 to about 6,000.
Also this slightly improves the code of corresponding 'buildInputs' methods.

This saves some memory, but unfortunately does not win any performance.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1422793002 .
2015-10-23 08:31:59 -07:00
Brian Wilkerson 763af3d14e Fix the dependencies for constant evaluation
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1403293006 .
2015-10-22 13:52:54 -07:00
Konstantin Shcheglov fe4644e35b Reset AnalysisDriver after changes.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1410813003 .
2015-10-22 13:28:05 -07:00
pq b1215d7718 More options file validation (and API iteration).
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1419673006 .
2015-10-22 13:20:13 -07:00
pq 0881b53a3b Error reporting for spans.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1418973002 .
2015-10-22 08:37:25 -07:00
Konstantin Shcheglov 2586267dbb Keep cache entries for explicitly added sources.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1420613003 .
2015-10-21 20:15:31 -07:00
Paul Berry 9efcce02c3 Begin moving code generation tools from analysis_server to analyzer.
This CL introduces the code generation tools in analyzer, but leaves analysis_server
untouched.  In a later CL, after a new version of analyzer has been
published, I'll refactor analysis_server to point to these tools and
remove the corresponding code from analysis_server.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1411153007 .
2015-10-21 19:41:25 -07:00
pq fb8cc0aa39 Unsupported analysis option validation.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1418533004 .
2015-10-21 14:13:59 -07:00
Brian Wilkerson 63865b5d1b Possible fix for a null-pointer problem
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1408393007 .
2015-10-21 11:10:17 -07:00
Dan Rubel 417161413f Extract internal computeResultAsync method
to be used by the new completion plugin implementation

R=paulberry@google.com

Review URL: https://codereview.chromium.org/1414193003 .
2015-10-21 13:45:23 -04: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
Vijay Menon ba6078197b Fix warnings on implicit casts
R=leafp@google.com

Review URL: https://codereview.chromium.org/1418653003 .
2015-10-20 16:00:21 -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