Commit Graph

4182 Commits

Author SHA1 Message Date
scheglov@google.com b13f544e13 Return only fixes for the errors on the line of the given offset.
R=paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39460 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 17:25:26 +00:00
scheglov@google.com c0b2eee596 Finish 'Extract Local' refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39457 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 16:31:39 +00:00
paulberry@google.com 1fed61127e Introduce convenience methods into generated analysis server classes.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39453 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 15:49:35 +00:00
scheglov@google.com d67a4a4458 Initial 'Extract Local' implementation.
Missing:

1. suggested names;
2. offsets and lengths of occurrences.
3. some clean ups.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39434 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 22:20:19 +00:00
scheglov@google.com c173853f4c Don't use LinkedEditGroup.id.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39430 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 21:07:14 +00:00
scheglov@google.com c74b350b50 New analyzer snapshot.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39416 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 18:18:43 +00:00
danrubel@google.com b10ef0b9dd include inherited members in invocation suggestions
BUG=
R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39413 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 16:13:30 +00:00
paulberry@google.com 721b435ba6 Add SearchResultKind.UNKNOWN to the analysis server API.
This resolves an inconsistency between the spec and the analysis
server behavior: the server returns a SearchResultKind of UNKNOWN if
the MatchKind from the analysis engine is one of the following types:

- ANGULAR_REFERENCE
- ANGULAR_CLOSING_TAG_REFERENCE

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39411 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 15:32:39 +00:00
scheglov@google.com 401de00007 Remove two empty/useless domain tests.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39407 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 14:16:10 +00:00
paulberry@google.com c5ff06636b Make more use of generated classes in analysis server.
Generated code is now used to process input JSON, and to create
requests and process responses in unit tests.  In addition, the
handwritten classes for ElementKind and SourceEdit have been replaced
with the gennerated versions.

Also some dead code has been removed.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39404 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 12:39:31 +00:00
paulberry@google.com 344ff2c03b Make search.findElementReferences.result.element field optional.
This resolves an inconsistency between the spec and the analysis
server behavior: the server doesn't populete the "element" field if no
element could be found.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39388 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 21:56:29 +00:00
paulberry@google.com a54eafb037 Allow null as a synonym for {} when decoding JSON objects.
The spec allows this (for interoprability with Lisp-based clients),
and we had been doing it correctly for lists and maps, but not for
arbitrary objects.

R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39382 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 21:13:31 +00:00
paulberry@google.com c9b9b98343 Use generated classes to create requests in analysis server unit tests.
R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39381 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 20:36:16 +00:00
paulberry@google.com 570b2f115e Change analysis.updateOptions to use generated classes.
Note that there is a small change in behavior: unrecognized options
are now silently ignored; they no longer generate an error.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39380 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 19:57:43 +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
danrubel@google.com 8a46d7ed3f more invocation code completion improvements
and pull common suggestion builders into new library

BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39370 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 14:08:54 +00:00
paulberry@google.com 74d6332c75 Remove code mistakenly added to analysis server's test_all.dart.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39363 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 04:25:44 +00:00
danrubel@google.com 46fbd54548 improve keyword suggestions
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39362 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 03:27:17 +00:00
paulberry@google.com 64b53a4b5c Code generate Dart classes representing the analysis server API.
These classes support:

- Conversion to JSON
- Conversion from JSON, with error handling via the Request object.
- operator== and hashCode

In addition, convenience functions are generated which extract and
convert the variant contents of a Request, Response, Notification,
EditGetRefactoringResult, or EditGetRefactoringParams once the type is
known.

The generated code is not yet used; it will be used by future CL's.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39361 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 23:44:05 +00:00
scheglov@google.com b623c4d49f When user renames 'prefix' in 'prefix.Class' she actually wants to rename ImportElement.
Unfortunately we resolve "prefix" to a "PrefixElement".
So, we have to fix this mismatch in the server.

We do the same in indexer, so this CL extract shared namespace-related code into a new unit.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39356 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 21:49:11 +00:00
scheglov@google.com e1e1febe72 Merge two constants.dart into one.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39355 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 21:34:54 +00:00
scheglov@google.com d988d1c1cb Test for 'edit.getAssists'.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39354 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 21:21:26 +00:00
paulberry@google.com 7226309842 Import analysis_services.dart into analysis_server.dart.
Having two separate packages doesn't really have any benefit, and has
the downside of forcing us to carefully avoid circular dependencies
between the two.  It makes more sense to just combine them.

This is largely a mechanical change consisting of the following renames:

