cucumber / vscode

Official Visual Studio Code Extension for Cucumber
MIT License
65 stars 16 forks source link

Failure to start extension under latest VS Code #155

Closed tthornton3-chwy closed 1 year ago

tthornton3-chwy commented 1 year ago

👓 What did you see?

Upon opening up any *.feature file, I see:

  Message: Request initialize failed with message: abort(Assertion failed: bad export type for `tree_sitter_c_sharp_external_scanner_create`: undefined). Build with -s ASSERTIONS=1 for more info.
  Code: -32603 

No syntax highlighting, or any features are then produced.

✅ What did you expect to see?

I expected the extension to start properly, and have syntax highlighting, etc.

📦 Which tool/library version are you using?

Cucumber VS Code Plugin: v1.7.0 VS Code (Insiders):

Commit: 47c4c928bdaf0c81996d2dcce4286f63b9f26afd
Date: 2023-04-26T17:51:58.920Z (5 hrs ago)
Electron: 22.4.8
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.4.0
Sandboxed: Yes

My guess is that it has to do with:

🔬 How could we reproduce it?

Be on the latest version of VS Code Open up any *.feature file.

EDIT: This relates to -- https://github.com/microsoft/vscode/issues/166265

nodeg commented 1 year ago

Since VS Code 1.78.0 was released, it happens there as well. I see the following message in the output for the Cucumber Language Server:

[Error - 10:58:18 AM] Server initialization failed.
  Message: Request initialize failed with message: abort(Assertion failed: bad export type for `tree_sitter_c_sharp_external_scanner_create`: undefined). Build with -s ASSERTIONS=1 for more info.
  Code: -32603 
[Error - 10:58:18 AM] Cucumber Language Server client: couldn't create connection to server.
  Message: Request initialize failed with message: abort(Assertion failed: bad export type for `tree_sitter_c_sharp_external_scanner_create`: undefined). Build with -s ASSERTIONS=1 for more info.
  Code: -32603 

And the output from exthost.log

2023-05-05 10:58:18.201 [info] ExtensionService#_doActivateExtension CucumberOpen.cucumber-official, startup: false, activationEvent: 'onLanguage:cucumber'
2023-05-05 10:58:18.257 [error] Activating extension CucumberOpen.cucumber-official failed due to an error:
2023-05-05 10:58:18.257 [error] Error: Request initialize failed with message: abort(Assertion failed: bad export type for `tree_sitter_c_sharp_external_scanner_create`: undefined). Build with -s ASSERTIONS=1 for more info.
    at kr (/home/dgedon/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:8:228)
    at Yt (/home/dgedon/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:7:6885)
    at Immediate.<anonymous> (/home/dgedon/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:7:6732)
    at process.processImmediate (node:internal/timers:466:21)
2023-05-05 10:58:19.259 [error] Error: Client is not running and can't be stopped. It's current state is: starting
    at Hv.shutdown (/home/dgedon/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:67:8644)
    at Hv.stop (/home/dgedon/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:67:8223)
    at Hv.stop (/home/dgedon/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:67:50251)
    at Hv.doInitialize (/home/dgedon/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:67:8048)
    at async Hv.start (/home/dgedon/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:67:4618)
vuon9 commented 1 year ago

I got this error after having the latest update of VSCode, here are my extension host logs for further info:

2023-05-05 14:10:09.334 [error] Error: Client is not running and can't be stopped. It's current state is: starting
    at Hv.shutdown (/Users/vuong.bui/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:67:8644)
    at Hv.stop (/Users/vuong.bui/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:67:8223)
    at Hv.stop (/Users/vuong.bui/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:67:50251)
    at Hv.doInitialize (/Users/vuong.bui/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:67:8048)
    at Hv.start (/Users/vuong.bui/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:67:4618)
2023-05-05 14:10:08.261 [info] ExtensionService#_doActivateExtension CucumberOpen.cucumber-official, startup: false, activationEvent: 'onLanguage:cucumber'
2023-05-05 14:10:08.330 [error] Activating extension CucumberOpen.cucumber-official failed due to an error:
2023-05-05 14:10:08.330 [error] Error: Request initialize failed with message: abort(Assertion failed: bad export type for `tree_sitter_php_external_scanner_create`: undefined). Build with -s ASSERTIONS=1 for more info.
    at kr (/Users/vuong.bui/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:8:228)
    at Yt (/Users/vuong.bui/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:7:6885)
    at Immediate.<anonymous> (/Users/vuong.bui/.vscode/extensions/cucumberopen.cucumber-official-1.7.0/out/extension.js:7:6732)
    at process.processImmediate (node:internal/timers:466:21)
kannan-work commented 1 year ago

Screenshot 2023-05-05 at 10 43 42

Please let me know for any updates on this and how to fix this in VSCode (version: Version: 1.78.0)

aleksdobrev commented 1 year ago

A workaround can be to downgrade to the previous VSCode version. I'm using Version: 1.77.3 (Universal) and it is working just fine for the moment.

