forked from puppetlabs/puppet-editor-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(puppetlabsGH-121) Load Puppet 3 and 4 API Functions via Puppet Strings
Currently the Sidecar can only detect and load Puppet 3 API functions. The newer Puppet 4 API functions use a different loader and schema, and importantly have additional properties e.g. Puppet 4 API functions have one or more signatures, whereas Puppet 3 API functions use arity. In order to add the Puppet Strings loader, this commit will load Puppet 4 API functions but present them to the Language Server as if they were Puppet 3. A later commit will then change this behaviour so that all the metadata for Puppet 4 API functions will be known by the Language Server, and Puppet 3 API function metadata will be munged into the 4 API equivalent. This commit: * Extends the Sidecar protocol to add a function_version property to the Puppet Function schema. This can be used later by the Language Server to determine how to handle the metadata. * Adds a new method called retrieve_via_puppet_strings to the puppet_helper. This method queries the Puppet Loaders (vai Puppet-As-A-Library PAL) for all the files for particular puppet objects (functions in this case) and then gets the documentation about these files via the Puppet Strings helper * The PAL files are only available on Puppet Gem 6 and above, so the feature flag is modified to only be active on Puppet version 6+ * Adds in a new method called 'discover_paths' on all PAL loaders. The loaders themselves are normally used to load _something_ by name, however the Sidecar wants to load EVERYTHING. Generally this information is private to each loader. By adding this additional method, we can extract all of the discoverable paths, without needing to write our own loaders * Removes the old function loading and monkey patches
- Loading branch information
1 parent
4149a43
commit 04df703
Showing
7 changed files
with
206 additions
and
147 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.