Commit Graph

2342 Commits

Author SHA1 Message Date
danrubel@google.com 78a3bfe9c2 refactor/cleanup dart completion cache
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42556 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-22 22:09:46 +00:00
paulberry@google.com 6d7155de63 Introduce CompletionTarget to take the place of the Node being completed.
Instead of locating the node containing the cursor offset using a
NodeLocator, identify the edge in the parse tree which will be
displaced or modified by the completion proposal.  This reduces the
number of cases that need to be handled in the _OpTypeAstVisitor, and
avoids the need for the _OpTypeAstVisitor to consider character
offsets in nearly all cases.

R=danrubel@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42543 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-20 15:47:25 +00:00
danrubel@google.com d06e291c52 update completion cache key to include part directives
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42542 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-20 05:17:58 +00:00
danrubel@google.com e95dcac840 support part file completions
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42541 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-20 05:15:50 +00:00
scheglov@google.com d139fbfaa2 Add InstrumentationService.logPriorityException() and use logException() in refactorings.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42530 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-19 23:00:19 +00:00
scheglov@google.com 97f90d4acc Fix for extracting from interpolated string.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21907

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42528 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-19 22:11:13 +00:00
scheglov@google.com 11bdb14559 Catch exceptions in refactorings and return them as a SERVER_ERROR.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21907

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42526 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-19 21:51:02 +00:00
brianwilkerson@google.com 86dfd8470f Capture and report all exceptions in server
Review URL: https://codereview.chromium.org//811223002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42509 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-19 15:55:34 +00:00
scheglov@google.com 8c99b69287 Log more information to debug 'null' location for constructor.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21842

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42463 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-18 18:52:34 +00:00
brianwilkerson@google.com 7c877ab009 Ensure shutdown is always called
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42442 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-17 18:16:11 +00:00
paulberry@google.com 2546490ed5 Ensure that AnalysisContext futures are completed when context disposed.
It's possible for the analysis server to create or destroy contexts in
the background while the user is working (as a result of changes on
the filesystem).  This ensures that if any code completions are
waiting for analysis when that happens, they are aborted.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42416 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 23:41:56 +00:00
danrubel@google.com 049adb2777 refactor optype to be computed once per refactoring request
and hide optype computation internals

BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42412 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 22:15:38 +00:00
paulberry@google.com 3448724d3a Improve nomenclature of new AnalysisContext async method.
R=danrubel@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42404 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 18:05:02 +00:00
paulberry@google.com 997ac90b24 Fix getAnalysisContextForSource.
Previously this function was always returning the first context; as a
result completions were only being precomputed for the first context.

There were probably subtle breakages in other features as well, though
I'm not aware of any specific problems.

R=danrubel@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42401 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 17:11:25 +00:00
danrubel@google.com ddc3cae8bd refactor duplicate code into single visitor
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42398 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 16:53:24 +00:00
scheglov@google.com 8affb6c015 Upgrade unittest to be able to use isNotEmpty.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42380 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 04:07:37 +00:00
scheglov@google.com fef0e84293 Issue 21883. Add checks if type parameters can be used.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21883

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42377 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 00:29:22 +00:00
scheglov@google.com a662ca1ea1 Disable 'Split && condition' if there is an 'else' statement.
R=danrubel@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42374 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 20:36:13 +00:00
danrubel@google.com 438aa447d4 refine when suggestions are limited to types
BUG=dartbug.com/18860
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42366 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 17:48:00 +00:00
danrubel@google.com cd4ec28541 fix named constructor completion
BUG=dartbug.com/21799
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42365 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 17:16:40 +00:00
danrubel@google.com 7f1ac9a001 include local functions in completion suggestions
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42363 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 17:11:38 +00:00
scheglov@google.com 2b34d072cc Turn on incremental resolution.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42351 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 23:02:21 +00:00
scheglov@google.com 1c082a63ab Don't send a refactoring feedback in case of a fatal initial problem.
R=brianwilkerson@google.com, danrubel@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42350 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 22:55:52 +00:00
brianwilkerson@google.com b8c70eec87 Stop sending unwanted status and fix integration tests
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42343 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 18:32:21 +00:00
danrubel@google.com 611178ee87 call dispose so completion manager can cancel pending operations
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42341 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 18:29:31 +00:00
danrubel@google.com b09752d035 enhance code completion tracking and measurement
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42340 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 18:27:07 +00:00
paulberry@google.com 0b9ed18603 Allow completions to wait for analysis without requiring a busy wait loop.
Two new methods are added to the AnalysisContext which return
Futures--the futures complete with the result of analysis once it's
available, avoiding the need for a busy wait loop in the completion engine.

