forcedotcom / salesforcedx-vscode

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

`<style>` tag breaks VF Language Server #5602

Closed ChuckJonas closed 1 month ago

ChuckJonas commented 1 month ago

Summary

Adding a <style> tag to a VF page breaks the VF language Server in vscode.

Steps To Reproduce:

  1. Create a new VF page
  2. Add this content
<apex:page applyHtmlTag="false"  showHeader="false" sidebar="false" standardStylesheets="false">
    <html>
        <head>
            <style> body { font-family: 'Arial Unicode MS'; } </style>
        </head>
    </html>
</apex:page>
  1. Save

Expected result

There should be no issues and the language server should continue to work

Actual result

The end of the style tag gets marked with a red syntax error (but no "problem"). After saving, the following error when be output:

[Error - 2:02:13 PM] Request textDocument/rangeFormatting failed.
  Message: Request textDocument/rangeFormatting failed with message: js_source_text is not defined
  Code: -32603  

When this happens, prettier formatting no longer works.

Additional information

QuoteContract_page_—_realself

Salesforce Extension Version in VS Code: v60.13.0

Salesforce CLI Version: @salesforce/cli/2.41.8 darwin-arm64 node-v20.12.

OS and version: OSX

VS Code version: 1.87

Most recent version of the extensions where this was working: No idea

daphne-sfdc commented 1 month ago

Hi @ChuckJonas, We are aware of this issue - it's the same one as https://github.com/forcedotcom/salesforcedx-vscode/issues/5593 which was also filed this week. We have filed a bug for this in our backlog from the previous issue and will add this occurrence to our bug.

Closing this issue, as it is a duplicate issue.