Commit Graph

470 Commits

Author SHA1 Message Date
Konstantin Shcheglov 455984bbf9 Fix fuzzy arrow warnings in analyzer and analysis_server.
There is one warning which I'd like to fix in a separate CL.

The rest is because of package:test predicate().
I think Leaf fixed it in https://github.com/dart-lang/matcher/commit/3625f13698346576da0f5baf44e95abc9c56fb49


R=brianwilkerson@google.com

Bug:
Change-Id: I060f7ced55dbcc460185916251c47ebbd5c838d3
Reviewed-on: https://dart-review.googlesource.com/3404
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-06 00:26:18 +00:00
Konstantin Shcheglov f78d43c3d3 Convert GeneratedContent to async and use AnalysisDriver for tasks graph.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3002293003 .
2017-08-26 07:51:34 -07:00
Dan Rubel d1385f099f support class native clause
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2996163002 .
2017-08-22 07:42:56 -04:00
Dan Rubel aefd73b8d3 new handleInvalidTopLevelDeclaration event in fasta parser
This adds a new event for better fasta parser recovery
when the parser detects an invalid character at the top level.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2985703002 .
2017-08-16 09:36:24 -04:00
Kevin Millikin bae72c382a Fix the script analyzer/tool/generate_files
* The script had stopped working due to a pair of changes in Dart.
  First, building Dart no longer produces a packages directory to use
  as a package-root.

  Second, generated Dart files are now formatted and the formatting
  code relies on invoking Dart from the Dart SDK in order to find
  dartfmt.  (Specifically: invoking Dart from the build directory does
  not work because there is no dartfmt there, and invoking Dart via
  sdk/bin/dart from the SDK repository does not work because it is a
  shell script that invokes Dart from the build directory.)

* Enable the test that the generated summary code has not changed.

* Regenerate the generated summary code.

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

Review-Url: https://codereview.chromium.org/2997703002 .
2017-08-11 12:05:47 +02:00
Paul Berry e2f77056a5 Eliminate dependencies on pkg/front_end.
The API for pkg/front_end is still in flux so we want to avoid having
any packages depend directly on it (other than analyzer and
back-ends).

This CL re-exports some of the critical pieces of front_end needed by
analyzer clients so that those clients can access them via analyzer,
without having to directly depend on front_end.  It also updates
pkg/analyzer_plugin to make use of those re-exports.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2993123002 .
2017-08-07 09:46:30 -07:00
Peter von der Ahé 3216bda008 Move parser helper classes to own files and clean them up.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2978063002 .
2017-07-18 13:02:41 +02:00
Dan Rubel 14b76d6b22 cleanup fasta parser send and expression events
* remove unused beginSend
* rename endSend to handleSend

* remove unused beginThrowExpression
* remove unused beginExpression event
* rename endThrowExpression to handleThrowExpression

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

Review-Url: https://codereview.chromium.org/2976103002 .
2017-07-14 10:20:01 -04:00
Peter von der Ahé 710ddf02ff Remove all deprecated fasta message methods from analyzer.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2975823002 .
2017-07-11 09:26:27 +02:00
Peter von der Ahé b023d925ea Use FastaMessage instead of String. Part 1.
See #30080.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2965393002 .
2017-07-10 19:50:14 +02:00
Peter von der Ahé 9236a3445e Deprecate all diagnostics methods that use strings.
See #30080.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2970273004 .
2017-07-10 11:23:09 +02:00
Brian Wilkerson 62d0376231 Run the sorter to reduce code churn
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933753002 .
2017-06-12 07:37:14 -07:00
Peter von der Ahé 61d855bb47 Prepare for development branch by updating externally-used API.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2898183002 .
2017-05-24 14:32:45 +02:00
Peter von der Ahé 6e0fd8ebb2 Update mini_ast.dart to new Listener interface.
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2896573002 .
2017-05-19 14:10:52 +02:00
Dan Rubel 278c7bfbeb merge fasta.Token into analyzer.Token
This eliminates much of the duplication between the two token hierarchies
by merging much of the fasta.Token hierarchy into the analyzer.Token.

