Skip to content

Commit

Permalink
(maint) Fix Facter Helper
Browse files Browse the repository at this point in the history
This commit updates the Facter Helper for 1.0, due to the change in the
session state.
  • Loading branch information
glennsarti committed May 16, 2020
1 parent 447f61b commit 2f6e0fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/puppet-languageserver/facter_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.fact_names(session_state)
session_state.object_cache.object_names_by_section(:fact).map(&:to_s)
end

def self.facts_to_hash
def self.facts_to_hash(session_state)
fact_hash = {}
session_state.object_cache.objects_by_section(:fact) { |factname, fact| fact_hash[factname.to_s] = fact.value }
fact_hash
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet-languageserver/message_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def request_puppet_getversion(_, _json_rpc_message)
end

def request_puppet_getfacts(_, _json_rpc_message)
results = PuppetLanguageServer::FacterHelper.facts_to_hash
results = PuppetLanguageServer::FacterHelper.facts_to_hash(session_state)
LSP::PuppetFactResponse.new('facts' => results)
end

Expand Down

0 comments on commit 2f6e0fc

Please sign in to comment.