Commit Graph

7128 Commits

Author SHA1 Message Date
paulberry@google.com cf991d72b6 Add missing overrides to AnalysisContext-derived classes.
TBR=jwren@google.com

Review URL: https://codereview.chromium.org//980073007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44378 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-10 16:30:31 +00:00
scheglov@google.com 339476c61f Wrap dart:io exception in getChildren(), implement for the memory FS.
...for consistency.

Plus tests.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//989393002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44358 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-10 04:30:56 +00:00
scheglov@google.com d81d792c14 Implement 'node' for ClassElement and FieldElement for enums.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//987263002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44356 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-10 03:07:05 +00:00
brianwilkerson@google.com d954183441 Change all sources associated with changed files (issue 22680)
R=paulberry@google.com

Review URL: https://codereview.chromium.org//981283003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44335 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 18:28:21 +00:00
scheglov@google.com 95cc373a87 Test for computing task inputs before performing task itself.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//990773002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44313 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 00:41:06 +00:00
scheglov@google.com 24c14e7f2e Test for GetContentTask.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//988993002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44310 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-07 17:25:18 +00:00
scheglov@google.com 5b19f0a625 Add CacheEntry.setErrorState().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//988883004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44309 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-07 17:01:26 +00:00
scheglov@google.com cf2f5bc3f5 Disable incremental resolution of comments outside function bodies.
It causes disappearing of semantic highlighting and navigation for the first
node after a just added comment.

Unfortunately there is no easy way to add/remove comment tokens.
We can replace tokens, but we need also to replace tokens in nodes.
Given that we are in a cherry picking season, let's implement the simplest correct solution.

R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=22644

Review URL: https://codereview.chromium.org//982243002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44295 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-06 16:53:24 +00:00
brianwilkerson@google.com ab1d3ad17c Better recovery (issue 22693)
R=scheglov@google.com

Review URL: https://codereview.chromium.org//987633002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44290 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-06 14:11:24 +00:00
brianwilkerson@google.com 9004e91fec No errors in third-party packages (issue 22170)
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//983733002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44270 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-05 20:17:24 +00:00
scheglov@google.com 7d95442c32 Expose 'typeProvider' from AnalysisContext.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//965393004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44245 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-04 19:09:27 +00:00
scheglov@google.com 2ee5ca1091 Issue 22644. Fix for removing non-Dartdoc comments before a declaration.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=22644

Review URL: https://codereview.chromium.org//980513002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44237 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-04 14:42:23 +00:00
paulberry@google.com c867649e4a Don't define parameters when visiting a function-typed formal parameter.
BUG=dartbug.com/13179
R=scheglov@google.com

Review URL: https://codereview.chromium.org//978633003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44212 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-04 00:39:14 +00:00
scheglov@google.com cbfec08aa9 Replace using unconditional _recordPropagatedType() with a conditional _recordPropagatedTypeIfBetter().
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//974033002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44204 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 22:06:00 +00:00
brianwilkerson@google.com d1ac25879b First cut at analysis driver
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//913483002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44199 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 21:24:25 +00:00
scheglov@google.com 2112b929ca Don't set a propagate type if the variable has already the same static type.
This fixes displaying both "Static type" and "Propagated type" sections in UI.

Maybe also some performance improvement because of avoiding resolving propagated elements.

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

Review URL: https://codereview.chromium.org//971193003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44184 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-03 17:39:02 +00:00
brianwilkerson@google.com 98b7382071 Reformat
R=paulberry@google.com

Review URL: https://codereview.chromium.org//975453004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44149 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 21:34:46 +00:00
paulberry@google.com 7f13f31ab0 Avoid unnecessary parsing/resolution when running command line analyzer.
By default, the command-line analyzer doesn't show errors, warnings,
or hints for the SDK or for files imported via "package:" URI's.
Accordingly, it shouldn't be necessary to parse or resolve function
bodies in those files.

This can save a substantial amount of time when analyzing files that
are part of large applications.  For example, analysis time of
pkg/analyzer/bin/anaylzer.dart goes down from ~6.5 seconds to ~3.5
seconds.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//967703002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44143 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 19:38:44 +00:00
paulberry@google.com 45b7294eff Don't do folder existence checks when parsing pub list results.
It's just a waste of time since we already to folder existence checks
when resolving package URI's.  Besides, all the folders output by pub
list should always exist except in pathological situations.

