Skip to content

Commit

Permalink
(puppetlabsGH-256) Fix calling getDependencies in 1.0
Browse files Browse the repository at this point in the history
Previously the puppetfile-resolver endpoint was created with version 0.x of
Editor Services.  Now that 1.0 is being worked on, the method call has changed
slightly.
  • Loading branch information
glennsarti committed Jun 14, 2020
1 parent d51a2be commit a4628c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/puppet-languageserver/message_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ def request_puppetfile_getdependencies(_, json_rpc_message)
file_uri = json_rpc_message.params['uri']
return LSP::PuppetfileDependencyResponse.new('error' => 'Must be a puppetfile in order to find dependencies.') unless documents.document_type(file_uri) == :puppetfile

content = documents.document(file_uri)
document = documents.document(file_uri)

result = []
begin
result = PuppetLanguageServer::Puppetfile::ValidationProvider.find_dependencies(content)
result = PuppetLanguageServer::Puppetfile::ValidationProvider.find_dependencies(document.content)
rescue StandardError => e
PuppetLanguageServer.log_message(:error, "(puppetfile/getdependencies) Error parsing puppetfile. #{e}")
return LSP::PuppetfileDependencyResponse.new('error' => 'An internal error occured while parsing the puppetfile. Please see the debug log files for more information.')
Expand Down

0 comments on commit a4628c8

Please sign in to comment.