godot-gdscript.el
godot-gdscript.el copied to clipboard
Add the package to melpa?
I'm using spacemacs and find it much easier to install packages from melpa instead of locally, would it be possible to add this to the repository?
Hello, @MRFaria, How are you?
It should be possible to add this package to MELPA. However, to be honest, I have to learn the procedures to do so -- there are a few rules to follow. For instance, if I recall correctly, there is a pre-defined set of keywords to use on the files, which I did not know when I wrote this mode.
As for the package itself, I guess it would be more useful to split it into two or three (mode, Company back-end, perhaps the snippets).
Due to personal tasks, I will not be able to work on this at this time, though, for which I apologize. I will try scheduling as soon possible.
Regarding Spacemacs, you can fetch packages from Github itself (at least on a new layer):
(godot-gdscript-mode
:location (recipe
:fetcher github
:repo "francogarcia/godot-gdscript.el"))
I have a personal (albeit bare bones) Godot layer for Spacemacs. Should you wish to check out, I can add it to snippet or a repository. If there is interest, perhaps I could request adding it to Spacemacs itself (after adding this package to MELPA).
Thanks for your interest -- hopefully the mode can be useful for your endeavours!
Best regards, Franco
Thanks! That's a nice tip for spacemacs. I still haven't got autocompletion to work as I hadn't read initially the bit about having to compile Godot from source to add the custom C++ module. I am currently on Windows and compiling Godot sounds like a pain.
Compiling Godot on Windows is actually straightforward, as the project includes all its dependencies (the documentation is quite good: http://docs.godotengine.org/en/stable/development/compiling/). Although it does require an initial effort to setup the development environment (for instance, Python 2.7 and SCons), compiling the engine afterwards requires only a few commands (change j8 to the desired number of threads):
REM For 32 bits: VS2015 x32 Native Tools Command Prompt
REM For 64 bits: VS2015 x64 Native Tools Command Prompt
REM Editor for Windows.
C:\Python27\Scripts\scons.bat -j8 platform=windows
REM Export templates for Windows.
C:\Python27\Scripts\scons.bat -j8 platform=windows tools=no target=release
C:\Python27\Scripts\scons.bat -j8 platform=windows tools=no target=release_debug
You could even write a batch script to automate the process.
Do note that, should you use the regular command prompt instead of Visual C++/Visual Studio one, you will have to run an additional command to initialize environment variables. If I recally correctly, it is something like:
REM Use x86 if compiling for 32-bit.
REM For additional options, check <https://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx>.
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64
Regardless, GDNative (https://godotengine.org/article/dlscript-here) might eliminate the need for a custom build of the engine soon.
Regarding auto-completion, I have never tested auto-completion on Windows, though. The curl dependency might be an issue there. Besides, it seems that gd-autocomplete-service was updated since I had implemented the code -- I will include checking for compatibility to the task list.
I'd also be interested in seeing this in melpa and also how you have your spacemacs layer set up. I tried setting up my own but getting errors when trying to load it.
helm-M-x: Autoloading file /home/ludvig-new/.emacs.d/elpa/26.2/develop/godot-gdscript-20190318.54/godot-gdscript.elc failed to define function godot-gdscriptError during redisplay: (eval (spaceline-ml-main)) signaled (void-variable flycheck-current-errors)
Edit: My packages.el: https://pastebin.com/QwLacGQ3
Hello, @lboklin , How are you?
Apologize for the time. Time has been short as I have been finishing a PhD.
I'd also be interested in seeing this in melpa
Although I had prepared the code base to submit to Melpa, I noticed that there was a GDScript mode available there (https://melpa.org/#/gdscript-mode). If I recall correctly, from the instructions, they recommend to avoid duplicates.
If there is interest, I could try contacting the author from the mode to verify whether she/he would be willing to allow the change. It probably will take a while before I have time to investigate, though.
how you have your spacemacs layer set up
I have created a repository with my personal layer at https://github.com/francogarcia/spacemacs-godot-layer. It requires path changes to use the layer itself and some keybindings.
It is important to note that I am using Spacemacs' branch "develop" and the commit 9a8612e8c. I have not updated it in a while (nor other packages); therefore, it might not work with a more recent commit.
I tried setting up my own but getting errors when trying to load it.
Your packages.el file seems to be OK. A common error is forgetting the layer name in function names, which is correctly defined there (as comments suggest that your layer's name is "gdscript").
The error message is related to Flycheck. If you are using a more recent branch, Spacemacs (or Flycheck) might have changed something related to it.
I will update Spacemacs (and all my packages) in the next days to verify.
Once again, I apologize for the late reply. Best regards, Franco
Thank you, I got your configuration to load. I just renamed it from franco-godot to gdscript (the directory and replaced all references). I'm on develop too (a month old, 697d3b88a).
From what I've seen of the existing gdscript-mode it's not really in a useable state, so yours should probably be the one to be in melpa if any.
Hope you're well and good luck with your PhD.
Hi, that's true - gdscript-mode in Melpa is of very low quality. I wrote over 2k LOC of GDScript using it and it was so painful I finally started looking for alternatives. It was quite surprising that there is a much better mode (godot-gdscript ofc. :) ) which is not on Melpa but "hidden" somewhere on Github. @francogarcia you should really consider pushing your module to Melpa. There are probably more people like me who think that the best emacs mode for GDScript is on Melpa and they have to live with that.