Commit Graph

52 Commits

Author SHA1 Message Date
Konstantin Shcheglov 6e17841614 Macro. Remove tests from analyzer/ and analysis_server/.
Change-Id: Iabe04d7ff8fe0cc9b605d0c18fd47591fd02d6bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406681
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-29 14:58:19 -08:00
Devon Carew 8d6ad53c7e [pkg/analysis_server] remove use of package:usage
Change-Id: I3a18670b6131f4e8c445217f1b302e64a74f591c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365489
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-05-07 22:11:29 +00:00
Danny Tuppeny c3d80286fe [analysis_server] Add a supportsUris client capability for legacy server to switch into URI mode
This adds support for the legacy server to switch to URIs using a client capability. In this mode, all "FilePaths" will be URI strings over the protocol (in both directions).

It also allows the server to send LSP notifications (wrapped inside an "lsp.notification" notification, matching how requests/responses work). Notifications are automatically enabled if the client uses any LSP methods or sends the new "supportsUris" capability.

Change-Id: I5d2b76e396862129c61de70d57397603c958a02d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349120
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-02-01 22:19:00 +00:00
Danny Tuppeny 76dc2c4cfa [analysis_server] Change LSP-over-Legacy to be wrapped with the original protocol
Originally we didn't use the LSP Request/Response classes, and just exposed the handlers through the legacy request/response.