Improves total analysis time by about 2%.

R=danrubel@google.com

Review URL: https://codereview.chromium.org//952333002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44137 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 18:28:22 +00:00
brianwilkerson@google.com 268cd8bab2 API clean-up
R=scheglov@google.com

Review URL: https://codereview.chromium.org//970913002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44134 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 17:28:37 +00:00
brianwilkerson@google.com 05b314197e Fix for issue 22594
R=scheglov@google.com

Review URL: https://codereview.chromium.org//965093003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44113 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-28 04:31:48 +00:00
scheglov@google.com 1a7ac64ae2 Don't remove indexing operations on potential source changes.
This covers the following scenario:

1. User performs an undo operation in a save editor.

2. Editor updates the file buffer, so sends 'add overlay'.
   Server performs an incremental analysis and schedules an 'analyze' operation.

3. The 'analyze' operation runs and schedules 'index' operation.

4. Editor saves the file buffer.
   Editor sends 'remove overlay command'.
   Server removes all the scheduled notification and index operations for the file.
   Server notices that there is no real change for the file, so the is nothing to do.
   But it still reschedules notifications, because the client might have lost some information.

5. Notifications are resent, but indexing is not performed.

  So, the solution is to reschedule indexing operation.

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

Review URL: https://codereview.chromium.org//958373003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44111 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-28 01:34:56 +00:00
paulberry@google.com c2640607ca Fix "unimplemented method" warnings introduced by r44071.
TBR=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//966513002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44081 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 23:19:24 +00:00
scheglov@google.com 8655d606da Fix for the change/save/undo race condition.
As we found out, it is not safe to compare file modification times.
On some OSs, such as OSX with its HFS+ file modification time accuracy is just 1 second,
and it is quite possible that a file is modified more than once in 1 second.

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

Review URL: https://codereview.chromium.org//961823004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44080 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 22:32:49 +00:00
danrubel@google.com 6a90488fc8 cache pub list results
BUG=
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//941883002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44062 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-26 17:24:08 +00:00
paulberry@google.com 88e19fcb6e When converting files to package URI's, favor longer directory matches.
Longer directory matches in mean that the relative path part of
the package URI will be shorter, making it more likely to match
user intent.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//953863004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44025 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-25 18:04:09 +00:00
paulberry@google.com 2b6e5b5f68 When translating from file to URI, make sure translation is reversible.
BUG=dartbug.com/22555
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//935453007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44003 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-24 22:15:39 +00:00
scheglov@google.com 279bdb7ec0 Add File.modificationStamp accessor.
Dan, I noticed that you're using createSource().modification stamp to access this information.
So, we need a more direct way to get it.

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

Review URL: https://codereview.chromium.org//940313003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43968 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-23 18:40:09 +00:00
brianwilkerson@google.com 54bf758021 Fix issue 22525
R=scheglov@google.com

Review URL: https://codereview.chromium.org//950613003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43960 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-23 16:16:49 +00:00
sigmund@google.com f2ccdbd73d Minor changes in analyzer to make it easier to extend
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//924943010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43934 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-20 22:23:27 +00:00
scheglov@google.com 4da5931086 Fix for filtering unknown options.
R=brianwilkerson@google.com, jwren@google.com
BUG=

Review URL: https://codereview.chromium.org//944073003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43933 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-20 22:12:03 +00:00
jwren@google.com bbc11c6640 Add ignore-unrecognized-flags as an option to the command line options of analysis server
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//940093003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43920 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-20 17:19:53 +00:00
paulberry@google.com c845e7cd9a Change equality comparison for FileBasedSource to use URI.
Previously, we considered two FileBasedSources to be equal if they
referred to the same file.  As a result, if a given file was
accessible via multiple URI's, only one cache entry would be created
for the file and we would only resolve it once; the elements created
by resolution would be nondeterministic, they would refer to the file
via whatever source happened to be used to analyze it first.  Worse
yet, incremental analysis might cause some of the elements in the file
to later be replaced by elements that would refer to the file via a
different source, resulting in confusing errors.

