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

Script Language Server #259

Closed roxberry closed 3 years ago

roxberry commented 4 years ago

Describe the bug When Prophet is enabled, all typing in any file type causes a pop up and the log error:

image

[Error - 10:25:29 PM] Request textDocument/completion failed. Message: Unhandled method textDocument/completion Code: -32601

To Reproduce Steps to reproduce the behavior:

  1. Enable Prophet
  2. Type in ANY file type (js, html, scss).

Expected behavior No error message in Script Language Server output No popup

Desktop (please complete the following information):

Additional context New project has this symptom. Older project does not. Disabled all extensions but Prophet in both workspaces.

New project has "Script Language Server" in the Output. Older project does not have that Output source.

New Project

image

Older Project

image
SqrTT commented 4 years ago

Hi @roxberry thank you for reporting. Could you share output of Script Language Server, please?

also potentially, could you try put cartridge path (just copy-paste path from BM) to cartridgesPath your dw.json, please?

roxberry commented 4 years ago

Script Language Server output (obfuscated client info). This occurs as I type (and I assume as the watch uploads):

[Info - 9:24:21 AM] Client created [Info - 9:24:21 AM] Actual cartridges: [{"name":"","fsPath":"/Users/roxberry/Workspaces//cartridges/"}] [Info - 9:24:21 AM] Starting client... Script Server init... [{"uri":"file:///Users/roxberry/Workspaces/","name":""}] [Info - 9:24:22 AM] Server Ready [Info - 9:24:22 AM] Files list => got cartridges files list [Info - 9:24:22 AM] Templates list => got cartridges templates list [Info - 9:24:22 AM] Controllers list => got cartridges controllers list, parse time: 0.01] [Info - 9:24:22 AM] Properties list => [Info - 9:24:22 AM] Configuration done controller modified: Change : file:///Users/roxberry/Workspaces//cartridges//cartridge/controllers/Home.js controller modified: Change : file:///Users/roxberry/Workspaces//cartridges//cartridge/controllers/Home.js controller modified: Change : file:///Users/roxberry/Workspaces//cartridges//cartridge/controllers/Home.js controller modified: Change : file:///Users/roxberry/Workspaces//cartridges//cartridge/controllers/Home.js controller modified: Change : file:///Users/roxberry/Workspaces//cartridges//cartridge/controllers/Home.js controller modified: Change : file:///Users/roxberry/Workspaces//cartridges//cartridge/controllers/Home.js controller modified: Change : file:///Users/roxberry/Workspaces//cartridges//cartridge/controllers/Home.js [Error - 9:25:42 AM] Request textDocument/definition failed. Message: Unhandled method textDocument/definition Code: -32601 [Error - 9:25:42 AM] Request textDocument/definition failed. Message: Unhandled method textDocument/definition Code: -32601

IaroslavVerstiukOSF commented 4 years ago

I have exactly same issue, but it depends on project, it happens only on one where I have non standard SFRA/SG project, as an example I have only cartridges which contains some scripts to customize OCAPI hooks and nothing more, and there I have this issue.

On another project which is based on SFRA all works good, maybe there is some dependencies.

dennis-ryan commented 4 years ago

i noticed that not setting, or removing any existing setting, for "extension.prophet.cartridges.path" from your settings will "fix" the issue. It does so by not starting the Script Language Server in this case.

SBlanchon-Viseo commented 4 years ago

Same issue in my SG project. I don't have any setting in "extension.prophet.cartridges.path", though.

MORNING VSCode launch --> OK, no problem, but this log in Script Language Server terminal

