Commit Graph

165 Commits

Author SHA1 Message Date
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
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
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
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 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
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
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
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
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 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 ad10f83b2d Use AnalysisServer.getResolvedCompilationUnits() helper in hovers.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38252 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 19:57:54 +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
paulberry@google.com 30be07745a Handle context == null in the analysis.getHover request.
This could happen due to a race condition: the client might request
hover information for a file that the server has not established a
context for yet (e.g. during startup).

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38207 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 19:56:28 +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 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 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
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
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 8ed7aaef4e Remove server/generated folder.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37889 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 17:48:53 +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
jwren@google.com 5e873d646b Change HashMap declarations back to Map.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37882 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 17:18:27 +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
scheglov@google.com b2016358fb Update navigation computer to include Element instead of id.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37704 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-25 18:49:27 +00:00
scheglov@google.com 19b07ce26c Element.fromEngine() constructor.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37701 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-25 17:21:56 +00:00
scheglov@google.com 0aa39f1e10 A local file-based Index implementation.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37664 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-24 18:08:00 +00:00