BUG=dartbug.com/22030
R=scheglov@google.com

Review URL: https://codereview.chromium.org//944493002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43888 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 19:15:50 +00:00
scheglov@google.com 4e7ecb1103 Issue 22409. Restore recognizing string concatenation in const expressions.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=22409
     https://code.google.com/p/dart/issues/detail?id=21000

Review URL: https://codereview.chromium.org//940853002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43879 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 15:35:54 +00:00
brianwilkerson@google.com 0e73ada9c2 Use package: URIs for files in lib
R=paulberry@google.com

Review URL: https://codereview.chromium.org//914373004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43827 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-17 22:47:34 +00:00
scheglov@google.com d305f5225d Constant top-level variables should not have setters.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//930703002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43793 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-16 05:36:13 +00:00
zra@google.com 74245deeac Adds a repeatable --url_mapping flag to dartanalyzer
If a Dart file does an import that is 'strange', this flag
allows the imported URI to be understood by the analyzer
so long as an explicit mapping of the URI to an absolute
path to a .dart file is supplied with this flag.

For example, a custom embedding of the Dart VM may refer
to non-SDK libraries through its own URI scheme, e.g.

import 'strange:things';

With the flag and Uri resolver added in this CL, the
analyzer can find the Dart source for 'strange:things':

dartanalyzer ... --url_mapping 'strange:things,/path/to/strange/things.dart'

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//897593005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43788 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-14 07:19:15 +00:00
brianwilkerson@google.com d7a69a2912 Flush entries for unreferenced sources
R=scheglov@google.com

Review URL: https://codereview.chromium.org//924563002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43730 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 17:50:40 +00:00
scheglov@google.com 303d94e89d Add SourceEntry.CONTENT_ERRORS data descriptor.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//914283002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43698 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 21:04:18 +00:00
scheglov@google.com 84655a3ad3 Report an error on Dart Source reading exception.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//909373003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43694 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 18:22:27 +00:00
scheglov@google.com 9aaa9a6a99 Use ExitDetector.exists(node).
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//912023002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43668 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 20:46:47 +00:00
paulberry@google.com acaed71dba Clean up analyzer and analysis server hints.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//908283002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43667 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 20:40:26 +00:00
paulberry@google.com 6a869d5e34 Fix inference of the static type of an async function literal.
This implements the spec change currently under review here:
https://codereview.chromium.org/902703003

R=scheglov@google.com

Review URL: https://codereview.chromium.org//905293003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43613 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 21:21:36 +00:00
scheglov@google.com d7a2309a92 Fix for incremental resolution in case of inserting a new token into elegant comments.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//913573002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43607 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 19:12:04 +00:00
brianwilkerson@google.com d682527d1e Fix a stack overflow
R=scheglov@google.com

Review URL: https://codereview.chromium.org//908603002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43559 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 18:00:16 +00:00
paulberry@google.com cb0f691bb6 Fix analyzer type checking of "await" expressions.
This requires implementing the "flatten()" rule defined in the spec;
this rule also needs to be applied to static type checking of return
types in async functions.

BUG=dartbug.com/22291, dartbug.com/22293
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//904743003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43537 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 03:32:57 +00:00
pquitslund@google.com ac08a9a570 Async/await/yield[*] support for dart_fmt
R=brianwilkerson@google.com, paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//882233004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43529 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 22:37:23 +00:00
scheglov@google.com 3713a9eed7 Invalidate hints instead of computing them in the incremental resolver.
So, we don't need to prepare all the library parts before incremental resolution.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//901713004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43526 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 22:06:48 +00:00
scheglov@google.com ae2e608ff9 Send notificatinos after no-op changes.
This should solve the problem when client remove some part of the code,
so removes also error markers for it, and then quickly restores it,
so for the server it looks as an empty/no-op change. But information is
lost, and the server should resend it to the client.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//899753004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43521 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 20:42:17 +00:00
pquitslund@google.com f6da9b87c4 Enum handling for dart_fmt.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org//901743002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43494 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 03:38:15 +00:00