Skip to content

Commit 04d6ccc

Browse files
authored
Merge pull request #63 from glennsarti/gh-46-load-modules
(GH-46) Autoload modules, not just core types
2 parents 562c6cf + 427933d commit 04d6ccc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/lib/puppet-languageserver/puppet_helper.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,15 @@ def self.prune_resource_parameters(resources)
119119

120120
def self._load_types
121121
@types_hash = {}
122-
Puppet::Type.loadall
122+
# This is an expensive call
123+
# From https://github.com/puppetlabs/puppet/blob/ebd96213cab43bb2a8071b7ac0206c3ed0be8e58/lib/puppet/metatype/manager.rb#L182-L189
124+
typeloader = Puppet::Util::Autoload.new(self, "puppet/type")
125+
typeloader.loadall
123126

124127
Puppet::Type.eachtype do |type|
125128
next if type.name == :component
126129
next if type.name == :whit
130+
127131
@types_hash[type.name] = type
128132
end
129133

0 commit comments

Comments
 (0)