-
Notifications
You must be signed in to change notification settings - Fork 21
(GH-144) Add signature help provider feature #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Author
|
Note - No need for a feature flag for this. |
4e6608d to
194efd9
Compare
924e8e5 to
7b11132
Compare
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
7b11132 to
dfc6c46
Compare
Contributor
Author
|
#142 is merged. Unblock for review and merge. |
jpogran
approved these changes
Jul 24, 2019
Contributor
jpogran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Builds on #142
Fixes #144
signature_key_offsetandsignature_key_lengthinstead of textIn action

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.
to ensure the provider behaves as expected
provider, and what keys will trigger the provider