Open iainhallam opened 4 years ago
Thank you for the detailed report @iainhallam! I agree that the language server should be able to handle spaces in paths, so we will investigate where in the manifest validator that is breaking.
In general I advise to not use spaces in Puppet module folder names or Puppet control repos going forward. Its against style guidelines for Puppet modules and is invalid when publishing to the forge, and I believe its against conventions with control repos. It will cause problems with other tooling than the VS Code extension, so it's best to adjust when you can rather than later.
Agree with the spaces in names thing, I was trying to reduce the issue to the barest minimum to reproduce it. I don't put spaces in names inside the control repo anywhere, or in my modules, but I do think that it's likely that people check out their repo, as I do, on a variety of machines where the path outside the control repo might have spaces in. That's what originally triggered my finding the issue here.
Yeah, this is an underlying Ruby error with chdir e.g https://tickets.puppetlabs.com/browse/PUP-6035. I wonder if I need to use an FFI call instead.
What Versions are you running?
OS Version: Windows 10 Pro version 1909 build 18363.1016 VSCode Version: 1.48.2 (user setup) Puppet Extension Version: 0.28.0 PDK Version: 1.18.1
What You Are Seeing?
When editing files in repos with spaces in the path, the laguage server fails with the following error in Puppet output:
This causes linting to fail, so no code problems are shown for the workspace in Puppet files, while they are shown for other types of file.
Additionally, hovering over Puppet code whether there are spaces in the path or not, gives the following error in Log (Extension Host):
I think this may be a diversion from the main issue, though, as these hover errors are shown whether the language server fails or not.
What is Expected?
The language server should cope with spaces in the path to the files.
How Did You Get This To Happen? (Steps to Reproduce)
Tried with multiple repos, and a new module from PDK:
pdk new module test_module
test_module
folder, Open with Code.manifests/init.pp
with the contentclass test_module {}
- Problems shows 1 warning, "class not documented".test_module
totest module
, Open with Code again.init.pp
- no problems are shown. Ctrl-Shift-U and switch to Puppet - shows the EINVAL error.I verified this with test paths:
D:\Dropbox\Projects\Systems\puppet control
= error, linting fails to show problemsD:\Dropbox\Projects\Systems\puppet-control
= no error, linting shows problems when they are writtenD:\Test
= no error, linting shows problems when they are writtenD:\Puppet control
= error, linting fails to show problemsD:\Puppet-control
= no error, linting shows problems when they are writtenD:\test module
= error, linting fails to show problemsD:\test_module
= no error, linting shows problems when they are writtenC:\test module
= error, linting fails to show problemsC:\test_module
= no error, linting shows problems when they are writtenI've uninstalled VS Code, and reinstalled it for my user, and uninstalled puppet-vscode (and deleted the puppet-vscode folder from extensions) then reinstalled that. No change.
Output Log
Puppet Output pane:
Debug log: