Commit Graph

292 Commits

Author SHA1 Message Date
scheglov@google.com 227c5524d8 Issue 21375. Fix for FunctionTypeAliasElement-based FunctionType source.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21375

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41254 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-23 04:24:59 +00:00
scheglov@google.com 68831585dd Fix for renaming import without an import prefix.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41021 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 16:25:07 +00:00
scheglov@google.com 53fe3d983f Issue 21233. Improve inlining strings into string interpolations.
R=brianwilkerson@google.com, paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21233

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40963 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 17:21:40 +00:00
scheglov@google.com 6a3f946ec4 Fix for 'Extract Local' refactoring - take into account local variable elements.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40823 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 20:16:40 +00:00
scheglov@google.com f4aabfb6e1 Issue 21071. Generate posix-style relative URIs.
But parse using the target file system's Context.

R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=21071

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40655 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-24 22:22:57 +00:00
scheglov@google.com 077de1fb02 'Convert Getter to Method' refactoring implementation.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40574 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 21:55:15 +00:00
scheglov@google.com bb4bd6d889 'Convert Method to Getter' refactoring implementation.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40541 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 14:53:19 +00:00
scheglov@google.com 66c1b3aacc Issue 18296. Harden the name checks.
Don't allow to use invalid names in refactorings.

R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=18296

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40521 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 20:53:05 +00:00
scheglov@google.com eb0fde9cf3 Try to restore 'package:' URI reference to the file being moved.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40519 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 20:28:18 +00:00
scheglov@google.com 604a9e760d Integration of MOVE_FILE into the server and a couple of fixes.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40510 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 18:10:56 +00:00
scheglov@google.com cb8c9c654d Move file refactoring implementation.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40500 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 16:23:14 +00:00
scheglov@google.com 7fde5deecc Send final problems even if 'validateOnly'.
Also fix for reporting duplicate 'Rename Local' shadowing warnings.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40332 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 17:48:19 +00:00
scheglov@google.com 3d6fff5735 Issue 18926. Rename refactoring for labels.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=18926

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40259 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 17:48:09 +00:00
scheglov@google.com caf4b0476e Issue 18895. Convert an expression function body into the block function body when Extract Local.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=18895

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40250 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 15:28:31 +00:00
scheglov@google.com 210a4459b2 Issue 20358. Don't report referenced names of named parameters in named expressions as possible shadowing.
R=paulberry@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=20358

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40240 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 14:48:36 +00:00
scheglov@google.com 59eac1e533 Issue 19800. Support for inlining getters/setters.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=19800

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40230 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-14 03:17:55 +00:00
scheglov@google.com 8269bc67c3 Issue 19801. Fix for inlining referenced function with an expression body.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=19801

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40214 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-12 19:41:59 +00:00
scheglov@google.com 778536d97c Issue 19682. New analyzer snapshot that fixes an inline refactoring problem.
R=brianwilkerson@google.com
BUG= https://code.google.com/p/dart/issues/detail?id=19682

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40193 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 22:47:29 +00:00
scheglov@google.com 19f017660a Return a feedback for the INLINE_METHOD refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39993 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 19:56:26 +00:00
scheglov@google.com c0c0b51188 Send feedback for the INLINE_LOCAL_VARIABLE refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39981 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 17:33:09 +00:00
scheglov@google.com 3661df5b0e Include additional information into RenameFeedback.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39918 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 16:39:15 +00:00
scheglov@google.com 43b0e2d584 Use unit + offset as 'Inline Local' arguments.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39821 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 18:45:18 +00:00
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
scheglov@google.com 4213f465fe Fix for 'returnType' when extract a method with a single expression.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39778 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 21:51:21 +00:00
scheglov@google.com 43e1872038 Impements 'names', 'offsets' and 'lengths' for ExtractMethodRefactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39768 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 19:35:48 +00:00
scheglov@google.com 3d5ea37050 'Inline Method' refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39719 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-31 16:43:43 +00:00
scheglov@google.com ca869c6d27 Tweaks for refactoring tests.
Mostly the push of 'assertSuccessfulRefactoring' into abstract RefactoringTest.

R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39658 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-28 15:15:17 +00:00
scheglov@google.com 2a7e871aab 'Inline Local' refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39656 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-28 15:10:11 +00:00
scheglov@google.com df2dc27f50 Parameters and validation for the 'Extract Method' refactoring.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39538 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 05:48:15 +00:00
scheglov@google.com 96a0c295ac Initial 'Extract Method' refactoring implementation.
R=brianwilkerson@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39520 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-25 15:38:00 +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
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 fd11028816 Make RefactoringStatus a collection of generated RefactoringProblems.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39494 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-22 14:45:33 +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 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
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
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
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