* merge token hierarchies
* cleanup fasta.Token.copy()
* set preceedingComments field via constructor
* replace isBuiltInIdentifier --> type.isBuiltIn
* change all fasta.Token references to analyzer.Token
* move fasta.Token.value() implementation into analyzer.SimpleToken

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2890523002 .
2017-05-16 11:50:14 -04:00
Konstantin Shcheglov 02cb71685e Move flat_buffer and api_signature into front_end.
I will need to use these in front_end to store precomputed information
and computing combined signatures.

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

Review-Url: https://codereview.chromium.org/2875373002 .
2017-05-12 10:48:28 -07:00
Dan Rubel 81d25f4c71 more work aligning fasta.Token with analyzer.Token
* move isPseudo getter out of Token into TokenType
* move special case charCount logic out of fasta.Token into fasta.ErrorToken
* move more accessors from fasta.Token into analyzer.Token
* add @overrides to denote which methods have been declared in analyzer.Token
* make fasta LazySubstring and its subclasses private
* rename fasta.previousToken to previous to match analyzer.Token
* flatten fasta.Token.preceedingCommentTokens into preceedingComments
* normalize fasta.Token.next and analyzer.Token.next

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2872433005 .
2017-05-09 00:09:56 -04:00
Konstantin Shcheglov c21653c0c4 Regenerate the tasks graph.
TBR

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2837713002 .
2017-04-21 21:21:57 -07:00
Paul Berry 77d26a330c Add top level type inference logic for integer literals.
This CL hooks up enough infrastructure for doing simple top level type
inference of variables whose initializer is an int.

Additional type inference rules will be added in follow-up CLs.

R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2828253003 .
2017-04-21 04:38:18 -07:00
Konstantin Shcheglov d5521a52b2 Add a tool for inspecting AnalysisDriver crash logs.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2809693002 .
2017-04-10 09:11:27 -07:00
Dan Rubel 80c8479587 fasta.CommentToken implement analyzer.CommentToken
* update the fasta scanner to generate comment and dartdoc tokens

* replace fasta.preceedingComments field
  with preceedingCommentTokens field and preceedingComments getter/setter

* update token translator

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2763833002 .
2017-03-21 11:40:47 -04:00
Jens Johansen 4d208e2ffb [fasta] Add and correct even more offsets
E.g. kernel debugging of async functions should now work.

BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2746013003 .
2017-03-21 10:57:30 +01:00
pq 09886f491f Remove unneeded strong_mode_down_cast_composite ignores.
As `strong_mode_down_cast_composite` is now a strong-mode hint these should no longer need to be explicitly ignored.

Follow-up from: https://github.com/flutter/flutter/pull/8853

BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2755013003 .
2017-03-17 12:32:59 -07:00
Paul Berry c78b4d66bb Move some of analyzer's code generation utilities into front_end.
These utilities are needed for generating the code that supports
summaries; in order to move summary logic into front_end, we will need
these code generation tools in front_end as well.

Also make a minor change to summary code generation logic so that it
talks to the file system directly rather than depending on analyzer's
file system abstraction.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2742333005 .
2017-03-14 12:30:18 -07:00
Paul Berry 2457a79b48 Change summary code generator to use Fasta parser.
The end goal is to move summary logic to the front end, which means
that it won't be able to depend on analyzer.  This removes a key
dependency on analyzer (the dependency of the code generator on the
analyzer parser).

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2748803003 .
2017-03-14 10:36:45 -07:00
Konstantin Shcheglov 3ba8c2df3d Regenerate the task graph.
TBR

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2698703002 .
2017-02-15 10:46:04 -08:00
Konstantin Shcheglov ea72cbf830 Don't use Element.computeNode() in tasks graph generator.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2678693002 .
2017-02-06 06:53:01 -08:00
Paul Berry ab6e74cb1c Regenerate task_dependency_graph after 914a117649
TBR=scheglov@google.com

