IHP Routes Syntax Highlighting
A VS Code extension that provides syntax highlighting for the IHP web framework's [routes| ... |] quasi quotes in Haskell files.
Features
Highlights the following elements:
- HTTP methods:
GET, POST, PUT, PATCH, DELETE, WS, HEAD
- URL paths: Static path segments
- Path captures:
{param} and {+splat} syntax
- Query parameters:
?param¶m syntax
- Field aliases:
#alias syntax
- Action names:
*Action functions
- Comments:
-- comment lines
Example
[routes|webRoutes
GET /posts?search PostsAction { searchFilter = #search }
GET /posts/new NewPostAction
POST /posts CreatePostAction
GET /posts/{postId} ShowPostAction
GET /posts/{postId}/edit EditPostAction
PATCH /posts/{postId} UpdatePostAction
DELETE /posts/{postId} DeletePostAction
|]
Installation
From the VS Code Marketplace:
- Open VS Code Extensions (
Ctrl+Shift+X)
- Search for "IHP Routes"
- Install and reload
From a .vsix file:
code --install-extension ihp-routes-quasi-0.1.0.vsix
Development
npm install
npm run compile
F5 to test
Publishing
vsce package
vsce publish -p <publisher-token>
License
MIT
| |