Skip to content
Discussions/Outreach/Rejig - a DAML import formatterForum ↗

Rejig - a DAML import formatter

Outreach7 posts721 views17 likesLast activity Jun 2022
MA
mattOP
Nov 2020

Hi daml devs,

Just wanted to share a tool I created that sorts and formats a module header (import / exports). Its called rejig GitHub - mjstewart/rejig: A module header (imports / exports) formatting tool for haskell and daml and I also created a vscode extension for it too. Hopefully the README explains how it works and install steps.

I totally get that formatting is a personal taste in style, I created this for my own personal haskell and DAML projects based on my own preferences and works a fair bit differently to other formatting styles seen in the wild.

Thought it may be of interest to anyone using DAML if they’re shopping around for options :smiley:

BE
bernhard
Nov 2020

That’s amazing @matt! A first step towards a proper DAML auto-formatter, a much asked-for feature for the IDE. Did you write your own parser, or are you hooking into the DAML parser itself?

MA
matt
Nov 2020

For my own use case to use within haskell and daml projects, I decided to write my own parser for fun and learning.

I hope it might provide some inspiration for any future work in this area and provides another option that would work alongside any other formatters that might get created.

BE
bernhard
Nov 2020

@matt Would you be OK if we linked this on daml.com? I’m creating a page of “Samples”, which includes a section on add-on tooling and integration libraries.

MA
matt
Nov 2020

@bernhard yeah sure go ahead, that’s fine with me :slight_smile:

GY
gyorgybalazsi
Jun 2022

Hi @matt I was trying to use this tool, because its promise sounds great, but always got an error. Which was the last Daml version you tested it with?

← Back to Discussions