Open Felixoid opened 4 years ago
Hi @Felixoid, thank you for the detailed report!
Can I ask what you are trying to accomplish? Using puppet-language-sidecar
directly isn't something we intended as a public API. It's intended to used by the puppet-languageserver
, so there is a fair bit of setup and specific parameters to use in different situations. None of this is generally documented because it's internal, but Glenn has wrote some amazing spec tests that exercise the entire suite of functionality you could use to get an idea of what is needed by what. If that doesn't help for examples, you'll have to look at the source to see which action is used to get which type of data.
Making an assumption, I think you are trying to list all types in the current workspace. I'm not really familiar with pacman or makepkg, but I don't see which version of ruby you are using or any bundle install
or bundle exec
statements that indicate you've installed the gems needed to run this in a development setup. Assuming that you have, you have to match the action with the thing you want to get, along with which other parameters to use. You need to specify the --local-workspace
, not modulepath
to get that. If you look at https://github.com/puppetlabs/puppet-editor-services/blob/master/lib/puppet-languageserver/puppet_helper.rb#L294-L297, you'll see we pass the workspace_types
action with the current working directory as the local_workspace
. If we do that, we get something like this (with the actual json omitted for space):
root@874b47154142:/workspaces/puppet-editor-services# bundle exec puppet-languageserver-sidecar --action=workspace_types --debug=./output.log --local-workspace=./spec/languageserver-sidecar/fixtures/valid_module_workspace
I, [2020-04-07T00:50:48.813729 #3206] INFO -- : Language Server Sidecar is v0.25.0
D, [2020-04-07T00:50:48.827882 #3206] DEBUG -- : Loading gems...
I, [2020-04-07T00:50:51.930396 #3206] INFO -- : Using Puppet v6.14.0
D, [2020-04-07T00:50:51.944777 #3206] DEBUG -- : Detected additional puppet settings []
D, [2020-04-07T00:50:51.985057 #3206] DEBUG -- : Detected Module Metadata in the workspace
D, [2020-04-07T00:50:51.992304 #3206] DEBUG -- : Executing workspace_types action
D, [2020-04-07T00:50:52.021076 #3206] DEBUG -- : Injected the workspace into the module loader
D, [2020-04-07T00:50:52.027561 #3206] DEBUG -- : [PuppetHelper::retrieve_types] Starting
W, [2020-04-07T00:51:03.756726 #3206] WARN -- : [PuppetHelper::load_type_file] type /usr/local/bundle/gems/puppet-6.14.0/lib/puppet/type/component.rb did not load any types
W, [2020-04-07T00:51:21.336205 #3206] WARN -- : [PuppetHelper::load_type_file] type /usr/local/bundle/gems/puppet-6.14.0/lib/puppet/type/whit.rb did not load any types
D, [2020-04-07T00:51:21.347568 #3206] DEBUG -- : [PuppetHelper::retrieve_types] Finished loading 13 type/s
If this doesn't help, can you reply with what you are trying to do, and maybe we can help. I'm removing the bug label for now, as we haven't identified this as actually something that isn't working yet.
Hey @jpogran.
I've shown the example of puppet-language-sidecar
as a proof, that /usr/bin/puppet-languageserver --stdio --puppet-settings=--modulepath,/path/to/puppet/modules/dir
doesn't work as I expect.
Maybe, and most probably, my expectations are wrong. What am I trying to achieve is to have autocompletion when I'm working in a puppet-clickhouse project for the used modules stdlib
AND apt
. So my expectations according to the documentation https://puppet-vscode.github.io/docs/extension-settings/#puppet-editorservice-puppet-modulepath, that I should have the data from puppet-language-sidecar
.
If --puppet-settings=--modulepath
doesn't produce the data from language-server, I have two questions:
Thank you for the comment, hopefully, there's a way to get what I need.
Describe the Bug
Hello. I launch both puppet-languageserver and puppet-languageserver-sidecar with
--puppet-settings=--modulepath,/path/to/modules/
and it doesn't work. Basically, it gives nothing.Expected Behavior
I expect to get the data for all included modules.
Steps to Reproduce
Steps to reproduce the behavior: Here the Dockerfile to build a testing environment
To launch container and reproduce the issue run the next commands:
The output of previous commands is:
Environment