2

I want to get started with Godot and GDScript. When coding I would like to use Pycharm, I installed the GDScript plugin and found some instructions in the docs.

I'm using Linux ( Ubuntu based distro ) with Jetbrains Toolbox and would like to know how to properly configure Pycharm to work with Godot.

Which arguments should get passed to the fields Exec Path and Exec Flags? I tried ~/.local/share/JetBrains/Toolbox/apps/PyCharm-P for the path and --line {line} {file} for the flags but unfortunately nothing happened.

Question3r
  • 2,166
  • 19
  • 100
  • 200

1 Answers1

1

I want to clarify a few things.

  • Exec Path is the path to the application.
  • Exec Flags are command line arguments. It depends on what the external editor supports.

But you don't need to set that. That is for Godot to launch your external editor. However most of us, just open the editor on the project folder along side Godot.

However, what you really would want to do is configure the language server. If I'm not wrong, it runs on localhost on the port 6008 by default, however double check on your editor settings under Network and Language Server. This is how an external editor talks with Godot to get error information, autocomplete, linting, symbol definitions… Without it, any GDScript editor is little than a syntax highlighter. You need to find out how to set that up in your external editor.


As far as I can tell PyCharm is for Python. And I can't stress this enough: GDScript is not Python. Thus, the other answer is correct, you can add (actual) Python support to Godot with Godot-Python. It is a painless installation, you can even get it from Godot's built-in Asset Library. And then you can use PyCharm with Godot. But not with GDScript.


The plugin you link IntelliJ-GDScript is for IntelliJ. I might be mistaken, but aren't IntelliJ and PyCharm different things?

For what I have been able to gather (via Reddit), you need to go to the configuration of IntelliJ-GDScript and setup the path of the Godot executable:

INtelliJ-GDScript configuration screen capture

Usually external editors where you configure the Godot path do so you can launch Godot from them (instead of Godot launching the editor, which is what you get with Exec Path and Exec Flags).

The fact that the above screenshot have you include the path to your project and the file you want to edit is bizarre to me. I can't expect it to lead to a good workflow if I have to edit that every time. Hopefully that is not the case…


Anyway, since I'm not helping much with this answer (I don't think there is a way to get PyCharm to work with GDScript anyway). I'm going to point you towards Visual Studio Code using Godot Tools. The linked page shows how to set Exec Path and Exec Flags if you want to set those, and also how to set the language server.

Another option is Atom with lang-gdscript.

And if you just don't like Microsoft, perhaps VSCodium is what you are looking for.

Theraot
  • 31,890
  • 5
  • 57
  • 86
  • 1
    @Therapot thanks for your answer. AFAIK all Jetbrains IDEs are based on IntelliJ ( same IDE, just other name and plugins ... ) so if Rider works, why not Pycharm? The only thing I wasn't able to find out is the location of the Pycharm executable ( on my Linux distribution when using Jetbrains Toolbox ) – Question3r Apr 26 '22 at 06:26
  • @Question3r I don't know. However, if you have a way to launch PyCharm from command line, you can try that on Godot settings. So, perhaps this works: https://stackoverflow.com/a/27163648/402022 – Theraot Apr 26 '22 at 14:11
  • @Theraot a few notes, you can launch [PyCharm from the command line](https://stackoverflow.com/a/68204044) and the run configuration in the screenshot is [a file that can be edited](https://www.jetbrains.com/help/pycharm/run-debug-configuration.html#save-as-permanent) in an automated way. I'm not experienced with Godot but my 2 cents on the IDE... – bad_coder May 10 '22 at 04:10
  • `just open the editor on the project folder along side Godot` - yes, that was my first attempt at connecting them. The issue there is, when I switch back to Godot, it says "files changed on disk, reload/cancel?" - every time there's a change. I assume that the communication setup here, will avoid that. But I'm still not clear - are we configuring PyCharm to interact with Godot, or Godot to interact with PyCharm? I'm editing gdscript, not Python, using Godot, and just want to use Pycharm as a text-editor. Update - closed open-file in Godot, it stopped complaining. Kludgy, but works... – John C Mar 23 '23 at 14:58