Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intellisense features not working #362

Open
nathanlcarlson opened this issue Sep 23, 2022 · 1 comment
Open

Intellisense features not working #362

nathanlcarlson opened this issue Sep 23, 2022 · 1 comment

Comments

@nathanlcarlson
Copy link

nathanlcarlson commented Sep 23, 2022

What Versions are you running?

OS Version: Mac OS 12.5.1 (21G83)
VSCode Version: 1.71.2
Puppet Extension Version: v1.4.0
PDK Version: 2.5.0

What You Are Seeing?

No Intellisense is working in my control repository.

What is Expected?

I'd like to have intellisense features working.

How Did You Get This To Happen? (Steps to Reproduce)

Attempt to use the VSCode PDK extension in my organization's puppet control repo.

Output Log

Found this in the logs (removed directory names):

ANY -- : SidecarQueue Thread: Calling sidecar with --action workspace_aggregate --local-workspace {control repo dir} --puppet-version=6.27.0 returned exitcode 1, ruby: warning: shebang line ending with \r may cause problems
{homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:147:in `block (3 levels) in populate_classes_from_yard_registry!': undefined method `join' for nil:NilClass (NoMethodError)
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:143:in `each'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:143:in `block (2 levels) in populate_classes_from_yard_registry!'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:128:in `each'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:128:in `block in populate_classes_from_yard_registry!'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:127:in `each'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:127:in `populate_classes_from_yard_registry!'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:102:in `populate_from_yard_registry!'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:74:in `file_documentation'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:10:in `file_documentation'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_helper.rb:93:in `block in retrieve_via_puppet_strings'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_helper.rb:92:in `each'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_helper.rb:92:in `retrieve_via_puppet_strings'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet_languageserver_sidecar.rb:303:in `execute'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet_languageserver_sidecar.rb:360:in `execute_and_output'
	from {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/puppet-languageserver-sidecar:14:in `<main>'

Edit: I also see many of these types of ERRORs:

ERROR -- : (textDocument/hover) apache::vhost is not a valid puppet type
@nathanlcarlson
Copy link
Author

nathanlcarlson commented Sep 29, 2022

I put a local change in to bypass the problem. I doubt it is the correct solution, but it solves my issue:

$ vi {homedir}/.vscode/extensions/puppet.puppet-vscode-1.4.0/vendor/languageserver/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb:143
...
          # Extract the class parameters
          unless item[:docstring][:tags].nil?
            item[:docstring][:tags].select { |tag| tag[:tag_name] == 'param' }.each do |tag|
              next if tag[:types].nil? # My addition, Skip nil
              param_name = tag[:name]
              obj.parameters[param_name] = {
                :doc  => tag[:text],
                :type => tag[:types].join(', ')
              }
            end
          end
 ...

@jordanbreen28 jordanbreen28 transferred this issue from puppetlabs/puppet-vscode Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants