Commit Graph

3160 Commits

Author SHA1 Message Date
paulberry@google.com 44f58316a1 Wait for "server.connected" notification before beginning integration tests.
R=brianwilkerson@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38795 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 20:28:43 +00:00
danrubel@google.com 4c868034b5 refactor code completion to allow for multiple suggestion computers
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38787 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 16:11:14 +00:00
scheglov@google.com c8ae5e3b57 Make any exception in the operations loop fatal.
Note, that with the latest analyzer snapshot the NPE we saw does not leak anymore,
so this code does not work. But the result is not much better - context continues
analyzing the same file again and again.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38785 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 15:57:18 +00:00
paulberry@google.com e2ac6f3b52 Get rid of unnecessary calls to toDouble().
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38749 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 20:16:19 +00:00
paulberry@google.com c243ffe3a2 Better implementation of shutdown timeout.
In addition to being easier to read, Future.timeout() has the
advantage that if the future completes before the timeout, there isn't
a pending asynchronous event unnecessarily keeping the process alive.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38748 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 20:15:01 +00:00
paulberry@google.com 99b36c3748 Increase shutdown timeout to work around slow analysis server startup time.
TBR=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38746 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 19:12:54 +00:00
paulberry@google.com dc95ca2d0e Add timestamps to integration test output.
This should aid in debugging buildbot failures.

TBR=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38743 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 18:20:32 +00:00
paulberry@google.com b1bb36946f Integration tests for analysis.updateContent.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38741 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 17:55:27 +00:00
paulberry@google.com 6c74d75f6d Make "server.shutdown" exit the analysis server.
Also update integration tests so that they use "server.shutdown" to
terminate each test.  This ensures that repeatedly running integration
tests does not cause an accumulation of analysis server temporary
files.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38739 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 17:38:40 +00:00
paulberry@google.com 6856764b79 Allow analysis server integration tests to run without package root.
Since the analysis server will periodically be released via pub, some
users may try running integration tests using the a local "packages"
directory rather than specifying a package root.  When this happens,
avoid sending an empty "--package-root=" option to the VM.

R=danrubel@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38731 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 13:41:32 +00:00
paulberry@google.com cb63f50483 Fix analysis server integration tests on Windows.
Platform.script is a URI.  To safely convert it to a Windows path we
need to use .toFilePath(windows: ...).  Previously we used .path,
which resulted in passing nonsensical paths to the VM when invoking
the analysis server subprocess.

BUG=dartbug.com/20252
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38730 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 12:40:34 +00:00
danrubel@google.com 5a35fd7262 incremental step moving completion into services and adding tests
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38728 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 12:37:47 +00:00
scheglov@google.com a8da65016a Send 'server.error' notification in case of an exception during performing an operation.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38688 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 18:12:37 +00:00
paulberry@google.com df750aef30 Fix analysis server integration/test_all.dart.
This was accidentally broken when the integration test files were
renamed in r38661.

Also, remove a stray call to debugStdio() that was accidentally left
in the analysis domain integration tests.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38687 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 18:09:31 +00:00
ricow@google.com 4352e4f6ae Remove package root hack from the analysis server integration testing
Use the one provided by Platform instead.

Remove suppression from status file

BUG=20251
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38674 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 15:38:45 +00:00
danrubel@google.com 0ecfa47a94 add FUNCTION_TYPE_ALIAS to CompletionSuggestionKind
BUG=dartbug/20188
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38670 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 12:37:23 +00:00
ricow@google.com c913a21cb6 Start running the analysis server integration tests by changing the name to end with _test.dart
Note that these will not run on the vm bots, only on the pub/pkg bots on the right.

I would rather that we keep this in the normal setup. If we are seeing to long cycle times we should shard these machines instead of special casing.

Sorry if you wasted time doing the new specialized test suite.

If we want to, we can skip this on specific platforms in the status files(qua comments in mail thread), but I don't think we should

I ran this in a loop on my linux box for a few hours, no flakes.

R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38661 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 11:11:50 +00:00
paulberry@google.com 7d60f1b13c Add integration tests for analysis.getErrors.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38658 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 04:07:11 +00:00
scheglov@google.com 08a248283e Issue 20240. Use a FileManager that manages its own temporary directory.
So, we can have more than one index and server running.
And we know when it is time to delete or recreate this temporary directory.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38652 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 22:13:58 +00:00
scheglov@google.com 4a47ef63f5 Move PackageMapUriResolver into analyzer.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38650 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 21:09:58 +00:00
paulberry@google.com 099b8ba634 Add placeholder test for completion domain.
R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38642 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 19:05:25 +00:00
scheglov@google.com e24d5aacfc Implementation of the 'search.getTypeHierarchy' API.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38626 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 15:52:28 +00:00
scheglov@google.com 33e44b90b0 Implement more fixes.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38571 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-25 03:21:09 +00:00
paulberry@google.com b598db2dcc Start writing analysis server integration test for 'completion.getSuggestions'.
The test is currently incomplete (and hence disabled) due to
dartbug.com/20188.

