commandbox-cfformat icon indicating copy to clipboard operation
commandbox-cfformat copied to clipboard

struct element alignment

Open lmajano opened this issue 4 years ago • 5 comments

@jcberquist what can we do to do alignment for struct literals when doing method calls or assignments.

This code

var s = {
	themeName : currentSite.getActiveTheme(),
	themeRecord : themeRecord,
	site : currentSite
}

// Or This
variables.interceptorService.announce(
  "cbadmin_onThemeDeactivation",
  {
	themeName   : currentSite.getActiveTheme(),
	themeRecord : themeRecord,
	site  : currentSite
  }
);

To look like this

var s = {
	themeName   : currentSite.getActiveTheme(),
	themeRecord : themeRecord,
	site                 : currentSite
}

// Or This
variables.interceptorService.announce(
  "cbadmin_onThemeDeactivation",
  {
	themeName   : currentSite.getActiveTheme(),
	themeRecord : themeRecord,
	site                 : currentSite
  }
);

lmajano avatar Dec 02 '21 22:12 lmajano

I am not sure I follow this issue. Are you saying that cfformat is not aligning the colons in your two examples?

jcberquist avatar Dec 06 '21 19:12 jcberquist

Yes exactly. It’s not aligning.

lmajano avatar Dec 06 '21 20:12 lmajano

I am not able to reproduce this currently. Given your example code above, if I set "alignment.consecutive.assignments": true and the structs are printed over multiple lines, the colons are aligned. Can I see the full settings you are using to see if some other setting is interfering?

jcberquist avatar Dec 06 '21 20:12 jcberquist

Here are the files for you to test wit Archive.zip h.

lmajano avatar Dec 06 '21 22:12 lmajano

I have included our cfformat and the themservice

lmajano avatar Dec 06 '21 22:12 lmajano