However there were some mismatches (such as legacy protocol always returns Map<String, Object?> but some LSP requests return Lists, LSP using int|String IDs, and LSP having numeric error codes that don't match legacy string error codes).

This change uses LSP's request and Response by wrapping them inside a standard (legacy) handler. The LSP-over-Legacy handler has become a standard handler, and the params contain an "lspMessage" field that holds an LSP message, and the result contains an "lspResponse" field that contains an LSP response.

If an LSP handler returns an error, it will be returned as an error inside the LSP response, which will be in a _successful_ legacy request (since that's how we can return an LSP response - as the result).

Change-Id: I67973590ab32f3543d1a6e1b7279974e5e8832bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315201
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-06 14:32:18 +00:00
Brian Wilkerson 3a7c7909a2 Specify the message request for the legacy protocol
Change-Id: Iecfa9228f3f17451da3efb403f54a3be17166353
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289541
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-20 19:26:07 +00:00
Konstantin Shcheglov 671bb192ab Remove domain 'kythe' from DAS.
Change-Id: I66f0e538dce6eead6ba1c98b9cf0e3d747450130
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264895
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-10-21 17:03:29 +00:00
Brian Wilkerson 4eaf2d68cd Add a new request to format all of the files in a directory
This is marked as experimental, and is only intended to be used by
`dart fix` as a way of formatting the files that were modified if the
analysis options file indicates that they ought to be formatted.

Change-Id: I288baebfc7cb3f82cc361bdc19835e43064eb0d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-28 17:13:40 +00:00
Danny Tuppeny 30e4510f20 [analysis_server] Add a server.cancelRequest request for cancelling outstanding requests
Change-Id: I1b43b0e61e5cc89261170ce13613fad756600d97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222201
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-12-09 17:39:43 +00:00
Konstantin Shcheglov 4487759dd2 Document new DAS completion APIs.
Change-Id: I2ff1f2c494033a62fead7d828d5d875b55eda203
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215643
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-21 18:21:35 +00:00
Brian Wilkerson 38c1d4aaf8 Remove support for the deprecated dartfix tool
Change-Id: I848334cab0dbebe121198bc91ade3a8f68c5f7b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-07-02 18:30:24 +00:00
Brian Wilkerson a00530b46f Remove unused support for requesting token details
Change-Id: I9cc160d84e06b4b7be67e53962fe38c1430e74b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180762
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-24 05:11:48 +00:00
pq 3d5df93fb1 bulk fix protocol
Change-Id: Id8505d5ad6f0f3d1c5289ab12d4932c6174f72e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-07-10 14:20:07 +00:00
Konstantin Shcheglov a2e9af92d2 Protocol for 'server.log' notification.
R=brianwilkerson@google.com

Change-Id: Ifed9a0f04ee961b217643b7236fce7a0067664cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114607
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-29 22:33:33 +00:00
Konstantin Shcheglov a917043332 APIs for editing Flutter widget properties.
Change-Id: I602ea1a873f17a9bf47f1a77fb3af5b206464d6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108663
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-07-11 20:38:24 +00:00
Konstantin Shcheglov 4979a51a9c Add information about existing imports to completion response.
This adds quite a lot of information though, because we send many
strings.

Before: 20686 characters.
After:  55345 characters.

Theoretically we could do better, and send information about existing
imports only once as well, so when the user continues typing in a
single file, without touching imports, we don't send any new data
about imports (maybe just a confirmation that it is still the same).
But I'm not sure if this is a worthwhile optimization.

Actually, even included suggestion sets have similar property - they
don't change for a given file, unless there are changes to other
libraries which we might want to include.

R=brianwilkerson@google.com

Change-Id: I2f55e2dc85508849146aa39eb279beabaec937c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103561
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 21:35:06 +00:00
Brian Wilkerson 6498a3e357 Add some tests of the listTokenDetails request
Change-Id: I5dc2ae390777454128f18bef95bb00dcbce18f66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-25 18:41:14 +00:00
lambdabaa 1c27b817fc New protocol to inspect analysis server state at code completion time
This change adds a new, experimental completion domain request
`completion.listTokenDetails`. Its purpose is to allow
other programs to observe and make smarter decisions contingent
upon analyzer's internal knowledge of a Dart program.

Bug: 36083
Change-Id: I5ab477221efeac076eccc873a29cf6feae91052e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95100
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-04 20:33:44 +00:00
danrubel 3afc3b58d0 Add dartfix protocol integration tests
... and address comments in https://dart-review.googlesource.com/c/sdk/+/91780

Change-Id: Ibd01a0de575065cf18822b806a9c687de2667add
Reviewed-on: https://dart-review.googlesource.com/c/92243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-07 06:21:57 +00:00
lambdabaa d4b8e0696d Add the capability in analysis server protocol for clients to express
interest in receiving not yet imported code completions from specific
packages and libraries.

The design of this interaction aims to avoid forcing analysis server
to send every public symbol from dependent packages at every completion.
Instead, clients express interest in certain packages and/or libraries
and analysis server will notify with the entire set of symbols for
each of them only once. Then it is the client's responsibility to save
these pre-computed completions in memory, and analysis server can
instruct the client on how to union them with the base set of completion
suggestions at code completion time.

Bug: https://github.com/dart-lang/sdk/issues/35680
Change-Id: I42c6fddc5d8daa2b546daa81456c0992e3ef547d
Reviewed-on: https://dart-review.googlesource.com/c/90125
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 19:56:18 +00:00
danrubel db44a727e5 Extend the edit.dartfix protocol
This CL extends the dartfix protocol to allow specifying which
fixes should be applied. In summary:

* includedFixes - list of fix names to be applied
* includeRequiredFixes - bool indicating required fixes should be applied
* excludedFixes - list of fix names that should not be applied

Given that the client can specify the fixes to be included/excluded,
then the dartfix cmdline help text should include the list of known fixes.
Rather than hard code this in the dartfix client, a new edit.getDartfix
request has been added to return the list of known fixes.

Change-Id: I319f6f405a5d29757bf28b70b778a449f901bbef
Reviewed-on: https://dart-review.googlesource.com/c/91700
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-31 01:53:32 +00:00
Dan Rubel c624f8b0a9 First cut dartfix protocol
and address comments in https://dart-review.googlesource.com/c/sdk/+/76320

Change-Id: I5c7ab40810d4116b1d36de90b7234d0a932bae82
Reviewed-on: https://dart-review.googlesource.com/76400
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-25 16:56:48 +00:00
Danny Tuppeny ebb033cb72 Add signature information to spec and add basic implementation for functions
Bug: https://github.com/dart-lang/sdk/issues/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>
2018-07-25 07:16:52 +00:00
Konstantin Shcheglov e3966fcfb9 Protocol for runtime completion.
This protocol will be used to support "Evaluate Expression" and "Watch"
window features in IDEs.

Change-Id: Ibde1e88507a66d8c487836a227dfeb13ffd77d9d
Reviewed-on: https://dart-review.googlesource.com/54629
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-11 22:23:42 +00:00
Konstantin Shcheglov 6e25b9b2d3 Add flutter.getChangeAddForDesignTimeConstructor to API.
R=brianwilkerson@google.com

Change-Id: I91e40c447d32e603026de337ec2d36983174a8cd
Reviewed-on: https://dart-review.googlesource.com/49826
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-06 02:40:00 +00:00
Konstantin Shcheglov 8fa5567edb API for search.getElementDeclarations.
The goal is to provide clients (specifically VS Code) with API that
is fast, and can search top-level and class member declarations.

I'm not sure whether we want ElementKind, it has kinds that we will
not use, e.g. I don't think we will return local variables or
parameters.

It would be probably still a lot of information, maybe we should use
single string table in response?

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/29510
Change-Id: Ie31bb398a08d462c1cb08c7d82c4443c0c09932a
Reviewed-on: https://dart-review.googlesource.com/42105
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-17 04:27:52 +00:00
Konstantin Shcheglov 402af4db46 Add a new experimental 'flutter' domain and move FLUTTER_OUTLINE there.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I8f829f10a630e38c5a3f1638d077e37832a08daa
Reviewed-on: https://dart-review.googlesource.com/36320
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-23 00:57:55 +00:00
Konstantin Shcheglov a971aa8472 Add basic Flutter outline subscription/notification to the protocol.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I50d7e4507c58854b4f2afc6048285c68ee873b8b
Reviewed-on: https://dart-review.googlesource.com/36024
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-19 23:22:17 +00:00
Brian Wilkerson 37042bb59b Add an integration test for kythe support with bug fixes
R=jwren@google.com

Review-Url: https://codereview.chromium.org/3006693002 .
2017-08-28 10:07:04 -07:00
Jaime Wren 305e84f70a Fix the buildbots by adding a line for kythe.getKytheEntries to the coverage.md file
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2993353002 .
2017-08-09 13:40:09 -07:00
Devon Carew 973d0e1bd1 Add analysis server notifications to the api coverage doc.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/3000563002 .
2017-08-09 10:28:35 -07:00
Brian Wilkerson d9754a58e9 Initial implementation of copy/paste support
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2972833002 .
2017-07-05 14:02:07 -07:00
Brian Wilkerson 8c8a177f3c Fix failing test (TBR)
Review-Url: https://codereview.chromium.org/2964343002 .
2017-07-01 12:55:17 -07:00
Steve Messick 8c50e08e64 Add integration tests for postfix serer api
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2961683002 .
2017-06-26 13:13:21 -07:00
Steve Messick 4c8e1b9132 Update coverage.md
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2960683002 .
2017-06-26 11:21:50 -07:00
Brian Wilkerson 4da8380881 Convert more tests to use the new driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2939803002 .
2017-06-13 12:04:25 -07:00
Devon Carew 511963d715 Add an analytics domain to the analysis server.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2922603002 .
2017-06-02 14:38:53 -07:00
Devon Carew 3d2d913969 Add analysis server integration tests.
BUG=
R=brianwilkerson@google.com, messick@google.com

Review-Url: https://codereview.chromium.org/2909823002 .
2017-05-27 15:55:53 -07:00
Devon Carew d02519aec4 Make the analysis server integration tests driver only.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2820893002 .
2017-04-17 11:23:38 -07:00
Devon Carew fb4828d2e1 Add integration tests for edit.getAssists and edit.getFixes.
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2812483002 .
2017-04-10 07:50:12 -07:00
Devon Carew e572bf93ec Add 4 integration tests for the analysis domain.
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2808623002 .
2017-04-08 20:56:00 -07:00
Steve Messick 543d0dc20e Update coverage testing
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2780393004 .
2017-03-30 11:15:55 -07:00
Devon Carew a83e7fd18e Add analysis server integration tests for the search domain.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2747893004 .
2017-03-13 17:06:13 -07:00
Devon Carew 25dfd0fa80 Deprecate execution.setSubscriptions.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2713513007 .
2017-02-24 11:01:00 -08:00
Devon Carew fbb613a3fe Update the statuses of various analysis server integration tests.
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2717523003 .
2017-02-23 14:23:55 -08:00
Devon Carew 7f83d9d173 Add a diagnostic.getServerPort analysis server request.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2703033002 .
2017-02-19 15:19:40 -08:00
Devon Carew 7c7c895345 Add an integration test for execution.setSubscriptions.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2703723002 .
2017-02-17 07:41:03 -08:00
Devon Carew 5e0710617d Tests for analysis.navigation.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2696323004 .
2017-02-16 14:35:20 -08:00
Devon Carew 3a345935bf Add tests for edit.sortMembers and edit.organizeDirectives.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2700563003 .
2017-02-15 16:15:10 -08:00
Devon Carew b1bc83b6d2 Add an integration test for edit.format.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2695253002 .
2017-02-15 07:23:21 -08:00
Devon Carew 90bd4652aa Add an integration test for diagnostics.getDiagnostics.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2697833005 .
2017-02-14 14:36:38 -08:00