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

Instructions link to nowhere. #5

Open
alienbogart opened this issue Apr 4, 2019 · 3 comments
Open

Instructions link to nowhere. #5

alienbogart opened this issue Apr 4, 2019 · 3 comments

Comments

@alienbogart
Copy link

The link for Setting-Up in Emacs is dead.

@francogarcia
Copy link
Owner

Hello, @mrbig033 ,
How are you?

Thank you for the notice.
The link is a cross-reference using Emacs Org-mode syntax. It works correctly when opened in Emacs.
However, it seems that Github does not handle it correctly (github/markup#903), as the underlying parser does not support it.

I added a comment about the set-up information being below. Do you think it it is suitable? Otherwise, I can remove the link to avoid confusion, as most readers will probably refer to it in a browser, rather than in Emacs.

Best regards,
Franco

@alienbogart
Copy link
Author

Thank you very much for your answer.
I was going to write a longer issue here or in another one of your repositories regarding the difficulty in using them fully, but I came to the conclusion that to use all the functions in this this set of tools I would need time and expertise that I don't have. To be honest, the idea of compiling Godot with C++ modules is daunting to me. The people from vim-gdcript3 have found a simpler solution.

I'm not saying this just to gratuitously criticize, I'm still using your package because of yasnippets, indenting and syntax highlighting alone, but there's no linting or completion (vim-gdscript3 have both).

I'd only like to add that the auto-indenting for match blocks is wrong. It should be:

func spritedir_loop():
    match movedir:
        dir.left:
            spritedir = "left"
        dir.right:
            spritedir = "right"
        dir.up:
            spritedir = "up"
        dir.down:
            spritedir = "down"

But instead what I get is:

func spritedir_loop():
	match movedir:
	dir.left:
	spritedir = "left"
	dir.right:
	spritedir = "right"
	dir.up:
	spritedir = "up"
	dir.down:
	spritedir = "down"

Which generates an error.

Again, thank you for the great work. This mode is absolutely necessary, and I'm certain it can be really great in the future. Cheers!

@francogarcia
Copy link
Owner

Hello, @mrbig033 ,
How are you?

Thank you for your feedback -- I appreciated it.

I'd only like to add that the auto-indenting for match blocks is wrong. It should be: (...)

As I was a Godot 2 user until last year, the major mode support only a subset of features introduced by GDScript in Godot 3 (they were last updated in commit b7866cc).

As mentioned in a recent pull request (#4), GDScript has evolved considerably in the last year. Therefore, warnings about new features (requiring support) are always welcome.

I shall update the mode when I have time (for instance, referring to https://godot.readthedocs.io/en/latest/getting_started/scripting/gdscript/gdscript_basics.html to check what has changed). Unfortunately, it will take a while, as I am finishing a PhD.

If there is something else that could help your workflow, feel free to suggest as well.

there's no linting or completion (vim-gdscript3 have both).

Autocompletion requires compiling the engine with module support because that was the solution that was available at the time (circa 2015 for Godot 2). GDNative did not exist back then; therefore, recompilation was mandatory. Godot has plans to support the Language Server Protocol in the future (godotengine/godot#2245), which is something I am waiting.

If there is an alternative, I can investigate it. From the documentation (https://github.com/calviken/vim-gdscript3/wiki/Completion), it does not seem to complete node paths, which was my main use case for the autocompletion module.

For user defined variables and methods, Company https://company-mode.github.io/ can help. As it inspects buffers (company-capf) and directories/files (company-files), you will not need to compile Godot. As you mentioned Vim, you might be interested in reading https://github.com/company-mode/company-mode/wiki/Switching-from-Vim.

For instance, my default Company backends are:

((company-capf :with company-yasnippet) (company-dabbrev-code company-gtags company-etags company-keywords :with company-yasnippet) (company-files :with company-yasnippet) (company-dabbrev :with company-yasnippet))

A similar configuration should result into close results to those described in "Basic completion" in https://github.com/calviken/vim-gdscript3/wiki/Completion. There will not be support for Godot's built-in functions, though.

For linting, as with Language Server Protocol support, there seems to be tools for linting GDScript in progress (godotengine/godot#20513).

Vim's mode (https://github.com/calviken/vim-gdscript3/blob/master/syntax_checkers/gdscript3/godot_server.vim) seems to run the script in command line (-s) and parse the error message. For Emacs, flymake (https://www.gnu.org/software/emacs/manual/html_node/emacs/Flymake.html) or flycheck (https://www.flycheck.org/en/latest/) could offer similar results (see https://www.flycheck.org/en/latest/user/flycheck-versus-flymake.html for differences).

I know that writing a parser using flycheck is straightforward (https://www.flycheck.org/en/latest/developer/developing.html). However, I think flymake is the preferred option since Emacs 26.1, as it is built-in. I have never written a parser for it, though.

If we use flycheck, we can add it as a module to this major mode. Otherwise, with flymake, it could be built-in in the mode itself.

Best regards,
Franco

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