Review-Url: https://codereview.chromium.org/2631683002 .
2017-01-13 04:17:32 -08:00
Brian Wilkerson 22f561e914 Reapply "Add support for generic function type syntax, part 1"
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2622303006 .
2017-01-11 14:10:05 -08:00
Brian Wilkerson 85b1e7abbe Revert "Add support for generic function type syntax, part 1"
Review-Url: https://codereview.chromium.org/2624283003 .
2017-01-11 13:30:52 -08:00
Brian Wilkerson 1cd918533d Add support for generic function type syntax, part 1
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2613383003 .
2017-01-11 13:12:10 -08:00
Brian Wilkerson 96750cd5cb Split out options from ContextBuilder
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2425423009 .
2016-10-20 11:03:11 -07:00
William Hesse 92cd3e10f5 Fix test.py and tests to use an explicit --packages flag.
BUG=https://github.com/dart-lang/sdk/issues/27412
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2361813003 .
2016-09-22 17:51:09 +02:00
Paul Berry e77187ff6d Fix pkg/analyzer/tool/task_dependency_graph/check_test.
This was broken by the move to ".packages" files.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2351833002 .
2016-09-19 12:07:54 -07:00
Konstantin Shcheglov fa24d1caaa Stop generating index information for SDK and simplify summary generation.
The implementation is still element model based, I will switch it to
the AST based approach in a following CL.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2345793002 .
2016-09-15 16:15:20 -07: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
Konstantin Shcheglov 35bf41691e Change summaries setter generation to allow properties named 'value'.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2339053002 .
2016-09-15 07:08:38 -07:00
Konstantin Shcheglov 663a3e810c Reapply abc5051854: Remove 'Element.docRange'.
I also marked the corresponding information in summaries as @deprecated
and made a small tweak to the generator so that it knows that the ids
of deprecated fields are still used.

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

Review URL: https://codereview.chromium.org/2330813002 .
2016-09-11 09:41:53 -07:00
Brian Wilkerson fa1b80fd82 Remove references to deprecated code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2331743002 .
2016-09-10 11:28:43 -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
Brian Wilkerson e5d10ceed6 Roll back changes that broke the bots (TBR)
Review URL: https://codereview.chromium.org/2319143003 .
2016-09-07 14:07:54 -07:00
Brian Wilkerson 771d296a6c Remove final references to PackageUriResolver
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2320733003 .
2016-09-07 13:03:19 -07:00
pq b7f0ce083b Revert "Remove 'Element.docRange'."
This reverts commit abc5051854.

Background: required to keep `analyzer` version-compatible with `test`.

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

Review URL: https://codereview.chromium.org/2293143003 .
2016-08-30 13:10:15 -07:00
Konstantin Shcheglov 09b851c97f Don't perform final fields and top-level variables type propagation.
A similar feature is now implemented in strong mode, and users who
need it, should switch to strong mode.

When we are ready to drop propagated types altogethoer, we could
deprecate or remove UnlinkedVariable.propagatedTypeSlot in IDL.

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

Review URL: https://codereview.chromium.org/2288223003 .
2016-08-29 15:18:12 -07:00
Konstantin Shcheglov abc5051854 Remove 'Element.docRange'.
I also marked the corresponding information in summaries as @deprecated
and made a small tweak to the generator so that it knows that the ids
of deprecated fields are still used.

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

Review URL: https://codereview.chromium.org/2270903002 .
2016-08-24 09:40:23 -07:00
Paul Berry e31e7757d5 Move summary inspection code out of pkg/analyzer/lib.
It depends on mirrors, which aren't supported by Flutter.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2257563002 .
2016-08-17 12:15:16 -07:00
Paul Berry 052a6c867d Fix summary handling of unresolved imports, exports, and parts.
Previously this was working for a few use cases by dumb luck, but it
wasn't well tested and became broken by
b29c6bf330.  This CL fixes it for real
and adds tests to verify the fix.

Note that there is a change to how we represent an unresolved
import/export: instead of storing a URI_EXISTS modifier in the element
model, we simply mark the imported library element as synthetic.
(This library element existed anyway; we just weren't marking it as
synthetic).  This makes it easy to tie in with summaries, since it is
easy for the resynthesizer to detect that the library doesn't exist at
the time the library handle is resolved.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2235373003 .
2016-08-12 13:59:51 -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
Konstantin Shcheglov 296d81f60a Issue 27053. Record errors in InferStaticVariableTypeTask and include them into unit errors.
R=brianwilkerson@google.com, jmesserly@google.com
BUG=

Review URL: https://codereview.chromium.org/2239613002 .
2016-08-11 09:10:31 -07:00
Konstantin Shcheglov 6df5ea27a5 Revert 6ad38498c8 (PARSED_UNIT).
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2231473002 .
2016-08-09 10:14:18 -07:00