Commit Graph

467 Commits

Author SHA1 Message Date
Jaime Wren 03e415a4e8 Update the hover 'containingLibraryName' to not include the 'file:///' prefix.
This is a follow up on a comment in the previous change https://dart-review.googlesource.com/c/sdk/+/103481/.

Change-Id: I0f377d6c7d68d55464a4e111a6a65715a82e0591
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103546
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-05-24 21:54:56 +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
Jaime Wren cd2188f2f5 DAS change in hover behavior- the containingLibraryName now returns the URI of the containing library instead of the (possibly non-existent) library name
Change-Id: Ief2a7615b92ca635c696d48f907677bae538577b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103481
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-23 19:06:19 +00:00
Danny Tuppeny 022adc5bc3 Implement using suggestion sets for LSP completions
Change-Id: I66d725c09492040be5e621d80270b12a21bb8192
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102704
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Danny Tuppeny 0f24e4b277 Wire up LSP completion resolution provider + sendWorkspaceEdit command
Change-Id: I424b4d9bbc64f6fea7a4d9b06e2180b3fbd21f86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Danny Tuppeny 7be23977f1 Minor LSP tweaks in preperation for included suggestionSets
Change-Id: I9dff56139754b8a182e906d64dd0bcc009c4b6fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Danny Tuppeny 6805bb52ea Add implementation/tests for textDocument/Implementation
Fixes https://github.com/dart-lang/sdk/issues/36896

Change-Id: Ie450c6c5257ac13aa3c7b48343aa8b015b1dc4d8

Tweak tests to require all, plus fix empty classes

Change-Id: Iefff7e24c6b965f0a1bc5abf8adbac26ad38e3a0

Add implementation/tests for textDocument/Implementation

Change-Id: I640379d83aeb9baa73d04d98d39147e2b748d6c3
Bug: https://github.com/dart-lang/sdk/issues/36896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102366
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-15 09:08:28 +00:00
Danny Tuppeny cdcc387084 Add LSP custom notifications for analyzing status
Change-Id: I0d26d274c9ccc472da81e45d0c9170104bbd9414
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102370
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-15 06:35:48 +00:00
Danny Tuppeny a779db0813 Update LSP spec to latest
Change-Id: I6f7ff3c6707f992aa618ad172e81857153b75795
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102360
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-13 15:11:15 +00:00
Jaime Wren 8de23bbbff Update the Dart Analaysis Server protocol to 1.26.1 to mark that the MOVE_FILE refactoring is now enabled. The functionality landed May 3rd, 2019 with https://dart-review.googlesource.com/c/sdk/+/101320
Change-Id: I7f33b73304a72db1375a6a21132dc8207cc784c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101630
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
2019-05-07 22:15:56 +00:00
Brian Wilkerson 9670b2ccb9 Update the server API to support context messages
Change-Id: Ic07ef7d01125ca76f72e8c0e370181ea4f6f7cb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100825
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2019-05-01 01:31:44 +00:00
Jaime Wren f8c1cc7c24 Update the output for the generated Outline.java to compile. Outline.java has a special fromJson() method special cased in codegen_java_types.dart that was not updated when fields were added to the protocol.
Change-Id: Ib78f8a81ea3b48d6ae821d89617d3c1b66e69fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99375
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-04-15 23:05:56 +00:00
Jaime Wren 067293b7fc Update the copyright year to 2019 before pushing DAS 1.26.0 version to the Dart plugin
Change-Id: I8a2e5de067d5ee5a1bd564e5738e990bf289e325
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99372
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-04-15 21:41:29 +00:00
Konstantin Shcheglov 7e28fc2cd6 Increment Analysis Server version to 1.26.0
R=brianwilkerson@google.com

