Commit Graph

4182 Commits

Author SHA1 Message Date
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
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
scheglov@google.com d59f0bc80f Add hierarchy utils and use them in search.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38259 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 21:12:42 +00:00
scheglov@google.com 1037608fed Fix for NPE if subscribing for errors in a not analyzed file.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38238 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 15:50:49 +00:00
scheglov@google.com 1de8ecb571 Use HasToJson when set Reponse/Notification parameters.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38206 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 19:54:04 +00:00
scheglov@google.com acd4145f62 Initial implementation for 'search.findElementReferences'.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38201 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 17:45:28 +00:00
scheglov@google.com d51cfd6c70 Fix build after Index changes.
TBR

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38179 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-12 02:02:22 +00:00
scheglov@google.com 6d5773dc5e Tests for LocalIndex and Dart index contributor.
Pub spec files will be updated before commit.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38071 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-08 20:53:10 +00:00
scheglov@google.com 0597e61ba3 Move index/search to services.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38045 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-07 22:24:59 +00:00
scheglov@google.com bf61f59c82 Extract testing utilities into a separate package.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38039 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-07 20:50:59 +00:00
scheglov@google.com 9e33b85c31 Move file_system libraries into 'analyzer'.
I still end up including memory FS into 'analyzer' because tests for ResourceUriResolver use it.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38034 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-07 18:57:42 +00:00
scheglov@google.com 570d537b0f Update HoverInformation to include offset, length, kind.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37995 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-03 22:06:13 +00:00
scheglov@google.com 1f45100688 Move Index and IndexStore implementations into Engine.
Also move most of the related tests.

LocalIndex test is commented out, because relies on the infrastucture existing only in Server - virtual file system, mocks.
We need to move it into Engine or extract into a separate package.

This CL also removes Dart implementation of BTree.
We now use a different approach to implementing the index.

Bots are red after the previous CL, I hope that this one will fix at least some redness.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37993 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-03 21:30:25 +00:00
scheglov@google.com 82d67d0d87 Add highlight regions for comments.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37992 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-03 20:49:50 +00:00
brianwilkerson@google.com 13b10de8db Add failing test
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37989 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-03 17:55:35 +00:00
scheglov@google.com 64f238ba34 Implemention of the 'analysis.overrides' notification.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37971 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-03 03:24:27 +00:00
scheglov@google.com 179c102d78 Implementation for 'analysis.occurrences' notification.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37954 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-02 18:38:01 +00:00
scheglov@google.com 7f70e3186f Implementation for 'analysis.getHover'.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37952 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-02 17:33:22 +00:00
scheglov@google.com 4db963da6e Restore the navigation test for an unresolved part URI.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37927 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-02 00:52:41 +00:00
paulberry@google.com 56965cd347 Fix operator== and hashCode for File and Folder objects.
This is necessary in order for File and Folder objects to be safely
stored in HashSets and HashMaps.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37926 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-02 00:46:15 +00:00
scheglov@google.com 9cb4f47557 Update Element/navigation/outline to use Location.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37903 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 20:25:04 +00:00
scheglov@google.com 5eb236b9b3 Update analysis.errors notification to the newest spec.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37887 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 17:38:34 +00:00
paulberry@google.com 3f8968c08a Handle relative paths in the output of "pub list-package-dirs".
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37879 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 16:32:52 +00:00
paulberry@google.com e4c8c998ab Ignore bogus links, such as those created by emacs for files being edited.
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37845 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 00:51:55 +00:00
jwren@google.com af71a4f377 Change Maps to HashMaps to save in performance, index and generated directories not touched
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37840 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 22:40:08 +00:00
paulberry@google.com 590021403c Handle a failure in "pub list-package-dirs".
This can happen if the user tries to open a folder that contains no
pubspec.yaml file (and thus no pubspec.lock file).

When this happens, we artificially treat 'pubspec.lock' as a
dependency, so that if the user later creates a pubspec.yaml and runs
'pub get', we will automatically re-run "pub list-package-dirs".

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37831 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 19:34:59 +00:00
paulberry@google.com 66f969119d Rerun "pub list" when pubspec.lock changes.
(Note: we don't actually hardcode the dependency on pubspec.lock--we
use the "input_files" field of the output from "pub list" which tells
us the dependency).

This required some refactoring: ContextDirectory has been eliminated
and its responsibilities (creating the analysis context, UriResolvers,
and SourceFactory) have been shifted to ContextDirectoryManager and
AnalysisServerContextDirectoryManager.  Accordingly,
AnalysisServer.folderMap now maps directly from folder to
AnalysisContext.

Note: we don't yet properly handle the case where one of the
dependencies output by "pub list" is outside of the context folder.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37826 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 17:44:37 +00:00
paulberry@google.com dc603c5455 Add a Resource.parent getter, which gets the parent directory.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37746 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-26 15:03:24 +00:00
danrubel@google.com 64511683b8 send status notification when analysis starts and ends
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37734 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-26 11:53:39 +00:00
scheglov@google.com 01c2fbefb1 Index Dart/HTML units after analysis.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37707 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-25 21:14:30 +00:00