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:
After:
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.
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:
After:
![Pasted Graphic](https://github.com/puppetlabs/puppet-editor-services/assets/112936862/3e4d9ea6-5e30-4678-bcd0-0f3069e5cc27)
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 tolib/puppet/type/file.rb
.Related Issues (if any)
Fixes https://github.com/puppetlabs/puppet-editor-services/issues/349
Checklist