salesforcedx-vscode icon indicating copy to clipboard operation
salesforcedx-vscode copied to clipboard

VF Language Server - textDocument/documentHighlight failed

Open humairazaman-devsinc opened this issue 9 months ago • 8 comments

Summary

I have a VisualForce page. It has many tags, including apex tags, html tags and a script tag, and nothing goes wrong. The moment I add a

  Request textDocument/documentHighlight failed.
  Message: Request textDocument/documentHighlight failed with message: Debug Failure. False expression.
  Code: -32603 

The error message changes slightly according to unknown circumstances, I have also noticed js_source_text is not defined, but the error code remains the same.

If I comment out the script tag, everything works, and there is no error message.

EDIT: I just realized that Debug Failure. False expression. triggers if I click a line of code within the

Steps To Reproduce:

  1. Have a VisualForce page.
  2. Add a
  3. Attempt to run the formatter.

Expected result

Code is formatted.

Actual result

Code is not formatted, instead, there is an error message in the Visualforce Language Server output.

Additional information

Screen Shot 2024-05-10 at 8 43 01 AM

Salesforce Extension Version in VS Code: v60.12.0

Salesforce CLI Version: v60.12.0

OS and version: Mac v 12.7.4

VS Code version: Version: 1.89.0 (Universal)

Most recent version of the extensions where this was working: It never worked for me.

humairazaman-devsinc avatar May 10 '24 13:05 humairazaman-devsinc

Hi @humairazaman-devsinc, Can we see what other error messages are present? What are the 5 errors in the Problems tab? And what do you see when you run SFDX: Toggle Developer Tools in the command palette?

daphne-sfdc avatar May 13 '24 19:05 daphne-sfdc

The errors as pertains this page are: Screen Shot 2024-05-14 at 4 22 12 AM

I am not sure about any other messages, I believe there was at least one other message, but I was not paying attention at the time and I have no idea how to trigger it other than all this only happening after I added the style tag (to reformat the page, I have regularly been commenting out the style tag so it has been well proven to be the source of the problem).

SFDX: Toggle Developer Tools gave a No Matching Commands in the command palette, which offered Developer: Toggle Developer Tools as the closest alternative.

The SLDF extensions I am using are:

  • Salesforce Extension Pack v60.12.0
  • Salesforce Extension Pack (Expanded) v60.12.0

humairazaman-devsinc avatar May 14 '24 09:05 humairazaman-devsinc

Hi @humairazaman-devsinc,

Sorry about the typo - I did mean Developer: Show Developer Tools.

You see this every time you uncomment the style tag, right? If you can consistently reproduce the issue this way, can you please comment and uncomment the style tag again to produce the error a second time? And please send us all the error messages that you see.

daphne-sfdc avatar May 14 '24 13:05 daphne-sfdc

https://github.com/forcedotcom/salesforcedx-vscode/assets/139564731/99657c82-ec7f-4d6c-a587-c5c5a7a7d93f

^ This is what happens on commenting/uncommenting the code, on formatting, on clicking the style line (I forgot to make it absolutely clear, but clicking something other than the style lines doesn't cause trouble) and on opening the dev tools.

I haven't used the dev tools before, so if there was something else you wanted to see, let me know and I'll check that too.

One other problem that I forgot to add was that if you change it and try to deploy it, the Output tab remains stuck on the VF Language Server and wont show the result of the deployment or anything else:

https://github.com/forcedotcom/salesforcedx-vscode/assets/139564731/89211682-0797-4c3a-b645-b15dc3656b8e

humairazaman-devsinc avatar May 14 '24 15:05 humairazaman-devsinc

@humairazaman-devsinc Thank you for your video of the issue. Our team is currently working on an attempt to reproduce this issue. We'll let you know when we have a reproduction and are able to proceed. Thank you for your patience.

daphne-sfdc avatar May 14 '24 21:05 daphne-sfdc

This issue has been linked to a new work item: W-15773029

git2gus[bot] avatar May 15 '24 18:05 git2gus[bot]

Hi @humairazaman-devsinc, Our team has found a reproducer for this error and have identified this to be a bug. We have created a new work item and will prioritize it in our next grooming session.

However, I'm still able to deploy the Visualforce page to my scratch org and see the results of the deployment after seeing the error. Since the error only happens when you format, are you able to deploy if you turn off format on save? If you save without formatting, are you able to deploy the Visualforce page and see the results?

daphne-sfdc avatar May 15 '24 18:05 daphne-sfdc

Yes, I can still deploy even with the error. The Output tab remains stuck on the VF Language Server potentially because every time it tries to move away, another error comes in and deems the VF Language Server the most relevant view. As such, while the deployment happens, it is hard to see the logs for it, unless I preemptively move to a different tab, and even then, sometimes the problem persist for a small while.

Everything actually works fine, even the formatter can be made to work with an outside linter or via commenting and uncommenting the style tag. There is no real blocker, only a major inconvenience.

Thanks for the help, and looking forward to having this fixed whenever it happens.

humairazaman-devsinc avatar May 15 '24 19:05 humairazaman-devsinc