forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
954 stars 406 forks source link

Inconsistent Formatting between Visualforce extension and Org #4150

Open jonny-harte opened 2 years ago

jonny-harte commented 2 years ago

When formatting a .component or .email (I assume .page too) a space is added at the end of some tags. However, when the same file is retrieved from the Org the space has been removed.

eg. VSCode - Org <apex:component> - <apex:component > <messaging:htmlEmailBody> - <messaging:htmlEmailBody >

This leads to lots of formatting diffs when comparing / retrieving from Orgs adding lots of noice when trying to review / debug etc.

Expected result

Formatting between VSCode and Org should be the same.

Actual result

Formatting Diffs are detected.

Additional information

Screenshot 2022-05-23 at 4 26 51 pm

Salesforce Extension Version in VS Code: 54.12.0

SFDX CLI Version: sfdx-cli/7.150.0 darwin-x64 node-v16.15.0

OS and version: MacOS 12.3.1

floralan commented 2 years ago

Hi @jonny-harte, what is the formatting tool you use? After you format the file, did you do deploy before retrieving the source from the org?

jonny-harte commented 2 years ago

@floralan I'm using the VSCode Visualforce extension formatter, prettier produces even more inconsistencies such as adding a new line at the end etc. which the Org removes.

Yes after formatting the file I deploy to the Org and then retrieve it again.