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

No commands registered #3

Closed
lethefrost opened this issue Apr 5, 2024 · 10 comments
Closed

No commands registered #3

lethefrost opened this issue Apr 5, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@lethefrost
Copy link

lethefrost commented Apr 5, 2024

Hi!

I am working on Godot 4.2.1 stable, and I downloaded your formatter plugin from the AssetLib (ver 0.0.4). After enabling it in the Project Settings > Plugins, there's no command as described in the README file showing up in the command palette nor in the menu Project > Tools. Moreover, when trying to disable the plugin, it prints this error message below:

The Command 'GDScript Formatter/Format GDScript' doesn't exists. Unable to remove it.

@Daylily-Zeleen
Copy link
Owner

Daylily-Zeleen commented Apr 5, 2024

Are there any error/warning message when enabling this plugin?

If gdformat or pip command can't be found when enabling, it should print a warning messag.

To eliminate errors as soon as possible, please provide your operating system version and your godot version.

@lethefrost
Copy link
Author

Are there any error/warning message when enabling this plugin?

If gdformat or pip command can't be found when enabling, it should print a warning messag.

To eliminate errors as soon as possible, please provide your operating system version and your godot version.

Thank you! I work on Godot 4.2.1 stable, and macOS Sonoma 14.3.1.

It prints this warning message: (maybe the [/color] is mistakenly included?)

GDScript Formatter: the command "gdformat" can't be found in your envrionment.
Installs gdtoolkit is required "pip".
	 Please install it and ensure it can be found inyour envrionment.[/color]

I am not sure why this is showing when enabling the plugin. Shouldn't there be a command or menu item to control the installation/update of that package?

By the way, would it be possible to let the user specify which python/pip environment to use when there are multiple of them in the system? And I am not sure about how it executes the shell commands. I configured the PATH variable in zshrc, but not in bashrc. I'm not sure if that's related or could cause errors when trying to find pip.

@Daylily-Zeleen
Copy link
Owner

Daylily-Zeleen commented Apr 5, 2024

I am not sure why this is showing when enabling the plugin. Shouldn't there be a command or menu item to control the installation/update of that package?

These commands' will be checked when enableing, but not all of them are required:

  1. gdformat is required for formatting.
  2. pip is required for installing/updating gdformat.

pip should install by youself, if you want this plugin to install pip, it will required python or any other dependency. In orther words, this plugin can't help you to setup enveriment.

By the way, would it be possible to let the user specify which python/pip environment to use when there are multiple of them in the system? And I am not sure about how it executes the shell commands. I configured the PATH variable in zshrc, but not in bashrc. I'm not sure if that's related or could cause errors when trying to find pip.

Sorry, I'm not familiar with macos.
However, I add two settings to config the actual gdformat and pip commands, if these command can't be found by default, try to change them (plaese download the latest version from Github).

@lethefrost
Copy link
Author

Sorry, I'm not familiar with macos. However, I add two settings to config the actual gdformat and pip commands, if these command can't be found by default, try to change them (plaese download the latest version from Github).

Thank you very much! Now I have 0.0.5, but it cannot be enabled anymore in the plugins setting and pops up

Unable to load addon script from path: 'res://addons/gdscript_formatter/gdscript_formatter.gd'. This might be due to a code error in that script.
Disabling the addon at 'res://addons/gdscript_formatter/plugin.cfg' to prevent further errors.

Do you know what's happening?

@Daylily-Zeleen
Copy link
Owner

Daylily-Zeleen commented Apr 6, 2024

Unable to load addon script from path: 'res://addons/gdscript_formatter/gdscript_formatter.gd'. This might be due to a code error in that script.
Disabling the addon at 'res://addons/gdscript_formatter/plugin.cfg' to prevent further errors.

Do you know what's happening?

Sorry, it's my fault. I use a new constant which not exists in Godot 4.2.
Now I fixed it, please download the latest from github page.

@Daylily-Zeleen
Copy link
Owner

@lethefrost If the issue is solved, please close this issue.

@lethefrost
Copy link
Author

@lethefrost If the issue is solved, please close this issue.

Hi, sorry that I've been quite busy these days and haven't yet found a time to test. I just downloaded from GitHub and at least it can enable now. But seems that the one in the AssetLib isn't up-to-date.

@Daylily-Zeleen
Copy link
Owner

The latest version in AssetLib is waiting for revision.

@LaraSQP LaraSQP mentioned this issue May 24, 2024
@Daylily-Zeleen Daylily-Zeleen self-assigned this May 25, 2024
@Daylily-Zeleen Daylily-Zeleen added the bug Something isn't working label May 25, 2024
@michaelwschultz
Copy link

Thanks for the incredible work @Daylily-Zeleen. My favorite addon by far!

I'm having this issue as well on MacOS. Works great on my PC with Windows.

-- Begin install gdtoolkit.
-- Install gdtoolkit successfully.
%sGDScript Formatter: The command "gdformat" can't be found in your envrionment.
%s	If have not install "gdtoolkit", install it first.
%s	If had installed "gdtoolkit", change "gdformat_command" to a valid command in "res://addons/gdscript_formatter/format_preference.tres", and save this resource.

I'm using pip3 as the pip command due to how MacOS installs pip. Doing this installs gdtoolkit just find and I can verfiy the gdformat command works just fine in the terminal. But for some reason, your addon still can't see it.

Path looks good to me. Any other ideas?

~/Library/Python/3.9/bin/gdformat 

@Daylily-Zeleen
Copy link
Owner

Daylily-Zeleen commented May 27, 2024

@michaelwschultz, please refer to this comment.

I have not macOS device and not familiar with macOS. I'm not sure these steps can help you solve this problem.


By the way, in principle, do not reply to closed issues. Please open a new issue and link the closed one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants