salesforcedx-vscode
salesforcedx-vscode copied to clipboard
LSP unaware of custom metadata types, and their methods.
Summary
While using VSCode, While 'Surface Semantic Errors' is true Reference a Custom Metadata Type that exists, and the LSP will surface a 'semantic error' stating that the Type is invalid.
if, however, you disable the semantic warnings, and then re-enable them, the error is seemingly fixed until restart.
conjecture
I think the LSP is caching types, and not picking up new metadata types and / or forgetting them after restart.
Steps To Reproduce:
- Enable the option to surface semantic errors in VSCode's Apex settings
- Reference an existing custom metadata type
- See error (image above)
- Disable the option to surface semantic errors
- Save file referencing Custom Metadata
- See error go away
- Re-enable the option to surface semantic errors
- See error not re-appear on file save.
- Restart VSCode, see error re-appear.
Expected result
I would like to expect that the LSP is knowledgeable of custom metadata types, and that the command to refresh sobject types updated the lsp's understanding of custom metadata types.
Actual result
a semantic error is raised.
Additional information
Salesforce Extension Version in VS Code: v56.5.1
SFDX CLI Version: sfdx-cli/7.176.1 darwin-arm64 node-v18.11.0
OS and version: MacOS Ventura (13.0.1)
This issue has been linked to a new work item: W-13465486