Commit Graph

228 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
scheglov@google.com 47fe46e1a6 Integrate EXTRACT_METHOD refactoring into the server.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39808 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 14:54:16 +00:00
paulberry@google.com d092a96981 Clarify type names in analysis server API.
The following types are renamed:

- ErrorFixes -> AnalysisErrorFixes
- ErrorSeverity -> AnalysisErrorSeverity
- ErrorType -> AnalysisErrorType

This clarifies that the types have to do with the
errors/warnings/hints generated by the analysis of user code, as
opposed to analysis server protocol errors.

R=brianwilkerson@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39770 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 19:54:03 +00:00
paulberry@google.com ba9c0c689b Use a more precise type for "object" in analysis server API.
Previously, we translated "object" in the API to the dart type
"Object".  But this is not correct, since in the API when we say
"object" we mean "JSON object", which corresponds to a Dart Map.

Using a more precise type exposed some bugs in our refactoring
implementation, where we were forgetting to convert objects to and
from JSON.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39757 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 17:46:02 +00:00
scheglov@google.com 209abb70f4 Integrate EXTRACT_LOCAL_VARIABLE into the server.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39747 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 15:00:45 +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
scheglov@google.com e16a9dfe84 Send RenameFeedback.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39514 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-25 05:07:43 +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 665da3d948 Make certain generated constructor parameters optional.
The following constructor parameters are optional as a convenience to
callers.  They default to empty lists:

- SourceFileEdit.edits
- TypeHierarchyItem.interfaces
- TypeHierarchyItem.mixins
- TypeHierarchyItem.subclasses

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39510 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-23 23:56:24 +00:00
scheglov@google.com 5dda914674 Implement 'edit.getRefactoring' for rename refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39509 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-23 21:14:25 +00:00
scheglov@google.com 47b813e4ec Rename 'kindId' to 'kind' in 'edit.getRefactoring'.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39474 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 20:57:14 +00:00
paulberry@google.com caf0592503 Make more use of generated code in analysis server.
The following generated classes are now used:
- Element
- Location
- Occurrences
- Outline
- OverriddenMember
- Override
- Position
- SearchResult
- SearchResultKind
- SourceFileEdit
- TypeHierarchyItem

Generated code is used to produce the responses to these requests:
- completion.getSuggestions
- search.findElementReferences
- search.findMemberDeclarations
- search.findMemberReferences
- search.findTopLevelDeclarations
- search.getTypeHierarchy

Generated code is used to handle these notifications in unit testing:
- analysis.navigation
- analysis.occurrences
- analysis.outline
- analysis.overrides
- search.results

In addition, we no longer bother to test the JSON conversion code on
AnalysisError, since it is code generated.

R=scheglov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39470 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 20:04:06 +00:00
scheglov@google.com e666722007 Make EXTRACT_LOCAL and EXTRACT_METHOD refactorings available when there is a selection.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39463 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 17:43:22 +00:00
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
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 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 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
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
danrubel@google.com 6224c56dbb remove unused imports
BUG=
R=paulberry@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38933 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-06 15:49:18 +00:00
scheglov@google.com 41c4564935 Make Change implementation consistent with the server spec.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38908 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-05 21:39:05 +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 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
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