Closed aalv-vt closed 3 years ago
Hi @aalv-vt - Thanks for reaching out. I have a couple questions: 1) What version of the Salesforce extension pack are you using? 2) Do you have the Visualforce > Format: Enable setting enabled in VS Code?
@smaddox-sf I'm having a similar issue. To confirm I have Visualforce > Format Enabled. If I Disabled it the Message Extension 'Prettier - Code formatter' cannot format ...
doesn't appear.
@smaddox-sf,
Hi @aalv-vt - Thanks for reaching out. I have a couple questions:
- What version of the Salesforce extension pack are you using? v52.3.0
- Do you have the Visualforce > Format: Enable setting enabled in VS Code? Yes.
If you are using Prettier as the code formatter for visualforce, you should also add the following glob pattern to your .vscode/settings.json
file.
"prettier.documentSelectors": ["*/.page"]
Otherwise, if you are using the formatter from visualforce language server, add the following setting to override the default formatter setting.
"[visualforce]": {
"editor.defaultFormatter": "salesforce.salesforcedx-vscode-visualforce"
}
Thanks @xyc the glob pattern didnt work but the below did.
"prettier.documentSelectors": ["**/*.{cmp,page,component}"],
Summary
Does not format Visualforce .page files.
Steps To Reproduce:
Create a Visualfoce page with the following code
</apex:page>