ast-grep-vscode icon indicating copy to clipboard operation
ast-grep-vscode copied to clipboard

Does not work on windows / global npm installation

Open hediet opened this issue 1 year ago • 7 comments
trafficstars

I like the idea of this extension! Unfortunately, I didn't manage to get it working.

5x2ckzh57i

Version: 1.88.0-insider (user setup) Commit: be210b3a60c7d60030c1d3d92da00d008edf6ab9 Date: 2024-03-15T05:48:19.790Z Electron: 28.2.6 ElectronBuildId: 27476517 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.22631

Code_-_Insiders_GQMp8C1F7T

hediet avatar Mar 15 '24 09:03 hediet

Using pwsh may be the problem. Would you like install it via cmd? by default the command is ast-grep.exe on windows. you can tweak it via https://github.com/ast-grep/ast-grep-vscode?tab=readme-ov-file#extension-settings

HerringtonDarkholme avatar Mar 15 '24 15:03 HerringtonDarkholme

I think npm/yarn just don't generate any .exe files. Neither for PWSH nor CMD.

Code_-_Insiders_Sesd5KgYZE

hediet avatar Mar 18 '24 11:03 hediet

It should be fixed in 0.1.3! Thanks for reporting!

HerringtonDarkholme avatar Mar 25 '24 06:03 HerringtonDarkholme

Still does not work :/ image

Also, when I click x in that dialog, it wants to open a website, which is quite annoying.

hediet avatar Mar 28 '24 08:03 hediet

weird, @hediet would you like to confirm if this is caused by VSCode not picking up npm?

Say, you can change the serverPath to the absolute path to ast-grep binary installed globally? Thanks!

HerringtonDarkholme avatar Mar 28 '24 17:03 HerringtonDarkholme

I tried on my windows machine by installing nodejs via its official website. then I installed npm install @ast-grep/cli -g in the vanilla command prompt. I did find some issues about vcruntime140.dll but after I installed vc redistribution package the DLL is okay.

Then ast-grep vscode can work properly.

image

HerringtonDarkholme avatar Mar 28 '24 18:03 HerringtonDarkholme

Code_-_Insiders_T2r5wbNpUr

Code_-_Insiders_wujghlu60n

I suggest to show more error details, so that debugging is easier.

hediet avatar Apr 03 '24 08:04 hediet