R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38559 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-24 22:08:10 +00:00
scheglov@google.com f96087b9c1 Drop 'errorToJson', use server's AnalysisError.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38550 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-24 20:21:12 +00:00
scheglov@google.com aba0cfa4e6 Remove any 'group' invocations enclosing 'runReflectiveTests'.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38547 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-24 18:08:45 +00:00
paulberry@google.com 61d702cc89 Handle bad data in analysis server integration tests.
If bad data is received from the analysis server (e.g. a stacktrace),
switch on debugging output, let the integration test run for 1 more
second (to collect the entire stacktrace), and then fail the
integration test.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38545 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-24 17:39:25 +00:00
scheglov@google.com b3054315da Send responses for any pending 'analysis.getErrors' requests during context removal.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38544 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-24 17:34:06 +00:00
paulberry@google.com 9861f6e1d0 Use package root in analysis server integration tests.
R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38527 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-23 23:59:32 +00:00
paulberry@google.com 01d0779b85 Allow an analysis server response to have both "error" and "result" fields.
Usually this won't happen, but there are rare cases where it might
(e.g. an unexpected exception occurs while analyzing a file in
response to analysis.getErrors, and some error information has already
been successfully computed).

So it seems best to allow it in the integration tests.

R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38516 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-23 18:10:10 +00:00
scheglov@google.com 6b7184ba97 Implementation of the 'analysis.getErrors' API.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38476 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-22 21:24:11 +00:00
scheglov@google.com 4a722c5958 Implementation of the 'edit.getFixes' API in server.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38473 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-22 20:45:51 +00:00
paulberry@google.com 9f49af72fc As a temporary measure, allow SDK to be specified on analysis server cmd line.
Once the 'analysis.updateSdks' request is functional, this should be
unnecessary.  But for now, allow the default SDK to be set via the
command line so that we don't block development of editor plugins.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38443 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-21 21:50:59 +00:00
danrubel@google.com 256e11dd57 more progress implementing analysis server code completion
- add more properties returned by completion suggestion
- move completion suggestion into services
- move property constants into services for use by completion services
- move HasToJson into services for completion
- remove duplicate completion test

BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38418 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-21 02:04:49 +00:00
scheglov@google.com fc6ce5cce6 Use futures uniformly rather than a mix of futures and CPS in tests.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38397 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-18 16:22:29 +00:00
paulberry@google.com 05e4acbc0d Fix analysis server 'analysis.getHover' when there is no hover information.
Previously we returned {'hovers': [null]}.  We now return {'hovers': []}.

Also, tweak the analysis.getHover unit tests to use futures uniformly
rather than a mix of futures and CPS.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38366 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-18 03:30:19 +00:00
paulberry@google.com b660abdcc6 Three new analysis server integration tests
1. server.setSubscriptions (invalid service)
2. analysis.getHover (normal operation)
3. analysis.getHover (no hover information available)

Test 3 is disabled because it currently fails due to an analysis
server bug.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38364 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-18 02:20:53 +00:00
danrubel@google.com d6497d280c denote completion offset using special character
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38349 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-17 21:41:01 +00:00
danrubel@google.com 2bd9f4ec92 first cut simple code completion results
- not all CompletionSuggestions implemented yet
- results valid in only a few situations
- more to come

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38347 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-17 21:11:39 +00:00
scheglov@google.com 514ca3d6b4 Revert using relative paths because of the problems with the Pub bots.
R=brianwilkerson@google.com, nweiz@google.com, paulberry@google.com, danrubel@google.com, rnystrom@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38345 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-17 20:42:07 +00:00
paulberry@google.com 44a7ca5254 Remove 'errorCode' field from AnalysisError in the analysis server API.
R=brianwilkerson@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38331 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-17 15:05:21 +00:00
paulberry@google.com 045aa3e5bd More integration tests for analysis server.
This covers everything in the "server" domain except for server.error
(which is difficult to test since it should only occur in the event of
a server bug).

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38319 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 23:46:36 +00:00
scheglov@google.com bd010c2cd3 Improve occurrences calculation - merge accessors, members.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38314 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 22:20:44 +00:00
scheglov@google.com 3317e79eed Search only for potential name references to Class members.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38309 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 20:40:34 +00:00
scheglov@google.com d82723de9d Fix for name declaration indexing in for-in statement.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38306 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 20:18:32 +00:00
paulberry@google.com 6ab7a41e1f Start writing integration tests for the analysis server.
R=brianwilkerson@google.com, jwren@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38288 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 16:02:24 +00:00
scheglov@google.com 907d89258a Implementation of the 'search.findMemberDeclarations' API.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38286 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 15:42:33 +00:00
scheglov@google.com 7dafd0a143 Implementation for the 'search.findMemberReferences' API.
It seems that implementation if very simple, so I will put it inline instead of a separate file.
The previous 'search.findMemberDeclarations' CL will be updated before commit.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38285 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 15:33:35 +00:00
scheglov@google.com 9a0e356bc4 Implementation for 'search.findTopLevelDeclarations' API.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38269 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 00:25:08 +00:00
scheglov@google.com 9903444d04 Include 'element' into 'search.findElementReferences' response.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38268 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 00:19:27 +00:00