Zotonic Language Server
Language server for Zotonic, the Erlang Web Framework.
Features
Syntax highlight
Syntax highlight for Zotonic Template Language (.tpl).
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.
Models
A great help is the models snippets. Typing m.
all models are listed and picking one shows all m_get
possibilities.
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.
Docs integration
Zotonic documentation is displayed hovering tags, actions, filters, validators, models and translations.
Insltalation
VSCode
Download and install the extension for free at the Visual Studio Marketplace or directly in the VSCode extensions feature.
Todo
Syntax Highlight
- Improve semantic highlight. See:
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 ☕
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
- Windows/Linux: CTRL + SHIFT + P or
- 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.