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

Emacs Mode #142

Open
Mercerenies opened this issue Feb 15, 2023 · 3 comments
Open

Emacs Mode #142

Mercerenies opened this issue Feb 15, 2023 · 3 comments

Comments

@Mercerenies
Copy link
Owner

Provide an Emacs mode for GDLisp. The Common Lisp mode we get from our .lisp extension works okay (and we could probably derive from it), but we need our own mode that reflects GDLisp's specific keywords.

@joshcho
Copy link

joshcho commented Jul 21, 2023

What features would be desirable in gdlisp-mode? Experienced with Emacs, but new to Godot. Learning GDScript first before experimenting with GDLisp.

@Mercerenies
Copy link
Owner Author

Good question! I'm also a full-time Emacs user; I've just been using Scheme-mode thus far for my own testing, but having a dedicated GDLisp mode would be pretty neat.

I think deriving from Scheme-mode would get us pretty close.

  • In terms of syntax highlighting, there's a few things that would have to be added, most namely the colon-based foo:bar syntax for method calls and field access.
  • Imenu tags should be pretty easy: just grep for defn, defclass, defmacro, etc.
  • The current version of GDLisp compiles to GDScript, so you could have a compile command to do that inside of Emacs, though it's worth noting that GDLisp 2.0 will probably be directly interpreted inside Godot, so the compile step will likely be going away in the future.
  • The project root (for Projectile types of things) should be pretty easy to find: just follow the directory tree up until you hit a project.godot file. If one doesn't exist, treat current working directory as the project root (this is what GDLisp does internally anyway).
  • Completions (company-mode, etc) can resolve without too much trouble. Every import is a (use ...) directive at the top of the current file, so figuring out what's in scope shouldn't be too bad.

@joshcho
Copy link

joshcho commented Jul 21, 2023

Thank you for the detailed response! I will try scheme mode, and if it feels limiting, maybe start experimenting and dogfooding. Great work btw, Lisp + Gamedev is great.

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