jtournemine commented 1 year ago

Reproduced with my system :

Version: 1.78.0 (user setup) Commit: 252e5463d60e63238250799aef7375787f68b4ee Date: 2023-05-03T20:09:00.748Z Electron: 22.4.8 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22000 Sandboxed: Yes

[Error - 9:32:26 AM] Server initialization failed.
  Message: Request initialize failed with message: abort(Assertion failed: bad export type for `tree_sitter_c_sharp_external_scanner_create`: undefined). Build with -s ASSERTIONS=1 for more info.
  Code: -32603 
vuon9 commented 1 year ago

Is this more related to https://github.com/cucumber/language-service rather than this repo itself? I asked because it looks very similar with this issue and tree-sitter stuffs are related to language-service as its dependencies.

stmcarryg commented 1 year ago

Hi, I'm having this issue as well. I confirm, it happens when VSCode is 1.78.* whereas 1.77.3 works perfectly. I had to downgrade VSCode. My Cucumber extension is 1.7.0. Best regards.

alex20465 commented 1 year ago

same issue here.

mweleyam commented 1 year ago

facing same issue

stmcarryg commented 1 year ago

Aparently, this is connected to this: https://github.com/microsoft/vscode/issues/166265#

apenab commented 1 year ago

Same issue....

The-BDD-Coach commented 1 year ago

@xeger has created a patched (hacked) version here: https://github.com/xeger/cucumber-vscode/releases/tag/v1.7.1 that fixes the problem, but it won't be released; you must download it and install it locally if you want to test it.

He considers this to be a hack because the real problem is in the tree-sitter code; it doesn't play well with Electron 22 and the latest version of V8. Once a new tree-sitter is released that fixes the problem we won't need the hack. The tree-sitter problem has been discussed extensively and there is an open PR that appears to fix it: https://github.com/tree-sitter/node-tree-sitter/issues/126 https://github.com/tree-sitter/node-tree-sitter/pull/127

codingj commented 1 year ago

Is there an alternative to Cucumber? My team is very unhappy about them not being able to use the cool Cucumber Extension for their gherkin code.

vuon9 commented 1 year ago

Is there an alternative to Cucumber? My team is very unhappy about them not being able to use the cool Cucumber Extension for their gherkin code.

Name: Cucumber (Gherkin) Full Support Id: alexkrechik.cucumberautocomplete Description: VSCode Cucumber (Gherkin) Full Language Support + Formatting + Autocomplete Version: 2.15.2 Publisher: Alexander Krechik VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete

This one is also good, i was using it for a long time before knowing the official one.

DerZyklop commented 1 year ago

Surprisingly, this is working again for me with the newest VSCode.

LewisCraik commented 1 year ago

Surprisingly, this is working again for me with the newest VSCode.

Still not working for me on VSCode 1.79.2 and Cucumber plugin v1.7.0, both of which appear to be the latest.

jtournemine commented 1 year ago

Hi, Could you share your version with us plz ?

Thx

Envoyé à partir de Outlook pour Androidhttps://aka.ms/AAb9ysg


