So the new adobe vscode extension seems to autofor...
# ide
t
So the new adobe vscode extension seems to autoformat cfm files on save, but not cfc files? CFBuilder had this issue too iirc. Is that intended behavior for some reason? And are the formatting rules configurable? I couldn't find them.
m
Are you saying that when you save a .cfm file it is altering the code in some way? Like reformatting your tabs and the like? If so, this is not intended behavior. There IS an option to do this but it is not "on save". Can you confirm that you don't have another plug-in that might be interacting here?
r
I can't get it to format any files.
t
@Mark Takata (Adobe), yeah. When I have the extension enabled, when i save a cfm file, it converts all my tabs to spaces, and puts my braces on a new line:
Copy code
if() {
→stuff
}
becomes
Copy code
if()
{
····stuff
}
When i disable the extension, it stops doing it. It could be some weird interaction with something else. but it definitely seems related. I will play with it more extensively and report back.
m
huh. yeah, it absolutely does not do that to me. I just copy/pasted that and it didn't do a thing. shift-alt-f will format the file, but that STILL doesn't move the braces down (it did indent things with spaces, which I think might be a capital crime in some places lol)
you can also choose a formatter (mine is set to Adobe ColdFusion)
t
So it seems like it's because I have the editor.formatOnSave option marked in VSCode. That causes it to run the configured formatter on a save action. so I suppose that part at least is expected.
Oh, and I just found the "Profile Preferences" button in the bottom right, which seems to let me configure some of this.
it's still a little odd though. It's doing it for a cfc i just created as a test, but it's not doing formatting on a different cfc i have open. It seems like if you use closures, it won't format the file... If i remove my
reduce()
call from the function, that formats. But as soon as I put it back in, it doesn't do anything anymore.
r
I've noticed the same using each().
r
Formatting needs help. Having more than 1 var statement at the top of a function in a component breaks it.
t
lol. replicated.