Change-Id: I3121d8262bab8748fdd64a58178b7020607a2252
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-04 21:02:33 +00:00
Brian Wilkerson 7e5810ab30 Add an offset to the protocol used for import-on-paste
Change-Id: I87c50b2fee7643733b38a368b2c231e5fb7cddda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98681
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-04 16:18:43 +00:00
Brian Wilkerson da15746f4c Update the production of training data
Change-Id: Ib9634c5e5bdd8c0097f55a9cf71054e2a2b6a5fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98287
Reviewed-by: Ari Aye <ariaye@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-03 22:36:01 +00:00
Mike Fairhurst 1bbd282d65 Make analyzer/tool/summary/generate.dart take an IDL path
Change-Id: I919b6d92342076ed4420dcc4a5ee94853a35ed41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96240
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-27 16:08:47 +00:00
Brian Wilkerson 3a3731665f Initial implementation of server support for training data
Change-Id: I4943b8c30575e78c1028d9d0be174f535db99303
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97841
Reviewed-by: Ari Aye <ariaye@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-26 20:32:20 +00:00
Brian Wilkerson 11a148c85e Add the ability to associate a URL with a diagnostic
Change-Id: I06f694311130a36b1db4b4baf2e7d46d999f07b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97554
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-22 13:32:05 +00:00
Konstantin Shcheglov 4b609422e9 Make AVAILABLE_SUGGESTION_SETS and related APIs non-experimental.
R=brianwilkerson@google.com

Change-Id: I1facae905319f050636126b021f56f353f81d6f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95661
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-07 21:29:36 +00:00
Danny Tuppeny 53438199a4 Tweak version numbers in LSP readme
Change-Id: I9dfa1165d41115ef6f30fd0718c75c058e8c968a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95380
Auto-Submit: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-03-05 18:16:31 +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
Danny Tuppeny 0e9d97498c Add some notes on using Dart LSP with Vim
Change-Id: I5b77243e8d725ca9802db56b59692b6e8a847d9c
Reviewed-on: https://dart-review.googlesource.com/c/94207
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-27 12:08:32 +00:00
Danny Tuppeny f484e1b05e Call canParse() for all LSP requests before passing to handlers
Any requests with params that don't pass canParse() will result in an InvalidParams error being returned without the handler being invoked.

Change-Id: Ic3e84b9259a467179baa2309fb58ee207f1225fa
Reviewed-on: https://dart-review.googlesource.com/c/94298
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-02-27 08:12:02 +00:00
Danny Tuppeny 0e54ce3b2d Fix a canParse method that would overflow the stack
This method is (accidentally) not currently being called, but it will be soon. The codegen wasn't using the resolved base-type for the enum when writing the type check.

Change-Id: I025ed5109c70d8916f800295350a3f4eaf8f16f2
Reviewed-on: https://dart-review.googlesource.com/c/94294
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-27 08:12:02 +00:00
Danny Tuppeny 8fb52650e5 Ensure LSP canParse type-checks optional values
Previously we were only outputting the validation code if the value was required. This changes it to also validate in the case it's not required, but only if it's not-null.

Without this change, the test that parses `'overwrite': 1` fails (a boolean is expected), but with it, it passes.

Change-Id: Ic4afe1f6a8f78add2385831907b226022b7ecaec
Reviewed-on: https://dart-review.googlesource.com/c/94293
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-27 08:12:02 +00:00
Danny Tuppeny d1876531f2 Fix LSP canParse to allow nulls where the spec allows
Change-Id: I8a34fbf03e45c85a70d44a54b1715b87f84f9c3b
Reviewed-on: https://dart-review.googlesource.com/c/94290
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-27 08:12:02 +00:00
Danny Tuppeny a52ac7d27b Correct LSP canParse functions for classes containing restricted enums
This fixes a mistake where enum classes were resolved to their base types (string, num) before being output in canParse methods of their containing class. This meant for "restricted" enum types (those that should not allow any value), canParse would incorrectly return true for out-of-bound values as long as they were the correct type.

Change-Id: I44e37a60b49287cf7202d5a578ee9c08cf898078
Reviewed-on: https://dart-review.googlesource.com/c/94280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-02-26 07:38:12 +00:00
Danny Tuppeny bf0568c548 Document restrictions on LSP refactors/code fixes
We only provide fixes/refactors/assists to clients that support returning literal CodeActions (not just Commands). CodeActions allow us to return a WorkspaceEdit directly without having to encode the action into a command/argument set that is tround-tripped to the client. Supporting CodeActions on the client is relatively straight forward (since it just removes a round-trip and applies the edit directly).

