prophet icon indicating copy to clipboard operation
prophet copied to clipboard

Autocomplete in controllers is not working

Open Blacktron opened this issue 2 years ago • 7 comments

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

  • OS: Windows 10/11
  • VSCode version: 1.63.1
  • The extension version: 1.4.25

Blacktron avatar Dec 16 '21 14:12 Blacktron

Same in SiteGenesis

aduponchel avatar Feb 08 '22 14:02 aduponchel

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

SqrTT avatar Feb 08 '22 14:02 SqrTT

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

aduponchel avatar Feb 08 '22 15:02 aduponchel

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

SqrTT avatar Feb 08 '22 15:02 SqrTT

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 avatar Feb 08 '22 15:02 aduponchel

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

aduponchel avatar Feb 08 '22 16:02 aduponchel

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)

SqrTT avatar Apr 21 '22 10:04 SqrTT