SqrTT / prophet

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

Autocomplete in controllers is not working #308

Closed Blacktron closed 1 year ago

Blacktron commented 2 years ago

Describe the bug When the Prophet Debugger extension is active, the autocomplete in js controllers (SFRA) is not working. If the extension is disabled then it works fine. Screenshots attached.

To Reproduce Steps to reproduce the behavior:

  1. Open any controller (Home.js for example)
  2. Start typing res for example (try to get the viewData from the response object)
  3. Observe: there are only suggestions starting with 'req'

Expected behavior I should be able to see a list of possible options which can be invoked on the response object, like res.getViewData()

Screenshots 1

Desktop (please complete the following information):

aduponchel commented 2 years ago

Same in SiteGenesis

SqrTT commented 2 years ago

could you try solution from here: https://github.com/SqrTT/prophet/issues/310#issuecomment-1031705400

aduponchel commented 2 years ago

Yes I have already try and unfortunately it does not seems to fix the issue. Actually, I got cartridgesPath already defined in my dw.json file but something like 2 weeks ago, autocomplete completly stops. Some of my colleagues meet the same issue but not everyone, we do not change anything on our config except updating vscode. If I open a file using CTRL-N and setting the language feature to Javascript, it works. But when using js files from ./cartridges/**/cartridge/ I have no more autocomplete even using a empty file with only strings variables. It seems not to be related to instance either, I trade dw instance with a colleague without any issue and the issue remain for me.

We all use the last vscode version 1.64 on W10 WSL

SqrTT commented 2 years ago

Could you confirm you have Script Language Server running, please? image

aduponchel commented 2 years ago

No I cannot find it :/ Maybe it comes from there ? I have switched extension.prophet.script.server.disable.diagnostics from true to false, no Script Language Server for both.

EDIT: I don't have it when I open the project using a .code-workspace but I have it when using folder. Using folder to run vscode, autocomplete works in ./cartridges/**/cartridge/**/*.js

aduponchel commented 2 years ago

It seems related to

{
    "name": "Sandbox - FileSystem",
    "uri": "ccfs://current-sandbox"
}

from the .code-workspace. However even if you delete it, when using "extension.prophet.sandbox.filesystem.enabled": true,, it will write it again, so next time you start vscode using .code-workspace, autocomplete will be broken.

I will set to false extension.prophet.sandbox.filesystem.enabled until we get more info. If you need more details, feel free to ask. Thank you for your help SqrTT :)

SqrTT commented 2 years ago

there was issue in SandboxFileSystem Script Language Server was unsuccessfully trying to find cartridges there. This should be fixed in latest release (v1.4.28)