Skip to content

Conversation

@glennsarti
Copy link
Contributor

Part of the work for #177

Builds on #184


Previously the settings were passed directly from the response into the
client for processing however this does not emulate the legacy settings hash.

This commit adds the original scope onto the settings hash so it appears like
the legacy hash e.g. puppet.editorservices.abc instead of editorserivces.abc


While technically the protocol does allow the server to send window/showMessage
notifcations during initialization, it's better to send the warning at the
end of initialization i.e. at the initialized notification.
9d13ba8


Now that the Language Client can process client settings, and dynamic
registrations it is now possible to setup the server to register to receive the
onTypeFormatting request. This commit:

  • Responds to the 'puppet.editorService.formatOnType.enable' client setting
  • Dynamically registers the provider if dynamic registration is possible
    otherwise uses static registration
  • Adds a format_on_type method on the Language Client to track whether this
    feature is enabled
  • Adds dummy response to the textDocument/onTypeFormatting request
  • Adds tests for the client interacting with the settings

Previously capability registrations were assumed to only have one possible
reqeuest per method however this isn't true.  Also the request ID is needed in
order to unregister a capability.  This commit;
* Modifies the Language Client to track registrations that are in progress and
  have completed
* Now processes error messages so that registration tracking can fail tracked
  registrations
* Adds tests for these scenarios
…ient

Previously the message router was passed in as a method parameter however as
almost all methods require the message router, this commit changes the
initializer to pass in the message router at object create time.
Previously client capabilities could be dynamically registered.  This commit
adds the logic and track to dynamically unregister a capability;
* Adds the unregister_capability and parse_unregister_capability_response!
  methods
* Adds the client/unregisterCapability notification handler
* Adds tests for unregistering
Previously the settings were passed directly from the response into the
client for processing however this does not emulate the legacy settings hash.

This commit adds the original scope onto the settings hash so it appears like
the legacy hash e.g. puppet.editorservices.abc instead of editorserivces.abc
While technically the protocol does allow the server to send window/showMessage
notifcations during initialization, it's better to send the warning at the
end of initialization i.e. at the initialized notification.
Now that the Language Client can process client settings, and dynamic
registrations it is now possible to setup the server to register to receive the
onTypeFormatting request.  This commit:

* Responds to the 'puppet.editorService.formatOnType.enable' client setting
* Dynamically registers the provider if dynamic registration is possible
  otherwise uses static registration
* Adds a format_on_type method on the Language Client to track whether this
  feature is enabled
* Adds dummy response to the `textDocument/onTypeFormatting` request
* Adds tests for the client interacting with the settings
@glennsarti glennsarti added this to the 0.22.0 milestone Sep 17, 2019
@glennsarti glennsarti self-assigned this Sep 17, 2019
@glennsarti glennsarti requested a review from jpogran September 17, 2019 12:04
Copy link
Contributor

@jpogran jpogran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Paired with @glennsarti and we reviewed code

@jpogran jpogran merged commit 4f0a80f into puppetlabs:master Sep 18, 2019
@glennsarti glennsarti deleted the format-on-type branch September 19, 2019 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants