puppetlabs / puppet-editor-services

Puppet Language Server for editors
Apache License 2.0
45 stars 21 forks source link

(CAT-1493) - Fix missing file resource type parameters #353

Closed jordanbreen28 closed 8 months ago

jordanbreen28 commented 8 months ago

Summary

Prior to this PR, when using the autocompletion feature of puppet-editor-services, the file resource type would be missing some parameters/properties in the dropdown completion list.

It was found that this was due to the way the file resource type was structured in the puppet source code. The type definitions can be found in both /lib/puppet/type and /lib/puppet/type/file/*.rb.

The way we can work around this is by altering the search glob, and combining the type definitions into one single file. This file is then deleted on completion.

Additional Context

Before: Pasted Graphic 1 After: Pasted Graphic

We also manually store the type source and calling source, as this allows users to still avail of the Go to definition feature, which will redirect them to lib/puppet/type/file.rb.

Related Issues (if any)

Fixes https://github.com/puppetlabs/puppet-editor-services/issues/349

Checklist