Commit Graph

139 Commits

Author SHA1 Message Date
paulberry@google.com 8d8ee25cff Merge analysis_testing package into analysis_server.
Note that analysis_server already contains a file test/mocks.dart, so
the mocks.dart file from analysis_testing has been imported as
test/mocks2.dart.  I will merge these two into a single file in a
future CL.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39814 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 18:11:42 +00:00
paulberry@google.com f556420f97 Rename some bools in the analysis server API.
R=brianwilkerson@google.com, jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39604 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 16:39:49 +00:00
paulberry@google.com 0c0fd777a6 Finish modifying analysis server to make use of code generation.
Generated code is used to produce the response to these requests:
- analysis.updateOptions
- analysis.updateContent
- analysis.setSubscriptions
- analysis.setPriorityFiles
- analysis.setAnalysisRoots
- server.shutdown
- server.setSubscriptions

Generated code is used to produce these requests:
- server.shutdown
- server.getVersion
- server.shutdown
- server.connected

Generated code is used to produce these notifications:
- completion.results
- analysis.overrides
- analysis.outline
- analysis.occurrences

Generated code is used to decode these notifications:
- server.status

In addition, some dead code was removed, the 'protocol.dart' and
'protocol2.dart' files were combined, and the fields Response.result,
Request.params, and Notification.params were made private (to
encourage future use of the generated code).  Also, some overly
verbose import statements were cleaned up by using "hide" rather than
"show".

R=danrubel@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39516 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-25 10:48:16 +00:00
paulberry@google.com e18327f317 Make more use of generated code in analysis server.
The following generated classes are now used:
- CompletionRelevance
- CompletionSuggestion
- CompletionSuggestionKind
- ErrorFixes
- HighlightRegion
- HighlightRegionType
- HoverInformation
- LinkedEditGroup
- LinkedEditSuggestion
- LinkedEditSuggestionKind
- SourceChange

Generated code is used to produce these notifications:
- analysis.errors
- analysis.highlights
- analysis.navigation
- search.results
- server.error
- server.status

Generated code is used to produce the response to these requests:
- analysis.getErrors
- analysis.getHover
- edit.getAssists
- edit.getFixes
- server.getVersion

Generated code is used to handle these notifications in unit testing:
- analysis.highlights
- analysis.navigation

In addition, these methods have been removed, since they are no longer
needed:
- Notification.getParameter
- Result.setEmptyResult
- Result.setResult

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39511 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-24 08:39:41 +00:00
paulberry@google.com 34699f46d5 Start using code-generated protocol classes in analysis server.
This updates the handlers for analysis.getErrors,
server.setSubscriptions, and analysis.setSubscriptions with simpler
versions that make use of the code-generated protocol classes, and
replaces the classes AnalysisError and AnalysisService with their
code-generated versions.

It also removes some dead code.

R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39376 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 18:29:41 +00:00
paulberry@google.com 80352fd61c Fix analysis server to only send SERVER_STATUS when subscribed to.
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39065 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-09 16:36:39 +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
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
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
paulberry@google.com e9fa53425c Use "pub list-package-dirs" to resolve package URIs in analysis server.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37552 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-20 14:42:01 +00:00
brianwilkerson@google.com 58ee598e04 Adjust server for API changes
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37368 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-16 18:41:04 +00:00
scheglov@google.com ae59c7e055 Clean ups for warnings and unused code.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37039 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-05 17:52:20 +00:00
scheglov@google.com 61dfa442c9 Extract analysis/notifications into a separate operation/file.
It seems that while we really have to expose some additional API from AnalysisServer,
it still worth to extract analysis and its notifications into a separate file.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36899 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 21:00:49 +00:00
paulberry@google.com b703deb077 Add a boolean which causes AnalysisServer to rethrow exceptions.
The boolean defaults to true to ensure that any unhandled analysis
exceptions which occur during unit tests are reported as unit test
failures.  When the full analysis server is run normally it is set to false
so that exceptions are simply logged.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36895 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 19:57:41 +00:00
scheglov@google.com 304243bc5b Add ServerOperation and queue.
Schedule operations to perform analysis.
Moving notifications into operations to be done in the next CL.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36890 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 18:31:49 +00:00
brianwilkerson@google.com 128c605a17 Fix the build
Review URL: https://codereview.chromium.org//308313005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36875 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 14:58:27 +00:00
brianwilkerson@google.com ae5597140c First cut at server timing tests
R=jwren@google.com, paulberry@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36874 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 14:39:33 +00:00
paulberry@google.com 15560d6608 Convert analysis_server_test to use a helper class.
Also remove some commented-out tests that are no longer relevant.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36837 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-30 21:17:40 +00:00
scheglov@google.com 24c8f1f4b2 Extract constants into separate libarary.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36828 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-30 18:37:44 +00:00
scheglov@google.com 35c177c90b Send 'notification.errors' for all non-SDK files.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36743 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-28 15:50:23 +00:00
danrubel@google.com e7e559942c add server.status notification
BUG=
R=brianwilkerson@google.com, paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36727 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-28 02:25:20 +00:00
scheglov@google.com 764c6b112c Partial implementation of the 'setAnalysisRoots' API.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36702 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 19:01:14 +00:00
scheglov@google.com ebd41ed304 Implementation of 'Server Domain' in dart analysis server.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36607 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-24 17:36:06 +00:00
scheglov@google.com 555bc4ef2d New analyzer snapshot.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36511 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-22 16:58:29 +00:00
danrubel@google.com 6da2ff1d40 improve analysis server notifications
* add context id to error notifications
* add analysis.complete notification

BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36363 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-20 16:42:50 +00:00
danrubel@google.com 8b119623e2 update analysis_server_test with expected error code message arguments
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36327 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-19 21:27:55 +00:00
danrubel@google.com 88344402e1 move context id constant to AnalysisServer
BUG=
R=brianwilkerson@google.com, paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36263 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-16 17:44:24 +00:00
paulberry@google.com 9271ac7a8f Rework some analysis server tests using mocks.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35374 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-24 15:05:11 +00:00
paulberry@google.com 22ee284c47 Serialize AnalysisErrors to JSON in the analysis server.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35329 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 20:35:43 +00:00
paulberry@google.com 2424320373 Don't make assumptions about source encoding in analysis server tests (TBR).
On Windows, the encoding of an absolute path like "/foo.dart" contains
a drive letter (e.g. "102file:///e:/foo.dart"); on Mac and Linux it
doesn't.  Call ".encoding" from the test so that we don't depend on
the specific file name encoding in use.

As a side benefit, this makes the test independent of bug 18379.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35327 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 20:02:18 +00:00
paulberry@google.com 19572ac352 Use AnalysisServer.running only to track whether server has been shut down.
Previously, AnalysisServer.run() and AnalysisServer.performTask() also
tried to use this variable to track whether there was a pending call
to performTask() on the event queue.  The resulting confusion
prevented analysis from ever running.

It turns out that we don't need to separately track whether there is a
pending call to performTask(), as long as we enforce the invariant
that there is a pending call to performTask() exactly when
contextWorkQueue is non-empty.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35323 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 18:35:58 +00:00
paulberry@google.com 0540e6a85b Eliminate nondeterminism from analysis server unit tests.
Previously, we tested for non-responsiveness in the analysis server
using timeout(new Duration(seconds: 1)).  This caused sporadic
failures on slower buildbots.  Now, we simply let the event loop run
20 times--this should produce consistent results regardless of machine
speed.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35221 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-21 19:48:15 +00:00
paulberry@google.com 8fd57e0efa Disable test "AnalysisServer createContext" again.
This is failing on some buildbots.  I will investigate next week.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35188 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-18 22:58:48 +00:00
paulberry@google.com 783aca1892 Analysis server context ID is now specified by the client.
This allows the client to start sending commands that use the context
immediately, without having to wait for a response to find out the
context ID.

If the client tries to create two contexts with the same ID, that is
an error.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35185 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-18 22:20:53 +00:00
paulberry@google.com f6ec765421 Fix and re-enable analysis server tests that were commented out.
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35183 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-18 20:50:23 +00:00
danrubel@google.com b25bbbb5eb utility for manually running all analysis_server tests
BUG=
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34522 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-28 20:29:30 +00:00
kevmoo@google.com 1119399bf3 pkg/analysis_server: fixes for unittest deprecations
R=danrubel@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34503 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-28 16:10:00 +00:00
danrubel@google.com 18618a20b3 add sdkPath and enable tests
BUG=
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33600 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-12 19:18:14 +00:00