The futures are guaranteed to complete eventually (provided that
analysis reaches quiescence).  If it is determined that the requested
analysis will never become available (e.g. because analysis was
requested for a file or file/library combination that is not subject
to analysis), the future will be completed with an
AnalysisNotScheduledError, so that the client isn't stalled forever
waiting for analysis results.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42339 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 18:22:34 +00:00
brianwilkerson@google.com 77b819cd76 Report pub status
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42328 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 17:40:04 +00:00
brianwilkerson@google.com 44b69647a3 Rework instrumentation API
R=danrubel@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42321 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 16:00:23 +00:00
scheglov@google.com 956e9e41ed Fix for exchaning comparison operators arguments.
R=danrubel@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42299 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-11 21:07:14 +00:00
danrubel@google.com 45bebf8b76 filter imported element suggestions to reduce number of results sent to client
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42289 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-11 17:18:13 +00:00
brianwilkerson@google.com f58bf4dbc9 Remove old instrumentation
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42267 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 21:53:08 +00:00
danrubel@google.com 6995092b9d code completion for dynamic type elements
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42261 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 19:09:29 +00:00
brianwilkerson@google.com 2fc10f606d Shutdown instrumentation
R=danrubel@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42260 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 19:04:28 +00:00
brianwilkerson@google.com 8e7dd100f1 Code clean-up
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42252 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 17:06:19 +00:00
brianwilkerson@google.com bdb6a6a61f Instrument communications
R=danrubel@google.com, lukechurch@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42250 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 16:48:08 +00:00
scheglov@google.com 583b9447f5 Rollback r42232.
R=danrubel@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42233 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 01:18:57 +00:00
scheglov@google.com bd65677ec2 Comment out the function causing CPU burn up.
TBR

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42232 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 00:46:26 +00:00
danrubel@google.com e24f040b46 skip completion if client closed stream
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42229 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 23:57:12 +00:00
danrubel@google.com 4247fe2550 bound the time waiting for analysis to complete
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42228 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 23:54:06 +00:00
scheglov@google.com 897a446835 Sort Quick Fixes. Make lower priorities more relavant than higher.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42227 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 22:23:27 +00:00
brianwilkerson@google.com 0a8dc970d2 Hooks for instrumentation
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42218 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 20:14:42 +00:00
scheglov@google.com 495cb6d5bf Issue 21801. Index redirecting constructor invocations.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21801

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42202 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 02:21:07 +00:00
scheglov@google.com e30b2b313d Ignore ButtonType when computing an extracted method return type.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42201 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 02:19:54 +00:00
scheglov@google.com 3b73b01511 Issue 21740. Allow inlining local variables declared in SwitchCase.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21740

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42191 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 22:33:07 +00:00
danrubel@google.com f0bc442ea4 cache suggestions on change in priority sources
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42189 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 22:00:16 +00:00
danrubel@google.com dc9f446021 update computeFast/Full now that completion manager is long lived
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42188 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 21:56:56 +00:00
scheglov@google.com e73e5faaad Getters should not have parameters.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42183 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 21:04:44 +00:00
danrubel@google.com 8ef4de75cd include lower relevance suggestions only if they are already cached
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42172 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 18:56:43 +00:00
danrubel@google.com cbbcadc423 remove unused cache arguments
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42167 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 16:59:02 +00:00