Kevin Moore
ca4978e363
Add pkg:analysis_tool as an SDK-only set of utils
...
Reduces the API surface of pkg:analyzer that requires pkg:html
Related to https://github.com/dart-lang/sdk/issues/35802
Change-Id: Icd08d76190d6ab77cd180561cdde6df254b22557
Reviewed-on: https://dart-review.googlesource.com/c/91701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Kevin Moore <kevmoo@google.com >
2019-01-31 16:52:05 +00:00
Brian Wilkerson
47e988b781
Clean up the remaining copyright notices in analysis_server
...
Change-Id: Iee3110f92ab0f24312ddd1eff407d2229f895321
Reviewed-on: https://dart-review.googlesource.com/c/89101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2019-01-11 15:38:56 +00:00
Dan Rubel
3dc911909b
Generate analysis_server_client protocol_generated.dart and related protocol files
...
Change-Id: I9a9af0ee37eab87a5c3e83cba638d855a2e1121b
Reviewed-on: https://dart-review.googlesource.com/c/81341
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-10-24 17:09:39 +00:00
Peter von der Ahé
eb0ec965e3
Move codegen/tools.dart to package:analyzer
...
Change-Id: Iab61e0dfcdd0969d1bf35e27c13c336a944d14e6
Reviewed-on: https://dart-review.googlesource.com/c/77780
Commit-Queue: Peter von der Ahé <ahe@google.com >
Auto-Submit: Peter von der Ahé <ahe@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2018-10-03 07:41:43 +00:00
Brian Wilkerson
602a8c2a7b
Clean up usage of deprecated constants
...
Change-Id: I9005ba6e94529e15d8f7b21322591f4a9dabec47
Reviewed-on: https://dart-review.googlesource.com/45763
Commit-Queue: William Hesse <whesse@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2018-03-09 01:02:49 +00:00
Konstantin Shcheglov
f78d43c3d3
Convert GeneratedContent to async and use AnalysisDriver for tasks graph.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review-Url: https://codereview.chromium.org/3002293003 .
2017-08-26 07:51:34 -07:00
Brian Wilkerson
7e11a13cf5
Add requestTime to responses
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2890163004 .
2017-05-18 10:32:47 -07:00
Brian Wilkerson
fb982f5476
Make server use the common protocol classes
...
R=danrubel@google.com
Review-Url: https://codereview.chromium.org/2879273002 .
2017-05-15 09:35:46 -07:00
Brian Wilkerson
e55812a3f2
Unify the server and plugin versions of the generators
...
R=devoncarew@google.com
Review-Url: https://codereview.chromium.org/2844273003 .
2017-04-28 07:46:29 -07:00
Devon Carew
a231501692
Format generated files.
...
BUG=
R=brianwilkerson@google.com , jacobr@google.com
Review-Url: https://codereview.chromium.org/2765953002 .
2017-03-21 15:54:16 -07:00
Paul Berry
c78b4d66bb
Move some of analyzer's code generation utilities into front_end.
...
These utilities are needed for generating the code that supports
summaries; in order to move summary logic into front_end, we will need
these code generation tools in front_end as well.
Also make a minor change to summary code generation logic so that it
talks to the file system directly rather than depending on analyzer's
file system abstraction.
R=brianwilkerson@google.com
Review-Url: https://codereview.chromium.org/2742333005 .
2017-03-14 12:30:18 -07:00
Brian Wilkerson
fb5e367ca5
Update server generator
...
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2668733002 .
2017-01-31 08:26:10 -08:00
Brian Wilkerson
15663c6148
Generate more type information to make strong mode happy
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/2470863002 .
2016-11-01 11:20:44 -07:00
Brian Wilkerson
cbcb689184
Fix the way generated code is made strong mode clean
...
R=paulberry@google.com
Review URL: https://codereview.chromium.org/1849973002 .
2016-03-31 13:43:07 -07:00
Brian Wilkerson
301a6a4725
Fix generated server code to be strong mode compliant
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1852473002 .
2016-03-31 10:44:42 -07:00
Brian Wilkerson
0d743fbacf
Start making server strong mode clean
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1842063003 .
2016-03-31 08:27:05 -07:00
Paul Berry
ac5578d03d
Refactor analysis server code generation to re-use logic from analyzer.
...
The code generation infrastructure logic is now shared.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1431683002 .
2015-11-02 16:18:03 -08:00
Brian Wilkerson
27eb09033f
Clean up wording of client usage expectations
...
R=paulberry@google.com
Review URL: https://codereview.chromium.org/1409353002 .
2015-10-19 07:46:49 -07:00
Brian Wilkerson
9ad256cf18
Move the wire protocol support into the public API
...
R=paulberry@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org/1398293002 .
2015-10-11 07:34:28 -07:00
Brian Wilkerson
42d1d4532d
Reformat code to minimize churn
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org//1310263003 .
2015-09-09 08:19:18 -07:00
Guillermo López-Anglada
3193083293
remove dead code
...
Fixes #24037
2015-08-14 15:32:35 +02:00
Brian Wilkerson
15a0f755e8
Improve error messages for invalid requests
...
R=paulberry@google.com
Review URL: https://codereview.chromium.org//1246573002 .
2015-07-20 10:23:01 -07:00
nweiz@google.com
70a846ad6c
Update pubspecs and dependencies to get pkgbuild tests working.
...
This also removes the vendored copy of Angular, which was an outdated version of
an unstaffed branch.
R=pquitslund@google.com
Review URL: https://codereview.chromium.org//1058283006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45410 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 20:08:53 +00:00
paulberry@google.com
cd1dd1864b
Fix additional cases where analysis server might send null, violating protocol.
...
In addition, modify the code generation so that these protocol
violations will be caught by assertions during unit tests.
Previously, they would only be caught at runtime by client code.
R=brianwilkerson@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org//1083223003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45211 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 15:41:39 +00:00
brianwilkerson@google.com
cd58e290c4
Reformat
...
R=paulberry@google.com
Review URL: https://codereview.chromium.org//969113002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44151 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 22:43:12 +00:00
brianwilkerson@google.com
09b93c2416
Support code generation for other languages
...
R=paulberry@google.com
Review URL: https://codereview.chromium.org//863883004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43144 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 19:35:48 +00:00
brianwilkerson@google.com
0b975704b5
Alternate status page
...
R=paulberry@google.com
Review URL: https://codereview.chromium.org//840953008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43020 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 18:46:44 +00:00
scheglov@google.com
b8da9bc651
Format and sort analyzer and analysis_server packages.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//725143004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41792 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-17 22:23:53 +00:00
paulberry@google.com
31310ceea4
Test that analysis server and analysis engine enums properly match.
...
R=brianwilkerson@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org//647563002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41029 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 21:53:05 +00:00
scheglov@google.com
e9e0694e2f
Remove references to Engine classes from protocol.dart
...
R=brianwilkerson@google.com , paulberry@google.com , danrubel@google.com
BUG=
Review URL: https://codereview.chromium.org//628293004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40948 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 00:24:48 +00:00
paulberry@google.com
1f50bf550a
Remove special list behavior in analysis server protocol.
...
Previously, for optional lists, the absence of a list was treated by
the toJson and fromJson methods as equivalent to the presence of an
empty list. This disagreed with the API documentation in several
places and created the risk of null reference exceptions in clients.
This change makes optional lists behave just like optional fields of
any other type.
BUG=dartbug.com/21230
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//625413002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40939 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-06 16:32:14 +00:00
paulberry@google.com
1363c77a02
Change integration test send...() methods to return structured objects.
...
This allows us to use completions when analyzing responses from the
server in integration tests.
R=brianwilkerson@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org//628783002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40909 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-04 17:37:47 +00:00
paulberry@google.com
a5e47c8eb2
Change integration test send...() methods to use structured objects.
...
This is less error prone than using raw JSON, and requires less effort
when writing integration tests.
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//621383002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40904 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-03 18:52:47 +00:00
scheglov@google.com
ac5e10b501
Push add*Edit helpers into SourceChange.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org//580273002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40464 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-18 21:20:37 +00:00
scheglov@google.com
457050dd88
Add SourceFileEdit.time field.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org//574573002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40329 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 17:19:37 +00:00
scheglov@google.com
67cd1ab0e2
Decode RefactoringFeedback automatically.
...
The implementation is pretty ugly though.
1. I have to add Response into ResponseDecoder.
2. I have to hack EditGetRefactoringParams.fromRequest generation to feel the "id to kind" map.
It would be easier if we decided to return 'kind' in responses.
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org//541823004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39887 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 21:13:24 +00:00
scheglov@google.com
3ddecb8c64
Use typed RefactoringOptions in the Dart version of the protocol.
...
R=jwren@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org//537733002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39875 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 16:21:08 +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
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
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
paulberry@google.com
10fdb7677a
Change analysis server protocol to omit empty lists when optional.
...
For object fields of type List that are marked as optional, FromJson
code automatically populates the data structure with an empty list
when the field is omitted. ToJson code automatically omits the field
when its value is an empty list.
R=brianwilkerson@google.com , scheglov@google.com
Review URL: https://codereview.chromium.org//482573004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39507 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-23 18:03:34 +00:00
scheglov@google.com
39a38da0e7
Move Location factories and RefactoringProblemSeverity.max into the generated classes.
...
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org//462403005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39499 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-22 17:27:19 +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
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
paulberry@google.com
e4a9df7b12
Don't use "final" in analysis server protocol classes.
...
Doing so makes it harder to use these classes because we sometimes don't have
complete information about an object at the time we need to create it.
R=jwren@google.com
Review URL: https://codereview.chromium.org//495623002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39420 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 18:53:26 +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
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
81e274fccb
Analysis server code generation improvements
...
- Make generated code implement the HasToJson interface.
- Add toRequest() convenience methods to classes representing request
parameters.
- Fix toJson() for objects containing lists (forgot to call toList()).
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org//483393002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39375 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 18:26:42 +00:00