Zotonic Language Server

Hi all!

I just pushed a fresh repo for Zotonic support as a Microsoft Language Server Protocol (LSP).
A minor code implementation has been made until now, just some ideas.
My goal is to create code autocomplete for Zotonic features, integrate hovering code with Zotonic docs, go to definitions like templates and libs, and syntax highlight for the Zotonic Template (.tpl).

Some features:
https://raw.githubusercontent.com/williamthome/zotonic-ls/main/images/zotonic-ls.gif

Repo link:

Feel free to contribute o/

@mworrell Zotonic team is according with something like that?

13 Likes

Wow! What a great work, and wonderful idea!

6 Likes

Amazing work :metal:! Need more similar tools for other Erlang/OTP projects! Keep going!

5 Likes

That looks really nice! I think my colleague will be so happy with this.

I guess I finally have to look into setting up LSP in my vim setup.

6 Likes

Wow, great work @williamthome, looks really promising!!!

5 Likes

I just released a minor version with just syntax highlight as a feature.
For now, only a VSCode extension has been published.
You can find the extension in the VSCode extensions feature or at the visual studio marketplace.

4 Likes

Version 0.0.4 released with some issues related to syntax highlight solved.
The next goal is to provide some completions.

3 Likes

Version 0.1.0 released with a bunch of completions for tpl files and also for Erlang.

4 Likes

Version 0.2.0 is released with go to definition implemented.

3 Likes

Docs integration in v0.3.0.
At the moment, the features are:

  • Syntax highlight
  • Snippets
  • Go to definition
  • Docs integration

See the README for more about.

5 Likes

I really have to start using this, something for coming week!

Wonderful work, which will help a lot with writing Zotonic sites.

5 Likes

There is a new nice feature in v0.4.0, it is the model completion.
Now all models and their m_get patterns are turned into snippets.
Check it in action:
m_get_snippets

3 Likes

This is really impressive. How did you do this? Regexps or parsing of the module?

3 Likes

Using RegExp.
Here, first I find all models in the workspace, then when one selected by the user, find all m_get in the model here.
There is no cache or previous state, the function always looks for the models in the workspace and finds the m_get functions.

2 Likes

HTML completions in v0.5.0.
Now typing < outside a .tpl expression popups HTML snippets.
Try it in VSCode downloading and installing the extension.
Support me by buying me a coffee, like @mworrell :smiley:

4 Likes

v0.6.0 released and provides template path completions for extends , include , catinclude , all include and all catinclude tags.
include_extends_snippets

4 Likes