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

GDScript Formatter vscode extension errors #182

Closed
acelinkio opened this issue Nov 23, 2022 · 9 comments
Closed

GDScript Formatter vscode extension errors #182

acelinkio opened this issue Nov 23, 2022 · 9 comments

Comments

@acelinkio
Copy link

GDScript Formatter vscode extension
VSCode Marketplace Shows this as the source for the extension. The latest version published was 1.2.2 on June 2021. The newest code in this repository is from May 2020 for version 1.1.2.

#179 aims to targets the extension. It is unclear where the extension is being published from. I was unable to get the extension to work properly and was looking for additional information.

@acelinkio
Copy link
Author

Publisher shows as Razoric. I see a contributor, @Razoric480. Maybe they can provide more info.

@acelinkio acelinkio changed the title GDScript Formatter vscode extension source code location GDScript Formatter vscode extension source code? Dec 3, 2022
@acelinkio
Copy link
Author

Any updates on this? Unclear if that VS Code extension is abandoned.

@Razoric480
Copy link
Contributor

Razoric480 commented Dec 3, 2022

Hi. Sorry - time and energy haven't quite lined up.

The extension has been manually published by myself from the source code on this repo, with some version-bumping. I didn't include any special or fancy automation.

The reason for the version mismatch is just because I didn't push any of the version bumping of the package.json to the repo, though I really should have.

@acelinkio
Copy link
Author

No problem! Multi-artifact projects are hard to maintain. I can look into helping out with some release automation later.

Anyways, I tried using the extension and am getting errors attempting to format document. Not entirely sure what is wrong. If I run gdformat from the command line it works.

Log Extension Host output from vscode after running format document

2022-12-02 21:03:42.287 [error] Error: spawn py ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:283:19)
	at onErrorNT (node:internal/child_process:478:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

@Razoric480
Copy link
Contributor

Strange. I can't replicate the issue on either windows or WSL (ubuntu). I'm not familiar with that error.

@Razoric480
Copy link
Contributor

From the cryptic error message, it looks like some sort of failure to invoke python to run gdformat.

@acelinkio
Copy link
Author

Windows 11
vscode 1.73.1 user installation
vscode extension GDScript Formatter 1.2.2
Python 3.11.5
gdtoolkit 3.4.0

My guess is that this has to deal with vscode installed in user context. Something on the extension side might need to change? I tested using KuhnChrisEU.vscode-formatter-godot extension and the calls to gdformat and gdlint worked. I'll take a crack looking through the vscode extension source.

@acelinkio
Copy link
Author

This issue was related to how python was being installed via pyenv-win. pyenv-win creates shims that are batch files.

microsoft/vscode-python#15739 similar issue with pyenv-win in the vscode-python extension
pyenv-win/pyenv-win#352 feature request to mitigate this problem in pyenv-win

Closing this issue. Learning more that Windows is not always developer friendly.

@acelinkio acelinkio changed the title GDScript Formatter vscode extension source code? GDScript Formatter vscode extension errors Dec 4, 2022
@acelinkio
Copy link
Author

Adding some clarity after learning a little about vscode extension debugging. The python-shell package does not support pyenv-win environments for looking up path. Even after setting the path manually, there appeared to be a shim issue. I opened a feature request: extrabacon/python-shell#277

vscode-python extension does support paths. Not sure how they handle working with the pyenv shims.

The reason why KuhnChrisEU.vscode-formatter-godot extension works is because they just spawn a child process directly without calling python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants