Skip to content

williamthome/zotonic-ls

Repository files navigation

"Sponsor" GitHub Repo stars License GitHub CI Status Lines of code Coverage Status Scrutinizer Code Quality Known Vulnerabilities Visual Studio Marketplace Version Visual Studio Marketplace Installs Visual Studio Marketplace Rating (Stars)

Zotonic Language Server

Language server for Zotonic, the Erlang Web Framework.

Features

Syntax highlight

Syntax highlight for Zotonic Template Language (.tpl).

Syntax highlight

Snippets

Zotonic completion for .tpl and Erlang files by pressing Ctrl + Space.
In template files use act prefix for actions, m for models, val for validators, | for filters and for tags just the tag name.
Also some special completions are provided, like the atoms true, false and undefined, for loops, map tag and more.

Snippets

Models

A great help is the models snippets. Typing m. all models are listed and picking one shows all m_get possibilities.

m_get snippets

Other languages completions

  • HTML: Typing < outside a .tpl expression popups HTML snippets.

Go to definition

Navigate to files in the .tpl by pressing Ctrl + Click over file names.

Go to definition

Docs integration

Zotonic documentation is displayed hovering tags, actions, filters, validators, models and translations.

Docs integration

Insltalation

VSCode

Download and install the extension for free at the Visual Studio Marketplace or directly in the VSCode extensions feature.

Todo

Syntax Highlight

Snippets

  • Review arguments and tabstops;
  • CSS completions;
  • Javascript completions.

Docs

  • Review links;
  • Improve style.

Sponsors

If you like this tool, please consider sponsoring me.
I'm thankful for your never-ending support ❤️

I also accept coffees ☕

"Buy Me A Coffee"

Special thanks go to @mworrel for buying me 5x coffees! o/

Contributing

Issues

Feels free to submit an issue on Github.

Setup

git clone https://github.com/williamthome/zotonic-ls
cd zotonic-ls
npm install
code .

Extensions

Make sure you have ESlint and Prettier ESLint extensions installed.

Optionally you can install the Todo Tree extension to see things TODO, to FIXME, or BUG.

Config

  • Open user or workspace settings.json by:
    • Windows/Linux: CTRL + SHIFT + P or File > Preferences > Settings
    • MacOS: CMD + SHIFT + P or Code > Preferences > Settings
  • Add this to the settings file:
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.formatOnSave": true,

Debugging the extension

Press F5 to start debugging. To reload, if in dev window, press Ctrl + Shift + F5 or, if in extension host window, Ctrl + R.

See this article for more information about debugging.