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
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
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
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
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
96737787e2
Add LSP spec code-gen output
...
Change-Id: Ib1f72b064172153bd677b3ac33ac12ed02b28f47
Reviewed-on: https://dart-review.googlesource.com/c/79207
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Danny Tuppeny <dantup@google.com >
2018-10-11 15:54:14 +00:00