Skip to content

Commit 3d5e403

Browse files
authored
Merge pull request #273 from glennsarti/spike-fix-broken-stuff
(GH-272) Puppet Lint and document symbol sometimes not working
2 parents ecf705e + 327bd50 commit 3d5e403

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/puppet-languageserver/manifest/document_symbol_provider.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def self.recurse_document_symbols(object, path, parentsymbol, symbollist)
176176
'selectionRange' => create_range(param.offset, param.length, param.locator),
177177
'children' => []
178178
)
179-
this_symbol['children'].push(param_symbol)
179+
this_symbol.children.push(param_symbol)
180180
end
181181

182182
when 'Puppet::Pops::Model::AssignmentExpression'
@@ -209,7 +209,7 @@ def self.recurse_document_symbols(object, path, parentsymbol, symbollist)
209209
'selectionRange' => create_range(param.offset, param.length, param.locator),
210210
'children' => []
211211
)
212-
this_symbol['children'].push(param_symbol)
212+
this_symbol.children.push(param_symbol)
213213
end
214214
end
215215

lib/puppet-languageserver/manifest/validation_provider.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ def self.validate(session_state, content, options = {})
4545
if module_root.nil?
4646
linter_options = PuppetLint::OptParser.build
4747
else
48-
Dir.chdir(module_root.to_s) { linter_options = PuppetLint::OptParser.build }
48+
begin
49+
Dir.chdir(module_root.to_s) { linter_options = PuppetLint::OptParser.build }
50+
rescue OptionParser::InvalidOption => e
51+
PuppetLanguageServer.log_message(:error, "(#{name}) Error reading Puppet Lint configuration. Using default: #{e}")
52+
linter_options = PuppetLint::OptParser.build
53+
end
4954
end
5055
linter_options.parse!([])
5156

0 commit comments

Comments
 (0)