mighty-gerbils / gerbil

Gerbil Scheme
https://cons.io
GNU Lesser General Public License v2.1
1.15k stars 110 forks source link

First Class Support for editors other than emacs #782

Open vyzo opened 1 year ago

vyzo commented 1 year ago

Not everyone is a grey bird; we want to support modern editors:

There may be funding available for this project.

Prerequisite: #781.

p1xelHer0 commented 8 months ago

I am looking into writing some documentation for setting up an environment in Neovim. I've managed to get everything from evaluating code inside the editor and Parinfer to "rainbow parentheses” highlighting up and running. It has been a solid experience for me.

chiefnoah commented 8 months ago

I'm particularly interested in this as well. My current setup is Conjure, rainbow-delimiters, vim-sexp, and the treesitter plugin for Scheme. How did you get Parinfer working?

p1xelHer0 commented 8 months ago

Right now I've been using https://github.com/eraserhd/parinfer-rust which requires a Rust installation to compile the plugin - it might not be the best "default" choice to recommend people.

This is a "backend" for several editors including Neovim and Emacs. A little note from the page:

This plugin, unlike others available for Vim, implements "smart" mode. Rather than switching between "paren" mode and "indent" mode, parinfer uses information about how the user is changing the file to decide what to do.

Even though I think the overlap of people who might be interested in "systems language Scheme" using Neovim and people who have Rust installed is basically 99/100.

There is https://github.com/gpanders/nvim-parinfer which is implemented in pure Lua and hence would require no dependencies. This would probably be safer to recommend to people even though I have not used it.

chiefnoah commented 8 months ago

I found both implementations of parinfer to mangle my Gerbil code by default (I'm not sure if this is something that could be addressed with config), so I dropped them in favor of vim-sexp's simpler parenthesis matching. Parinfer really doesn't like #;, using, and probably anything else that uses non-vanilla-ey Lisp syntax.

p1xelHer0 commented 8 months ago

That might just be me not having enough experience with the language and Lisps overall. Does anyone have a code example where it get mangled I could try out?

Otherwise I'll have to checkout something like vim-sexp or perhaps https://github.com/julienvincent/nvim-paredit. Still new to this S-expression thing. :)

chiefnoah commented 8 months ago

Try using #; on any form like so: #;(displayln "hello"). This example will probably also get mangled.

p1xelHer0 commented 8 months ago

Okay, so yes, I've noticed that this example breaks using #;

(def (test a b)
  (+ a b))

#;(def (test a b)
  (+ a b) ; <- the `)` gets removed and thus the code is broken

Back to the drawing board I guess.

metaleap commented 2 months ago

Like I mentioned in chat channel, I'll be on the VSCode topic as soon as the lsp package gets fully stubbed out from current LSP specs, which I kinda see as my first Gerbil code exercise and contribution. Haven't started yet but aiming to, asaP.

metaleap commented 2 months ago

VSCode update: for now minimal / prototypal version that talks to #781 at https://github.com/metaleap/vscode-gerbil-scheme, we'll probably move it to mighty-gerbils eventually way down the line, I reckon.

Most dev effort is now being spent on LSP serving side, since the VSC ext uses MS' existing LSP-clienting lib: so as the LSP server grows its feature set, the VSC ext picks them up client-side automatically.