SqrTT / prophet

Prophet Debugger (SFCC sandboxes via SDAPI 2.0) extension for VS Code

Home Page:https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intellisense broken in Visual Studio Code when Prophet is enabled

poebrand opened this issue · comments

Describe the bug
When Prophet is enabled in Visual Studio Code, Intellisense no longer works normally.

To Reproduce
Steps to reproduce the behavior:

  1. Disable all VS Code extensions.
  2. Create a simple JavaScript function containing an object declaration. Example:
    function logInfo(profile) { var logObject = { action: 'deleteCustomer', customerNumber: profile.customerNo }; }
  3. Within the function, enter the object name followed by a period. Intellisense does show the members of the object.
    image
  4. Enable the Prophet extension.
  5. Within the function, enter the object name followed by a period. Intellisense does not show the members of the object.
    image

Expected behavior
Intellisense continues to work when Prophet is enabled. In the example, entering period after the object name should show the available properties (action, customerNumber).

Screenshots
See above.

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise - Version: 22H@
  • VSCode version: 1.85.1
  • The extension version [e.g. 22]: 1.4.40

Additional context
No other extensions enabled besides Prophet.

If Prophet is extending VS Code intellisense, it would probably be good to have a setting for enabling/disabling that feature.

HI @poebrand
thanks for reporting issue.

Yes, your assumption is correct. Prophet contains it's own language server for JS files for cartridges and this language server is desired to work better in SFCC context (ie resolves paths in SFCC manner, extends types with SFCC types etc). And yes, it's disables internal language server to avoid collisions.
But seems in your case seems language server in not running. Potential reason for it lack of knowledge of SFCC site context. In order to run language server requires to have info about cartridges and cartridges paths to be able to resolve paths like */cartridge_name/some_file or module.superModule

cartridges path may be extracted by extension from site.xml files if present in workspace or from dw.json (via cartridgesPath property). Additionaly current context must be selected via menu in right bottom corner

image

in case Prophet is not eble determinate a path it's shows warning during startup

image

Would you confirm you have proper context selected and issue still persist?

After testing this does solve the issue, the intelisense is a little bit slower but works still

Hi @SqrTT, it would be really nice to be able to turn the extension's language server off as suggested by @poebrand.
For my projects I usually don't use context feature and I would expect standard InteliSense to be still working.
I tried to play with context, but in my case only downgrading to v1.3.33 helped.