1. pkg/analysis_services/lib/src/* -> pkg/analysis_server/lib/src/services/*
2. pkg/analysis_services/lib/* -> pkg/analysis_server/lib/src/services/*
3. pkg/analysis_services/test/* -> pkg/analysis_server/test/services/*

There were 4 instances where 1 and 2 created a collision:
.../services/correction/assist.dart, .../services/correction/fix.dart,
.../services/refactoring/refactoring.dart, and
.../services/search/search_engine_internal.dart.  To fix the
collision, the files coming from pkg/analysis_services/lib/src were
renamed to "..._internal.dart".

In addition, pkg/analysis_services/test/test_all.dart was modified to
call pkg/analysis_services/test/services/test_all.dart.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39349 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 20:17:49 +00:00
scheglov@google.com 87f6954692 Support for the 'edit.getAvailableRefactorings' request.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39340 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 18:09:05 +00:00
brianwilkerson@google.com 2bf03e89c6 Fix the build
Review URL: https://codereview.chromium.org//481533002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39310 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 19:45:41 +00:00
brianwilkerson@google.com 54edbcc686 Support potential edits
R=paulberry@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39309 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 18:51:16 +00:00
paulberry@google.com 4ab9bde919 Add an integration test for analysis.overrides.
Also remove the note from the API documentation saying that
analysis.overrides only works for overrides of a superclass.
Interface overrides work too.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39302 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 16:56:45 +00:00
danrubel@google.com fa2f2ec46d add keyword suggestions
BUG=
R=brianwilkerson@google.com, paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39284 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 03:37:01 +00:00
paulberry@google.com fce2ad90a8 Add an integration test for analysis.outline.
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39282 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 03:03:24 +00:00
danrubel@google.com f3dbe9fbe3 first incomplete cut at invocation/accessor suggestions
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39281 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 02:29:16 +00:00
paulberry@google.com d2f6dddc57 Fix code generated matchers to handle recursive objects.
This requires using a wrapper that creating the matchers lazily (when
they're first used), so that a matcher can refer to itself without
causing a circularity during initialization.

R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39274 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 22:45:01 +00:00
paulberry@google.com 7e83cc7363 Add an integration test for analysis.occurrences.
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39269 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 21:38:47 +00:00
paulberry@google.com c38a23704c Write an integration test for analysis.navigation notification.
Also, add the missing ElementKind "PARAMETER", and sort the
ElementKinds.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39267 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 21:06:50 +00:00
scheglov@google.com 8bbd86fd11 Proposal for RefactoringMethodParameter.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39253 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 16:46:55 +00:00
paulberry@google.com 17a5250955 Document the fact that client must filter results from completion.results.
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39220 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 20:36:55 +00:00
paulberry@google.com f822f41189 Update analysis server and integration tests to match new ChangeContentOverlay.
The spec was changed in r39199 so that ChangeContentOverlay contains a
list of edits rather than a single edit.  This updates the analysis
server and integration tests accordingly.

BUG=dartbug.com/20495
R=brianwilkerson@google.com, scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39218 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 20:04:55 +00:00
paulberry@google.com 96d5bd1bf0 Add union types to the analysis server API spec.
R=brianwilkerson@google.com, jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39208 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 17:38:11 +00:00
brianwilkerson@google.com 7ab0a914ba Improve spec style and minor changes
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39199 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 14:46:56 +00:00
paulberry@google.com 153e73e155 Add an integration test for analysis.highlights.
Also fix sort order in the API definition of HighlightRegionType.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39152 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 18:16:37 +00:00
scheglov@google.com c25a70a1d9 Fixes for the missing highlights.
These problems were found in https://codereview.chromium.org/463643002/

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39140 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 14:24:01 +00:00
paulberry@google.com 37697c0e81 Rename InttestMixin -> IntegrationTestMixin
R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39128 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 12:07:43 +00:00
paulberry@google.com 19a44a67a6 Split up server_domain_int_test.dart; regularize integration test directories.
With this change, there is a separate subfolder in "test/integration"
for each domain, and each subfolder has its own "test_all.dart".

This change is almost entirely code motion.  The only material change
is that two tests have been dropped:

- test_connected(): this test is now unnecessary since every time the
  "server.connected" message is received, the generated code in
  integration_test_methods.dart verifies that it is well-formed.

- test_error(): this was a placeholder to remind us to test the
  "server.error" notification.  On further reflection, it's unlikely
  that we'll be able to integration test this notification, since it
  only occurs in the event of a server bug.

R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39112 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 22:25:26 +00:00
danrubel@google.com 7ff8e1a17b rename CompletionSuggestionKind.VARIABLE to LOCAL_VARIABLE to match spec
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39103 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 20:13:53 +00:00
danrubel@google.com 3bd149aa45 remove duplicate suggestions
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39100 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 19:18:53 +00:00
paulberry@google.com 931b0afaa6 Split analysis_domain_int_test.dart into several test files.
This test was timing out on the debug build bots because it had 6
sub-tests, each of which started a separate instance of the analysis
server.  Split it out to one test per file.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39095 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 17:39:10 +00:00
paulberry@google.com ff1f9c2643 Code generate integration test streams for notifications.
When a notification is received from the server, it is checked to
verify that its type matches the analysis server API, and then it is
dispatched to the proper stream.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39094 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 17:34:27 +00:00
paulberry@google.com d80f9d9053 Improve matchers for enums defined by the analysis server API.
R=jwren@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39090 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 15:21:18 +00:00
danrubel@google.com 8e1d92bcfa rename and improve imported completion computer
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39081 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 12:42:49 +00:00
danrubel@google.com d5f437d702 local code completion suggestions
BUG=
R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39069 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-11 02:18:48 +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