SqrTT / prophet

Prophet Debugger (SFCC sandboxes via SDAPI 2.0) extension for VS Code
https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet
Other
143 stars 59 forks source link

Intellisense broken in Visual Studio Code when Prophet is enabled #374

Open poebrand opened 8 months ago

poebrand commented 8 months ago

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):

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.

SqrTT commented 8 months ago

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?

maxjf1 commented 8 months ago

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

foegit commented 6 months ago

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.