[Info  - 09:28:51] Client created
[Info  - 09:28:51] Actual cartridges: [{"name":"app_sephora_core","fsPath":"c:\\Users\\StephaneBlanchon\\Workspaces\\SEPHORA\\estore-sfcc-sephora\\cartridges\\app_sephora_core"},{"name":"app_sephora_controllers","fsPath":"c:\\Users\\StephaneBlanchon\\Workspaces\\SEPHORA\\estore-sfcc-sephora\\cartridges\\app_sephora_controllers"},{"name":"app_sephora_extended","fsPath":"c:\\Users\\StephaneBlanchon\\Workspaces\\SEPHORA\\estore-sfcc-sephora\\cartridges\\app_sephora_extended"}]
[Info  - 09:28:51] Starting client...
Script Server init... 
[{"uri":"file:///c%3A/Users/StephaneBlanchon/Workspaces/SEPHORA/estore-sfcc-sephora","name":"estore-sfcc-sephora"},{"uri":"ccfs://current-sandbox/","name":"Sandbox - FileSystem"}]
Diagnostics enabled: false
[Info  - 09:28:52] Server Ready
[Info  - 09:28:52] Files list =>
got cartridges files list
[Info  - 09:28:52] Templates list =>
got cartridges templates list
[Info  - 09:28:52] Controllers list =>
[Info  - 09:28:52] Properties list =>
[Info  - 09:28:52] Configuration done
got cartridges properties list, size: 2
got cartridges properties list, parse time: 1.37]
got cartridges controllers list, parse time: 2.066]
req definition:file:///c%3A/Users/StephaneBlanchon/Workspaces/SEPHORA/estore-sfcc-sephora/cartridges/app_sephora_controllers/cartridge/controllers/OnePageCheckout.js
no definition: 135ms 
no completion: 56ms 
no completion: 44ms 
no completion: 54ms 
no completion: 58ms 
no completion: 41ms 
req definition:file:///c%3A/Users/StephaneBlanchon/Workspaces/SEPHORA/estore-sfcc-sephora/cartridges/app_sephora_core/cartridge/scripts/util/DeliveryUtils.js
no definition: 86ms 
no completion: 25ms 
no completion: 65ms 

AFTERNOON VSCode launch --> KO, each 'CTRL' keytab stroke is followed by a new log line in Script Language Server terminal

[Info  - 17:00:20] Client created
[Info  - 17:00:20] Actual cartridges: [{"name":"app_sephora_extended","fsPath":"c:\\Users\\StephaneBlanchon\\Workspaces\\SEPHORA\\estore-sfcc-sephora\\cartridges\\app_sephora_extended"}]
[Info  - 17:00:20] Starting client...
Script Server init... 
[{"uri":"file:///c%3A/Users/StephaneBlanchon/Workspaces/SEPHORA/estore-sfcc-sephora","name":"estore-sfcc-sephora"},{"uri":"ccfs://current-sandbox/","name":"Sandbox - FileSystem"}]
Diagnostics enabled: false
[Info  - 17:00:20] Server Ready
[Info  - 17:00:20] Files list =>
got cartridges files list
[Info  - 17:00:21] Templates list =>
got cartridges templates list
[Info  - 17:00:21] Controllers list =>
[Info  - 17:00:21] Properties list =>
[Info  - 17:00:21] Configuration done
got cartridges properties list, size: 1
got cartridges properties list, parse time: 1.178]
[Error - 17:02:52] Request textDocument/definition failed.
  Message: Unhandled method textDocument/definition
  Code: -32601 
[Error - 17:03:35] Request textDocument/definition failed.
  Message: Unhandled method textDocument/definition
  Code: -32601 
[Error - 17:04:25] Request textDocument/definition failed.
  Message: Unhandled method textDocument/definition
  Code: -32601 
[Error - 17:13:59] Request textDocument/definition failed.
  Message: Unhandled method textDocument/definition
  Code: -32601 

It's really a f*** pain in the neck !!!

Stéphane

SqrTT commented 4 years ago

Hi @SBlanchon-Viseo Thank you for info, but I see no error messages Unhandled method textDocument/definition in your log

SqrTT commented 4 years ago

please note: setting extension.prophet.cartridges.path expected to contain cartridges path like in BM (list of cartridges names), example: app_storefront_controllers:app_storefront_core:bc_library (simply copypasted from BM) but not file system path to cartridges root.

SBlanchon-Viseo commented 3 years ago

I updated my previous POST... And just thought about it :

SqrTT commented 3 years ago

could you update to 1.3.29 (just released) and provide new logs (added few potential places to check), please?

SqrTT commented 3 years ago

any further info?

IaroslavVerstiukOSF commented 3 years ago

on my side issue is not reproducing anymore

SBlanchon-Viseo commented 3 years ago

Hello @SqrTT , i do not have any problem anymore since i updated Prophet Debugger to 1.3.29 ! Thanks.