bytecodealliance / wasmtime

A fast and secure runtime for WebAssembly
https://wasmtime.dev/
Apache License 2.0
15.38k stars 1.3k forks source link

ISLE IDE functionality #5752

Open bjorn3 opened 1 year ago

bjorn3 commented 1 year ago

Currently ISLE doesn't have any IDE functionality. It would be nice to get the following:

cfallin commented 1 year ago

I would love for an LSP implementation to exist someday for ISLE -- if anyone is looking for a fairly substantial and impactful, but well-defined and orthogonal, project, then this would be a great one.

Regarding syntax highlighting and automatic code formatting: I've gotten decent results by treating ISLE like Lisp, FWIW: lisp-mode in Emacs auto-indents the s-expressions and lets me navigate the structure (paired parens, up a level, etc). Vim likely has equivalents too. A very janky first-draft implementation of isle-fmt might just be Emacs in batch mode running indent-region over the file! (Ideally we have something more self-contained and efficient than that eventually, of course.)

jameysharp commented 1 year ago

Apparently somebody has already implemented the "run Emacs in batch mode" approach to formatting Lisp source: https://github.com/eschulte/lisp-format/blob/master/lisp-format

elliottt commented 1 year ago

As a quick way to get go-to-definition working, it would be pretty easy to emit a tags file from islec. vim and emacs both know how to navigate those, and that could make working with the codebase a little bit easier.

bjorn3 commented 1 year ago

I don't think it would be much harder to implement a basic lsp server. Rust-analyzer has the lsp-server crate that does half the work.

yuyang-ok commented 1 year ago

https://github.com/yuyang-ok/isle-analyzer/blob/main/editors/code/README.md I have been developing IDE support for ISLE language a while. right now I think it is ready to launch.

bjorn3 commented 1 year ago

Cool! What license does it have?

yuyang-ok commented 1 year ago

@bjorn3 Apache License 2.0 :-)

jwnrt commented 1 month ago

I made a tree sitter grammar which is working pretty well for syntax highlighting and navigation in Helix, but I haven't tested it very thoroughly yet.

https://github.com/jwnrt/tree-sitter-isle

FYI, I think the grammar in the language reference has fallen out of sync with the parser. It's missing some additions like if-let, if, partial, pure, and infallible.

cfallin commented 1 month ago

@jwnrt this is pretty cool! If you'd like to link to it from the ISLE docs, please feel free to submit a PR for that (maybe cranelift/isle/docs/language-reference.md -- we'd be happy to take updates to the grammar there too if you have them top-of-mind, as it seems likely we've missed updates there as you note).