Skip to content

Commit

Permalink
Add signature information to spec and add basic implementation for fu…
Browse files Browse the repository at this point in the history
…nctions

Bug: #27034
Change-Id: I8d3f1a9c9a824b4b80f9cfa0370a439fa897b226
Reviewed-on: https://dart-review.googlesource.com/64689
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
  • Loading branch information
DanTup authored and commit-bot@chromium.org committed Jul 25, 2018
1 parent 80f851a commit ebb033c
Show file tree
Hide file tree
Showing 20 changed files with 1,374 additions and 2 deletions.
14 changes: 14 additions & 0 deletions pkg/analysis_server/doc/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ <h2 class="domain"><a name="domain_analysis">analysis domain</a></h2>






<h3>Requests</h3><dl><dt class="request"><a name="request_analysis.getErrors">analysis.getErrors</a></dt><dd><div class="box"><pre>request: {
Expand Down Expand Up @@ -4242,6 +4243,19 @@ <h2 class="domain"><a name="types">Types</a></h2>
which does not match a file currently subject to
analysis.
</p>
</dd><dt class="value">GET_SIGNATURE_INVALID_FILE</dt><dd>

<p>
An "analysis.getSignature" request specified a FilePath
which does not match a file currently subject to
analysis.
</p>
</dd><dt class="value">GET_SIGNATURE_UNKNOWN_FUNCTION</dt><dd>

<p>
An "analysis.getSignature" request specified an offset
that could not be matched to a function call.
</p>
</dd><dt class="value">IMPORT_ELEMENTS_INVALID_FILE</dt><dd>

<p>
Expand Down
19 changes: 19 additions & 0 deletions pkg/analysis_server/lib/protocol/protocol.dart
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,25 @@ class Response {
RequestErrorCode.GET_REACHABLE_SOURCES_INVALID_FILE,
'Error during `analysis.getReachableSources`: invalid file.'));

/**
* Initialize a newly created instance to represent the
* GET_SIGNATURE_INVALID_FILE error condition.
*/
Response.getSignatureInvalidFile(Request request)
: this(request.id,
error: new RequestError(RequestErrorCode.GET_SIGNATURE_INVALID_FILE,
'Error during `analysis.getSignature`: invalid file.'));

/**
* Initialize a newly created instance to represent the
* GET_SIGNATURE_UNKNOWN_FUNCTION error condition.
*/
Response.getSignatureUnknownFunction(Request request)
: this(request.id,
error: new RequestError(
RequestErrorCode.GET_SIGNATURE_UNKNOWN_FUNCTION,
'Error during `analysis.getSignature`: unknown function.'));

/**
* Initialize a newly created instance to represent the
* IMPORT_ELEMENTS_INVALID_FILE error condition.
Expand Down
8 changes: 8 additions & 0 deletions pkg/analysis_server/lib/protocol/protocol_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ const String ANALYSIS_REQUEST_GET_NAVIGATION_OFFSET = 'offset';
const String ANALYSIS_REQUEST_GET_REACHABLE_SOURCES =
'analysis.getReachableSources';
const String ANALYSIS_REQUEST_GET_REACHABLE_SOURCES_FILE = 'file';
const String ANALYSIS_REQUEST_GET_SIGNATURE = 'analysis.getSignature';
const String ANALYSIS_REQUEST_GET_SIGNATURE_FILE = 'file';
const String ANALYSIS_REQUEST_GET_SIGNATURE_OFFSET = 'offset';
const String ANALYSIS_REQUEST_REANALYZE = 'analysis.reanalyze';
const String ANALYSIS_REQUEST_REANALYZE_ROOTS = 'roots';
const String ANALYSIS_REQUEST_SET_ANALYSIS_ROOTS = 'analysis.setAnalysisRoots';
Expand Down Expand Up @@ -94,6 +97,11 @@ const String ANALYSIS_RESPONSE_GET_NAVIGATION_FILES = 'files';
const String ANALYSIS_RESPONSE_GET_NAVIGATION_REGIONS = 'regions';
const String ANALYSIS_RESPONSE_GET_NAVIGATION_TARGETS = 'targets';
const String ANALYSIS_RESPONSE_GET_REACHABLE_SOURCES_SOURCES = 'sources';
const String ANALYSIS_RESPONSE_GET_SIGNATURE_DARTDOC = 'dartdoc';
const String ANALYSIS_RESPONSE_GET_SIGNATURE_NAME = 'name';
const String ANALYSIS_RESPONSE_GET_SIGNATURE_PARAMETERS = 'parameters';
const String ANALYSIS_RESPONSE_GET_SIGNATURE_SELECTED_PARAMETER_INDEX =
'selectedParameterIndex';
const String ANALYTICS_REQUEST_ENABLE = 'analytics.enable';
const String ANALYTICS_REQUEST_ENABLE_VALUE = 'value';
const String ANALYTICS_REQUEST_IS_ENABLED = 'analytics.isEnabled';
Expand Down

0 comments on commit ebb033c

Please sign in to comment.