Change-Id: I7f5a8c22e66ac23bcde6d5782bc2eaa6aeb283da
Reviewed-on: https://dart-review.googlesource.com/c/94221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-02-25 17:45:34 +00:00
Danny Tuppeny 1e60ddbc5b Make more LSP enum classes support "any value"
Previously we assumed enum classes could only be the values specified in the spec, but this was not correct - newer clients may know about values that we did not know about at the time we shipped(/last regenerated).

This makes the default for an enum class to support any class (avoiding deserialisation failures when new clients send newer values), and opts-out for those where the spec is explicit that the value set is fixed.

Also opened https://github.com/Microsoft/language-server-protocol/issues/686 for clarification that these "fixed set" values are explicitly intended to never be extended, or whether this is accidental.

Change-Id: I6243fc91c14ec0fa5622d3f6f29bf77cadf7da64
Reviewed-on: https://dart-review.googlesource.com/c/94220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-02-25 17:05:47 +00:00
Konstantin Shcheglov 266ce73e28 Remove CompletionSuggestion.elementUri, replaced with AvailableSuggestionSet.
R=brianwilkerson@google.com

Context: https://github.com/JetBrains/intellij-plugins/pull/633#issuecomment-465725310
Change-Id: I03a1b7e7ec7cc0a5b0797dc960b72ca314a32132
Reviewed-on: https://dart-review.googlesource.com/c/93745
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-20 21:34:18 +00:00
Konstantin Shcheglov 5e2529c82e Remove 'importUri' from CompletionSuggestion.
R=brianwilkerson@google.com

Change-Id: I1c06f7e6d84d5c2dd0eee7fa80f2e4bca3959513
Reviewed-on: https://dart-review.googlesource.com/c/93379
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-20 18:14:45 +00:00
Konstantin Shcheglov 4c1025493a Enhance available suggestions protocol.
1. Rename includedSuggestionKinds -> includedElementKinds.

2. Add defaultArgumentListString and defaultArgumentListTextRanges.

R=brianwilkerson@google.com

Change-Id: I65c67252f6bad66c0c60a20315fd87affbeb653a
Reviewed-on: https://dart-review.googlesource.com/c/93560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 19:51:11 +00:00
Konstantin Shcheglov 0ef30fb86e Protocol for IncludedSuggestionSet.displayUri.
R=brianwilkerson@google.com

Context: https://github.com/JetBrains/intellij-plugins/pull/633#issuecomment-464746341
Change-Id: I27339f4c9327adb761f2bb0ba326c318ce010383
Reviewed-on: https://dart-review.googlesource.com/c/93487
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 16:42:30 +00:00
Konstantin Shcheglov b9bcfb4529 Change IncludedSuggestionRelevanceTag to using 'relevanceBoost'.
Sometimes there is no difference between 'relevance' and 'relevanceBoost',
for example for enum constants. But for primitive constants, there might
be multiple `double` constants, in different libraries with their own
different relevances. And it would be nice to keep relative relevances
of these libraries in primitive type constants.

R=brianwilkerson@google.com

Change-Id: I3641a4709e09f5c5dd979f5ca8df7b0235c708d2
Reviewed-on: https://dart-review.googlesource.com/c/92623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-11 20:10:29 +00:00
Danny Tuppeny b88d11a9bd Implement LSP workspace/symbol
Change-Id: I4303a146dce9a5a4b40345f7ea8ef8355163337b
Reviewed-on: https://dart-review.googlesource.com/c/92602
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-11 19:32:52 +00:00
Konstantin Shcheglov 67c5923cce Enhance protocol to allow changing relevance of individual suggesions.
R=brianwilkerson@google.com