De : DerZyklop @.> Envoyé : mercredi, juillet 5, 2023 12:57:48 PM À : cucumber/vscode @.> Cc : jtournemine @.>; Comment @.> Objet : Re: [cucumber/vscode] Failure to start extension under latest VS Code (Issue #155)

Surprisingly, this is working again for me with the newest VSCode.

— Reply to this email directly, view it on GitHubhttps://github.com/cucumber/vscode/issues/155#issuecomment-1621521367, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYFJYTW5JTQDPK7OWJO5YDXOVCCVANCNFSM6AAAAAAXNDBF7U. You are receiving this because you commented.Message ID: @.***>

DerZyklop commented 1 year ago

Could you share your version with us plz ?

@jtournemine VSCode 1.80.0 Plugin cucumberopen.cucumber-official: 1.7.0

The-BDD-Coach commented 1 year ago

I have VSCode: Version: 1.80.0 Commit: 660393deaaa6d1996740ff4880f1bad43768c814 Date: 2023-07-04T13:40:17.963Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin arm64 22.5.0

I uninstalled @xeger's patched version and installed 1.7.0 from the Visual Studio Marketplace; it failed immediately with "couldn't create connection to server".

patrickschilder commented 1 year ago

Who is now working on this issue to get it fixed? Should it be fixed in VSCode or the extension itself?

The-BDD-Coach commented 1 year ago

@patrickschilder It must first be fixed in tree-sitter; once a fixed version is released then a new version of the VSCode plugin can be released.

Xeger's patched version works pretty well; it doesn't always identify Gherkin that doesn't have a matching step definition, but go-to-definition works, syntax highlighting works, auto-complete works, and it usually identifies Gherkin that doesn't have a step definition. I am using that until a new official version is available.

jeeeem commented 1 year ago

@patrickschilder It must first be fixed in tree-sitter; once a fixed version is released then a new version of the VSCode plugin can be released.

Xeger's patched version works pretty well; it doesn't always identify Gherkin that doesn't have a matching step definition, but go-to-definition works, syntax highlighting works, auto-complete works, and it usually identifies Gherkin that doesn't have a step definition. I am using that until a new official version is available.

Is it possible to include this fix #165 in the unofficial version (1.7.1)? This fix is for comments that are being strip when formatting.

lotosotol commented 1 year ago

Same problem here: image

xeger commented 1 year ago

@jeeeem just a note that I have included (at least some) comment-stripping fixes in the unofficial build. Are you still seeing all comments stripped while using it?

rob3rz3n commented 1 year ago

Same error using:

imagen
mbieriko commented 1 year ago

Same error using:

Version: 1.81.1 Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794 Date: 2023-08-09T22:18:39.991Z Electron: 22.3.18 ElectronBuildId: 22689846 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Linux x64 6.2.0-27-generic snap

but no problem with same VS Code version on Windows 10

xeger commented 1 year ago

Thank you for the bug report. This is fixed in v1.8.0 which should be published to the Visual Studio Code Marketplace soon, or you can install from the .vsix file in the linked release.

jeeeem commented 1 year ago

@jeeeem just a note that I have included (at least some) comment-stripping fixes in the unofficial build. Are you still seeing all comments stripped while using it?

Sorry for the late reply got busy at work, I just tried the new version (1.8) and it is now working perfectly with this version of VSCode

Version: 1.82.2 (user setup)
Commit: abd2f3db4bdb28f9e95536dfa84d8479f1 eb312d
Date: (6 days ago)
Electron: 25.8.1
ElectronBuildld: 23779380
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.o
OS: Windows NT x64 10.0.22621

but I still encountering the comment issue, whenever there are comments in the end of feature file, it automatically deletes it.

https://github.com/cucumber/vscode/assets/51053482/f3e5889c-322a-424b-8af7-39639d747fa9

xeger commented 1 year ago

Argh @jeeeem; it seems that I've failed to upgrade one of the underlying dependencies to a new-enough version. :( I will need to make a new release tonight, to fix this behavior.

jeeeem commented 1 year ago

Argh @jeeeem; it seems that I've failed to upgrade one of the underlying dependencies to a new-enough version. :( I will need to make a new release tonight, to fix this behavior.

Thanks will wait for the new release. Hopefully that will fix the issue.

xeger commented 1 year ago

Upon further investigation @jeeeem this is a corner case that our original comment-preservation work failed to fix. See @cucumber/gherkin-utils#38 for details.

Basically, leading and inline comments inside a block are preserved; it's just trailing comments that get removed.

Still pretty disruptive, so I'll encourage us to work on a fix as time permits.

jeeeem commented 1 year ago

Upon further investigation @jeeeem this is a corner case that our original comment-preservation work failed to fix. See @cucumber/gherkin-utils#38 for details.

Basically, leading and inline comments inside a block are preserved; it's just trailing comments that get removed.

Still pretty disruptive, so I'll encourage us to work on a fix as time permits.

That's unfortunate, I guess, for now, I will avoid commenting at the end of the file at the moment. Although I'm glad the problem with LSP now works perfectly. Hoping this will be fixed sooner. Anyways, thanks for update. @xeger

DiabloUnicorn666 commented 3 months ago

image Having same issue

jm-paulin commented 3 months ago

same issue as well.

Version: 1.90.1 (user setup)
Commit: 611f9bfce64f25108829dd295f54a6894e87339d
Date: 2024-06-11T21:01:24.262Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22631

and

$ code --list-extensions --show-versions
cucumberopen.cucumber-official@1.10.0
foxundermoon.shell-format@7.2.5
golang.go@0.41.4
josevseb.google-java-format-for-vs-code@1.1.2
ms-azuretools.vscode-docker@1.29.1
ms-python.debugpy@2024.6.0
ms-python.python@2024.8.1
ms-python.vscode-pylance@2024.6.1
possan.nbsp-vscode@0.0.1
redhat.fabric8-analytics@0.9.4
redhat.java@1.31.0
redhat.vscode-xml@0.27.1
redhat.vscode-yaml@1.15.0
visualstudioexptteam.intellicode-api-usage-examples@0.2.8
visualstudioexptteam.vscodeintellicode@1.3.1
vscjava.vscode-java-debug@0.57.0
vscjava.vscode-java-dependency@0.23.6
vscjava.vscode-java-pack@0.27.0
vscjava.vscode-java-test@0.41.1
vscjava.vscode-maven@0.44.0

shall wwe reopen or create a new issue ?

rolger commented 1 month ago

Sorry for the confusion and my previous comment. I removed it and added my finding to https://github.com/cucumber/vscode/issues/234

mfreibergs commented 1 month ago

Also still getting this issue on VSCode v1.19.2 and Cucumber v1.10.0. If I install Cucumber v1.7.0 or later it doesn't throw me any error but the feature files are still greyed out and not interactive.

Screenshot 2024-08-16 at 10 48 34
ant0x64 commented 3 weeks ago

Same image