Open bastelfreak opened 2 years ago
Related issues:
Looks like puppet-lint is loaded as a lib in a few places:
which makes it real hard to switch to an external puppet-lint implementation. I didn't yet figure out in which Ruby context the language server is executed/how we could easily add more plugins to that.
Given that puppet-lint is not vendored as gem and use siteloaded by modifying the Ruby LOAD path, it should be easy to deploy gems next to it and load them as well?
@bastelfreak So.... it's tricky (tm) 😄
Yes, puppet-lint is vendored into the editor-service and loaded via manipulating the LOAD_PATH (https://github.com/puppetlabs/puppet-editor-services/blob/main/puppet-languageserver#L7)
And adding other puppet-lint gems is possible!
However, the tricky part is "unloading". Because we used puppet-lint as a library (for speed purposes) we can't "unload" puppet-lint gems when users disable/enable them in puppet-lint.rc (Yes I know puppet-lint.rc has issues still in that linked ticket)
So we could:
But both of these will require, not an insignificant amount of work.
As a workaround, I think you can set GEM_PATH
prior to running VSCode process, and the language server creation inside VSCode should pass that through .. maybe? 🤷♀️
As a workaround, I think you can set GEM_PATH prior to running VSCode process, and the language server creation inside VSCode should pass that through .. maybe? 🤷♀️
Looks like it doesn't 😭 https://github.com/puppetlabs/puppet-vscode/blob/main/src/helpers/commandHelper.ts#L199-L229
Describe the Change You Would Like
I guess it's not a bug, just a missing piece in the docs / I'm too stupid to find it:
Hi! I'm working on a windows 10 box with ruby 2.5 / puppet-lint installed as gem. In addition I've a dozen puppet-lint plugins and enable/disable them per module with an individual .puppet-lint.rc (sse https://github.com/puppetlabs/puppet-vscode/issues/804 ). My understanding for the Rakefile in this module is, that puppet-lint is vendored. is that correct? How would I customize the plugins / is it possible to configure the path to puppet-lint?