Change-Id: I3f3d256fcdc4d41c527bbc03fb71800583a264f7
Reviewed-on: https://dart-review.googlesource.com/c/92382
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ari Aye <ariaye@google.com>
2019-02-08 19:25:05 +00:00
Konstantin Shcheglov d236dca9d9 Add 'offset' to 'getSuggestionDetails'.
We need it to know if names in the syntactic scope will shadow
the requested name if unprefixed import is used.

R=brianwilkerson@google.com

Change-Id: I1fd28add9241b27795160c4705a80e0f8aa6c647
Reviewed-on: https://dart-review.googlesource.com/c/92022
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-05 16:49:55 +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
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
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
Danny Tuppeny 16bcfbb104 Add deprecated_member_use_from_same_package to generated LSP ignores
Change-Id: I553dee00f08b8d84c4ba71ffb9dffbe1b262192c
Reviewed-on: https://dart-review.googlesource.com/c/90244
Auto-Submit: Danny Tuppeny <dantup@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-19 18:14:58 +00:00
Danny Tuppeny 17a439633d Add a custom LSP method dart/diagnosticServer to start server/return port
Change-Id: I9d9be244251099c947b2998f0a45ec29ef29ad83
Reviewed-on: https://dart-review.googlesource.com/c/90012
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-17 16:37:49 +00:00
Danny Tuppeny 7e05c2cd62 Add ability to generate custom classes for custom LSP methods
Change-Id: Ie613a828fd6d92133e3d5cb53673c37734fb6eec
Reviewed-on: https://dart-review.googlesource.com/c/90011
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-17 16:37:49 +00:00
Danny Tuppeny c5bfccc6fb Make downloading the LSP spec a flag and commit the version parsed locally
Change-Id: Ib46be800dcfe3369bcc9a222d1097ae4a0efdff6

Ensure licence/attribution is included in our copy of the spec

Change-Id: I48efdb6dad5c2ba04eb18cd397fc44f678a9a7f5
Reviewed-on: https://dart-review.googlesource.com/c/89533
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-01-16 17:20:54 +00:00
Danny Tuppeny dbeec3bbf3 Fix formatting in generated LSP file header
Change-Id: I1447a4250ab0e8c8fcd26a85ff5949c587a6a77f
Reviewed-on: https://dart-review.googlesource.com/c/89517
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>
2019-01-16 17:04:43 +00:00
Danny Tuppeny bfe15d87d8 Fix LSP exceptions serializing ResponseErrors with Uris
The ResponseError.data field was typed `dynamic` (as in the LSP spec) but this allows us to accidentally put non-serializable classes in it which will result in server errors when we try to send them back.

This change forces them to Strings and it's up to the code constructing the error to convert any additional data to a string first.

In order to catch this in tests, the mocks now force serialisation of all types flowing from the server to the client (this already happened for client to server).

Change-Id: I5d7f322e1a4296b1479468e36d81daebdbb4ab52
Reviewed-on: https://dart-review.googlesource.com/c/89511
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-16 16:57:43 +00:00
Danny Tuppeny 5ce5d697da Implement LSP code folding
Change-Id: I2b076b1792c229cbbce610d7a195fa03eb29e6bd
Reviewed-on: https://dart-review.googlesource.com/c/89503
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-16 16:03:23 +00:00
Danny Tuppeny ff5e5b6896 Regenerate LSP classes from spec + update README
The README was missing some methods (recent additions?) and also not quite in the same order - this fixes that. Also re-generates the classes based on current spec (mostly comments updates, but also non-nullability for `targetSelectionRange`.

Change-Id: I0dd4e24daf51b659783058362339550ec46fa1c8
Reviewed-on: https://dart-review.googlesource.com/c/89641
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>
2019-01-15 16:51:19 +00:00
Danny Tuppeny 61e81217f0 Update LSP status doc (rename is complete + tested in VS Code)
Change-Id: Ifce985123efcfec658218c3a4fbe4b6a2102b0bc
Reviewed-on: https://dart-review.googlesource.com/c/89544
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-01-15 15:10:42 +00:00