Commit Graph

306 Commits

Author SHA1 Message Date
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
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
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
brianwilkerson@google.com c7cb9dd4e8 Fix for issue 22110
R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43453 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 01:16:57 +00:00
paulberry@google.com d0b87e247c Implement new "yield*" type checking rules in analyzer.
This updates analyzer to reflect the new static type checking rules
for yield each added in r43420.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43446 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 23:13:09 +00:00
jwren@google.com 032115ecf3 NPE fix in ExitDetector visitor- in analyzer pkg
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43440 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 22:15:18 +00:00
paulberry@google.com 3c315ba0bb Implement new return type checking rules in analyzer.
This updates the analyzer to reflect the new static type checking
rules for return types added in r43420.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43427 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 21:25:12 +00:00
paulberry@google.com 2cd86b7e29 Add static type checking of "yield*" statements to analyzer.
This does not include the new static typing rules that were introduced
in revision 43420.  I will address those in a later CL.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43424 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 20:32:14 +00:00
brianwilkerson@google.com 03ca35e01e Fix for issue 22178
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43422 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 19:30:30 +00:00
paulberry@google.com a3e5ed3347 Add static type checking of "yield" statements to analyzer.
Also fix inference of the return type of generator function expressions.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43418 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 18:51:27 +00:00
brianwilkerson@google.com 25ea0e7ee0 Fix for issue 22245
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43404 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 15:48:39 +00:00
paulberry@google.com fe8ad3584f Fix return type checking for generator functions.
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43403 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 15:43:21 +00:00
scheglov@google.com 61d844224e Match body modifiers in incremental resolver.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43371 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 23:23:09 +00:00
paulberry@google.com bde433f33a Report a compile-time error if async/sync/yield used as an identifier.
This error is only reported inside methods marked "async", "async*",
or "sync*".

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43368 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 23:13:08 +00:00
paulberry@google.com b40a5702b3 Fix async/await type checking in analyzer.
This required making the "async" library into TypeProvider so that we
can create Future<...> types when doing resolution and error/hint
checking.

BUG=21888,22053,22091,22092,22160,22164
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43361 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 20:58:37 +00:00
brianwilkerson@google.com 890c99238c Make source be a target
R=paulberry@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43355 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-02 17:08:28 +00:00
brianwilkerson@google.com cb6c16922f Fix for issue 22052
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43292 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 16:01:58 +00:00
brianwilkerson@google.com fe471e8f02 Make test context more accurate
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43246 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 17:11:38 +00:00
paulberry@google.com ea333d8459 Fix mixin resolution order when multiple mixins present.
BUG=dartbug.com/22069
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43224 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 23:41:21 +00:00
danrubel@google.com 151d7d98b4 fix warning
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43196 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 17:42:51 +00:00
paulberry@google.com 69f751fc6e Fix warnings introduced in r43163.
TBR=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43164 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 00:14:07 +00:00
paulberry@google.com 7bf029506d Fix "reanalyze sources" when there are unsaved files.
The analysis server now maintains a single content cache which is
shared by all contexts; this allows it to persist the content cache
across reanalysis (which destroys all contexts and recreates them from
scratch).

Two other bugs are fixed in the process:

- If a file is analyzed in multiple contexts, then editing it will
  cause all affected contexts to be notified of the change.  (Note
  that this could potentially account for some other strange behaviors
  we've seen recently, such as incorrect semantic highlighting and
  lingering errors/warnings.)

- If the client supplies a ChangeContentOverlay for a file which
  currently has no overlay, the proper error is generated.

I plan to submit tests for these two bugs in a follow-up CL.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43163 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 23:26:45 +00:00
scheglov@google.com 2b8c66ea79 Rename ChangeNotice resolved Dart/Html unit fields.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43147 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 19:58:19 +00:00
danrubel@google.com 899de62bbf (TBR) fix test_performAnalysisTask_importedLibraryAdd_html test
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43091 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 03:00:12 +00:00
danrubel@google.com d284fef9db cleanup unused imports
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43086 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 22:41:51 +00:00
scheglov@google.com 23215e71f4 Remove Element.users support.
R=brianwilkerson@google.com, pquitslund@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43032 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 00:48:02 +00:00
jwren@google.com 252c19c920 Addition of the new flag "file-read-mode" into the analysis server to fix the offset bug with IntelliJs integration.
R=brianwilkerson@google.com, paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43028 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 21:48:00 +00:00
pquitslund@google.com e20c2167a3 Linter API updates.
(A trimmed down version of: https://codereview.chromium.org//853123002 in a hopes of not unsettling the build.)

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43023 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 19:38:14 +00:00
scheglov@google.com fd6cef8a8b Don't perform incremental resolution if curly brackets are not balanced.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43022 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 19:28:12 +00:00
whesse@google.com 3a7594b9fe Revert "Lint contribution refactoring.", r42967
This reverts commit r42967, https://codereview.chromium.org//853123002.
The change causes an out-of-memory crash in analyzer batch mode, perhaps
a memory leak.

BUG=
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42979 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-19 09:26:45 +00:00
pquitslund@google.com 9b132e1032 Lint contribution refactoring.
A little shuffle to centralize the linter concern (and reduce the need to touch resolver.dart).

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42967 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-16 18:29:41 +00:00
pquitslund@google.com 807a4fa8fa Delegating AST Visitor and Linter refactoring.
R=brianwilkerson@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42923 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 18:09:42 +00:00
jwren@google.com 8a495697e6 Move the class TypeTestProvider from the test directory into the lib directory so that other tools can use the class and other tools such as the ElementFactory which require a TypeProvider
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42855 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-14 06:59:51 +00:00
scheglov@google.com 036b652dd1 Use all library units for hints during incremental resolution.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42846 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 23:23:20 +00:00
scheglov@google.com 20e0b4b556 Match some constructor-based annotations.
It doesn't validate argments (we don't have them in annotation, and even if we had,
it is still not cheap to compare nodes with values, but we could remember source
strings, as we do for default parameter values), but it should not cause
invalid resolution, because we resolve incrementally only changes in methods bodies.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42822 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 17:13:43 +00:00
scheglov@google.com a38a503d86 Replace @ReflectiveTestCase() with @reflectiveTest.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42821 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 17:11:24 +00:00