Skip to content

Conversation

@glennsarti
Copy link
Contributor

@glennsarti glennsarti commented Jun 11, 2019

Builds on #142

Fixes #144

  • Use signature_key_offset and signature_key_length instead of text

In action
image


Previously the object_under_cursor method only returned the AST object and the
path to the object. However some providers may also require a locator because
Puppet 4 does not expose the Locator on the AST object, only on the Factory.

This commit adds the return struct for the object_under_cursor method to also
return the Locator.

No test changes are required.


Previously the object_under_cursor always assumed it should remove the trigger
character when trying to figure out the object under the cursor. While this
works for things like completion and hover, it does not for signature help. This
commit updates the options hash with a new key called remove_trigger_char which
by default removes the character during detection. Just like the default
behaviour. This commit does not require any test changes as behaviour has
not changed.


This commit adds a new Signature Help provider for puppet manifest files. It
takes the information from the Puppet 4 API metadata (signatures) and uses the
Puppet Parser Helper to figure out which signature and then which parameter in
that signature is being queried by the Language Client.

  • Adds a new signature_provider.rb for manifests and adds many test scenarios
    to ensure the provider behaves as expected
  • Updates the message router to route the new messages appropriately
  • Updates the server capabilities to tell the client we support the signature
    provider, and what keys will trigger the provider

@glennsarti glennsarti added enhancement New feature or request Language Server labels Jun 11, 2019
@glennsarti glennsarti self-assigned this Jun 11, 2019
@glennsarti
Copy link
Contributor Author

Note - No need for a feature flag for this.
Block on 142 being merged.

@glennsarti glennsarti force-pushed the gh144-add-sig-provider branch 3 times, most recently from 4e6608d to 194efd9 Compare June 13, 2019 13:57
@glennsarti glennsarti force-pushed the gh144-add-sig-provider branch 2 times, most recently from 924e8e5 to 7b11132 Compare July 7, 2019 13:53
Previously when serialising LSP classes it was possible to throw errors on
Arrays of simple types e.g. [1, 2], because the array element Integer doesn't
have a .to_h method.  This commit updates the serialiser to only call .to_h
if the item actually supports it.
Previously the line offset calculation used error handling as a form of
branching, however this is not needed.  This commit:

* Instead of using error handling, uses the standard respond_to? method to
  detect if the method exists
* Adds a commented out code block which is useful during development only
Previously the object_under_cursor method only returned the AST object and the
path to the object.  However some providers may also require a locator because
Puppet 4 does not expose the Locator on the AST object, only on the Factory.

This commit adds the return struct for the object_under_cursor method to also
return the Locator.

No test changes are required.
…Helper

Previously the object_under_cursor always assumed it should remove the trigger
character when trying to figure out the object under the cursor. While this
works for things like completion and hover, it does not for signature help. This
commit updates the options hash with a new key called remove_trigger_char which
by default removes the character during detection.  Just like the default
behaviour.  This commit does not require any test changes as behaviour has
not changed.
This commit adds a new Signature Help provider for puppet manifest files.  It
takes the information from the Puppet 4 API metadata (signatures) and uses the
Puppet Parser Helper to figure out which signature and then which parameter in
that signature is being queried by the Language Client.

* Adds a new signature_provider.rb for manifests and adds many test scenarios
  to ensure the provider behaves as expected
* Updates the message router to route the new messages appropriately
* Updates the server capabilities to tell the client we support the signature
  provider, and what keys will trigger the provider
@glennsarti glennsarti force-pushed the gh144-add-sig-provider branch from 7b11132 to dfc6c46 Compare July 12, 2019 06:22
@glennsarti glennsarti changed the title {WIP}(GH-144) Add signature help provider feature (GH-144) Add signature help provider feature Jul 12, 2019
@glennsarti glennsarti added this to the 0.21.0 milestone Jul 12, 2019
@glennsarti
Copy link
Contributor Author

#142 is merged. Unblock for review and merge.

@glennsarti glennsarti requested a review from jpogran July 24, 2019 12:03
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.

@jpogran jpogran merged commit e8bf14f into puppetlabs:master Jul 24, 2019
@glennsarti glennsarti deleted the gh144-add-sig-provider branch July 28, 2019 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request : Add a Signature Helper Provider

2 participants