Commit Graph

396 Commits

Author SHA1 Message Date
Danny Tuppeny 2dbf91ff13 Add support for parsing Maps from the LSP spec
Change-Id: Ieafcacb3ba2f6be8d3232025d22fa5ec94de5352
Reviewed-on: https://dart-review.googlesource.com/c/85768
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-12-04 14:27:19 +00:00
Danny Tuppeny 0a7cf2a513 Allow nulls for union values where the field can be null or undefined
Change-Id: If0fea932c1534e8a6a151e67b16ad78cb14ec98d
Reviewed-on: https://dart-review.googlesource.com/c/85743
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-12-03 16:34:16 +00:00
Paul Berry 5b00611568 Revert "Add AnalysisDriver.resetUriResolution() and use it for analysis.reanalyze request."
This reverts commit 3428cc6dae.

Reason for revert: Unintentional breaking API change

Original change's description:
> Add AnalysisDriver.resetUriResolution() and use it for analysis.reanalyze request.
> 
> This CL changes "analysis.reanalyze" API. We decided to repurpose it. It was not
> used for some time now in IntelliJ, and AFAIK has never been used in VS Code.
> 
> R=​brianwilkerson@google.com, paulberry@google.com
> 
> Change-Id: I7510b0189197c9f3f848b0fc59a7b2bd22889ac7
> Reviewed-on: https://dart-review.googlesource.com/c/85523
> Reviewed-by: Paul Berry <paulberry@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I6a3e874278f4cf976363a0c7f80f7a65a0a03acf
Reviewed-on: https://dart-review.googlesource.com/c/85723
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-11-30 21:03:30 +00:00
Konstantin Shcheglov 3428cc6dae Add AnalysisDriver.resetUriResolution() and use it for analysis.reanalyze request.
This CL changes "analysis.reanalyze" API. We decided to repurpose it. It was not
used for some time now in IntelliJ, and AFAIK has never been used in VS Code.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I7510b0189197c9f3f848b0fc59a7b2bd22889ac7
Reviewed-on: https://dart-review.googlesource.com/c/85523
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-29 19:08:30 +00:00
Danny Tuppeny a354fd99a8 Add LSP support for flat symbol lists for older clients
Change-Id: Id74b34ea295a6733b374a820c6d596a11070f666
Reviewed-on: https://dart-review.googlesource.com/c/85561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-11-29 16:37:38 +00:00
Danny Tuppeny be6593e5c6 Reduce params type from Either2<List<dynamic>, dynamic> to just dynamic
Nothing in the LSP spec supports arrays as params (let alone a union of a single item or array).

Since the new type is dynamic, this should be non-breaking even if LSP changes (though we'll want to put it back if we need to write a handler for something that accepts a union like this).

Change-Id: Id1af1d438fede94906ae76eaa8b9a959b0b62ccf
Reviewed-on: https://dart-review.googlesource.com/c/85396
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-28 08:20:07 +00:00
Danny Tuppeny 854c654c2d Fix LSP enum classes to use correct base types for value field
Change-Id: If7a009e37a6ff6b266de15b4c4949921e67fa3d9
Reviewed-on: https://dart-review.googlesource.com/c/85387
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-27 10:25:35 +00:00
Danny Tuppeny 285f7ddb1b Switch to using constants for LSP method names
Change-Id: I4fd1b4e192ec1d0e53a4b3d81e5fdb8c1bb40208
Reviewed-on: https://dart-review.googlesource.com/c/85380
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-26 17:01:29 +00:00
Danny Tuppeny 7f40d90544 Respect content formats when creating markup content
Change-Id: I7e76607d467887a8bcd58e89d70f91b3335f5f90
Reviewed-on: https://dart-review.googlesource.com/c/85165
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-26 10:35:17 +00:00
Danny Tuppeny 3cedae6f09 Change diagnostic.code to a simple String
Change-Id: Ieb23cda7c6f2c1dffb2e07e47dfe29ddc78f41de
Reviewed-on: https://dart-review.googlesource.com/c/85174
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-11-22 17:54:12 +00:00
Paul Berry b14b19e13c Merge commit '9e3d3cf765ba3f761b2507950039bcdd2dd3ece8' into analyzer 2018-11-15 09:17:48 -08:00
Dan Rubel bec2daba02 Cleanup analysis_server_client API
This reduces the client functionality and renames some
of the classes and methods in the API.

Specifically:
- rename Server to Client
- rename ServerConnectionHandler to ConnectionHandler
- rename Client.start to Client.startServer
- rename Client.stop to Client.stopServer
- rename Client.kill to Client.killServer
- extract behavior from Client into Listeners
- move some of the listeners into dartfix
- make several Client fields private
Change-Id: Ie71b0ac55b489099a848764251e8369c27f6ea2d
Reviewed-on: https://dart-review.googlesource.com/c/84460
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-15 15:06:55 +00:00
Danny Tuppeny 937e950fd2 Parse inline interfaces into types
Change-Id: I33c6d12d760b0e44505a34ad1b4cb77ffa0db0f3
Reviewed-on: https://dart-review.googlesource.com/c/84039
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-11-13 08:08:52 +00:00
Paul Berry 3ae0dcaa18 Merge commit '5ef1465c55be601f601e1f565c9b9d2f94d76aff' into analyzer
Conflicts:
	pkg/analysis_server/lib/src/analysis_server.dart
	pkg/analysis_server/lib/src/server/driver.dart
2018-11-12 06:39:27 -08:00
danrubel 552b25084e Generate NotificationHandler dartdoc and add server tests
Change-Id: Iec977015ae89e2a703e9013fb7b6969043554afc
Reviewed-on: https://dart-review.googlesource.com/c/84080
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-10 01:16:14 +00:00
Dan Rubel d502ba6014 Add new analysis_server_client handlers
* Make the NotificationHandler a mixin
  and move it to /lib/handlers

* Add new notification handler mixins
  - AnalysisCompleteHandler
  - ServerConnectedHandler

* Add Server.stop method

.. and address comments in
https://dart-review.googlesource.com/c/sdk/+/83180

Change-Id: I94ba657f20520ae4bb0e479a014c11509eeb9d2c
Reviewed-on: https://dart-review.googlesource.com/c/83520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-08 21:10:06 +00:00
Danny Tuppeny 9ee052fbeb Add toString/equals/hashCode
Change-Id: I54a07a61b00462a05a1382e598e77e8c177befc0
Reviewed-on: https://dart-review.googlesource.com/c/83741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-11-08 17:07:19 +00:00
Danny Tuppeny d5e853e0ce Improve parsing of LSP spec
Change-Id: Ica48b57c890105df346c5a133fe0389bd92dbb6e
Reviewed-on: https://dart-review.googlesource.com/c/83388
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-08 15:31:26 +00:00
Paul Berry be7983e148 Merge commit 'c24073f442e7c7b789894ad8210aff8accc36702' into analyzer 2018-11-07 07:37:12 -08:00
danrubel 7e6a39fd91 Generate analysis server notification handler
... and generate the analysis server protocol version

Change-Id: I585e50cc854d5ae1aa7440a14f856c983bbfc93a
Reviewed-on: https://dart-review.googlesource.com/c/83180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-06 23:04:53 +00:00
Paul Berry a4c73e3739 Merge commit '5226b5c307b04da8df96924a46780eb31a5bd75e' into analyzer 2018-11-02 06:06:20 -07:00
Dan Rubel 8c20adffe6 Increment analysis server protocol version
Change-Id: I470a51b035c765d710e920f3fe77dfa11a7aca92
Reviewed-on: https://dart-review.googlesource.com/c/82480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-01 19:17:04 +00:00
Danny Tuppeny 8852d36315 Add --lsp flag to analysis server and add basic Initialize handler
Change-Id: Iaf6c2a7cd56dea27233c4be1df2da900653e1822
Reviewed-on: https://dart-review.googlesource.com/c/81275
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-31 20:00:51 +00:00
Brian Wilkerson dee5e8a070 Convert more classes to mixins
Change-Id: I85bee426236a510305fc38a49b2f9348af7698df
Reviewed-on: https://dart-review.googlesource.com/c/82181
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-31 13:49:51 +00:00
danrubel 0fe448a996 Revise the analysis server edit.dartfix protocol
This updates the edit.dartfix protocol to separate location from the text
describing the changes so that the dartfix client can choose
what location information to display and how it should be displayed.

Change-Id: Ic56a4cb187538571d60136d6de9265d879fccb53
Reviewed-on: https://dart-review.googlesource.com/c/81780
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-29 01:50:27 +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
Dan Rubel 34d0801008 Generate analysis server protocol consts in analysis_server_client
Change-Id: I86c1f7ce98d2c1424c9b77c66fa48c6fa1ba354b
Reviewed-on: https://dart-review.googlesource.com/c/81340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-24 15:37:21 +00:00
Danny Tuppeny e4566d3dbd LSP: Fix nulls and missing fromJson calls in unions
Change-Id: I666d32e8a0463ba07756878b22293a7d3f55915d
Reviewed-on: https://dart-review.googlesource.com/c/81268
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-23 17:42:19 +00:00
Danny Tuppeny a394e4f492 Fix handling of JSON with interfaces nested within Unions
Change-Id: I926c2374860824db3ceae6d74286474feb730676
Reviewed-on: https://dart-review.googlesource.com/c/81100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-23 07:08:44 +00:00
Danny Tuppeny cddc2d42e1 Handle generic types in LSP spec parsing
The regex wasn't picking up generate type args (in interface definitions or usages in field definitions). This adds <> characters to the regex and handles them in mapping of types (as well as adds some additional tests to cover this).

Change-Id: I8187b3d2abb2b35c0d7638839e3116700cfbf9e0
Reviewed-on: https://dart-review.googlesource.com/c/81004
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-22 14:40:54 +00:00
Danny Tuppeny bb93696c96 Simplify canParse on LSP types to only check for required fields
Change-Id: Idafb6936f0dd7adf283a690c5e56e2eebfc53ee4
Reviewed-on: https://dart-review.googlesource.com/c/80666
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-18 14:55:39 +00:00
Danny Tuppeny 36551624e1 Implement fromJson() constructors for LSP types
Also add a canParse() method that can check whether some provided JSON can be decoded into that type (used for detecting with type from a union to decode as).
Support equality checks on unions and a valueEquals() helper
Remove brittle tests that do exact comparisons on generated code
Fix deserialisation of lists to be cast and toList()'d
Add a more complete JSON test that includes lists, enums

Change-Id: Id56fdad9b1454e540e55907e0ff2608263a87c40
Reviewed-on: https://dart-review.googlesource.com/c/80580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-18 13:52:59 +00:00
Danny Tuppeny 3039fb0031 Sort LSP files
No functional changes, this just sorts these files using edit.sortMembers to avoid having it mixed in with functional changes.

Change-Id: Ifb3a8cdf0ad20d4231d276aeb703b06a2da8aa2e
Reviewed-on: https://dart-review.googlesource.com/c/80443
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-18 06:17:57 +00:00
Danny Tuppeny 3a69805f6b Switch enums that don't have type aliases to stronger-typed values
Change-Id: Ia05c234c27c0c71bbb25ed29c3f7a0c02e938acb
Reviewed-on: https://dart-review.googlesource.com/c/80203
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-16 18:03:59 +00:00
Brian Wilkerson fade5f33f0 Regenerate code based on the server spec after updates to the generator
Change-Id: I3643bf8fb3732e3a664ae2bfdccc554fe4621a06
Reviewed-on: https://dart-review.googlesource.com/c/80262
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-16 16:47:59 +00:00
Danny Tuppeny 9ba152b69e Mark deprecated fields as such
Change-Id: Ifda0be1a8ab3824278994dc70002115fa82976e1
Reviewed-on: https://dart-review.googlesource.com/c/79841
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-16 15:57:16 +00:00
Danny Tuppeny de6f24367a Fix build from two incompatible changes landing
Change-Id: I4a8928deeb80cc6f923164db1c62ad77a1dd3e5f
Reviewed-on: https://dart-review.googlesource.com/c/80240
Commit-Queue: Danny Tuppeny <dantup@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-16 15:21:22 +00:00
Danny Tuppeny c0ec6299ad Extract enums from the spec
Most enums are represented as namespaces, but FoldingKind is an enum and was previously missed.

Change-Id: I597dfc073e79b9052a98898d3fff135bce56c424
Reviewed-on: https://dart-review.googlesource.com/c/80101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-16 14:41:30 +00:00
Danny Tuppeny ea72ba3b1d Move sorting from reading to codegen
Change-Id: I060e18851319cf7874a157b99fd019cd07169581
Reviewed-on: https://dart-review.googlesource.com/c/80102
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-16 14:40:56 +00:00
Danny Tuppeny 2084c5b2a9 Add toJson() methods
Change-Id: If5ffe3743c93100e012a2463fee3db37ab7d513d
Reviewed-on: https://dart-review.googlesource.com/c/79721
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-16 06:58:56 +00:00
Devon Carew abcb84ac78 Re-order the dartdoc param.
Change-Id: I06298f923c8e9f5d5c699cc02ec77e5cf12c5711
Reviewed-on: https://dart-review.googlesource.com/c/79820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-10-15 16:21:57 +00:00
Danny Tuppeny 311a184cb8 Remove type merging and the only instance that used it
Change-Id: I7b1f18073e4d204d0d92b531369888ec8f1f3dfb
Reviewed-on: https://dart-review.googlesource.com/c/79685
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-15 15:31:10 +00:00
Danny Tuppeny dd59921896 Support "{@link xxx}" in LSP spec
Change-Id: If2f0842b83f306ec0ae325fa4069e8089a84a13c
Reviewed-on: https://dart-review.googlesource.com/c/79684
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-15 15:09:00 +00:00
Danny Tuppeny 1f344e4ee0 Add support for "class" instead of interface
Change-Id: I37ebafd619b114687786baa44da1e7e11b5f0fa3
Reviewed-on: https://dart-review.googlesource.com/c/79760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-15 14:17:59 +00:00
Danny Tuppeny 88bde88112 Add constructors and mark all fields final
Change-Id: I7ab81c680956f80e6fb7a30bad2af35595baccef
Reviewed-on: https://dart-review.googlesource.com/c/79682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-15 14:05:25 +00:00
Danny Tuppeny e4842a293b Remove extra spaces in headers
Change-Id: I401ad4537e7a8c3ea4bc3f693cf45b5f7ef31267
Reviewed-on: https://dart-review.googlesource.com/c/79340
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-11 18:05:37 +00:00
Danny Tuppeny 2989116219 Add some special cases for types we can't/don't need to parse
Includes a fabricated base type for file operations to avoid a List of a Union.

Change-Id: I0ddc7c6428cc8f1535c3a8d7d0b042b1725969f3
Reviewed-on: https://dart-review.googlesource.com/c/79323
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-11 17:51:10 +00:00
Danny Tuppeny 931202df27 Improve wrapping of lists and *notes* in LSP spec comments
Change-Id: I32d9056e56a76588f9f26e36ebe040b0457dcd4d
Reviewed-on: https://dart-review.googlesource.com/c/79320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-11 17:30:30 +00:00
Danny Tuppeny 23e7f9d1eb Handle references to other classes in comments
Change-Id: I0a29355e0bbcb2a441dff90bc2cfc3475e8c1cd3
Reviewed-on: https://dart-review.googlesource.com/c/79321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-11 17:27:53 +00:00
Danny Tuppeny fc0decc262 Improvements to the Dart code generated from the LSP spec.
Working towards making it compile, free of lint errors, formatting correctly.

Change-Id: I61d5ed6e89fdf24c97079745a3816b1b303e2820
Reviewed-on: https://dart-review.googlesource.com/c/79201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-10-11 14:59:25 +00:00