Closed foges closed 1 year ago
For reference, there is some related discussion starting here.
I very much prefer methods that don't rely on -g
.
Thanks for the quick feedback sogaiu.
I had looked at the open issues and didn't see anything related to the local install. Didn't think to check the closed issues. It's a good call out to use npx instead. I've tested it with npx and it works fine too. I've updated the PR to now use that instead.
@foges Thanks for amending.
I tried to follow the instructions and it didn't quite work for me.
A few tweaks I tried included:
cd vscode-janet
after cloningnpm install vsce
instead of npx install vsce
-- this line -- npx
vs npm
can get so confusing sometimesPossibly worth mentioning that Node.js version may matter -- 12.x doesn't work while 14.y does (likely more recent things do too).
Sorry about that. I must have mistyped something when I was testing it. I've fixed up your comments and gone through it from top to bottom again.
Thanks for the refinements.
When I look at the latest I don't see an instance of npm install vsce
.
IIUC, that's still necessary after npm install
and before npx vsce package
.
Possibly a minor point, but IIUC, cloning into the extension directory is not necessary. May be it makes no difference but it looks like the editor does remove stuff that's in there from time to time.
Hmm. It works for me without the npm install vsce
just using npx vsce package
. That's after having done an npm uninstall vsce
and npm uninstall -g vsce
on my machine. Having a look online it doesn't seem to me that you first need an npm install, but maybe I'm missing something.
Regarding the directory. Do you mean that vscode might arbitrarily delete files from the extensions directory? I haven't come across that online. As a user I'd think the ~/.vscode/extensions
directory would be the most convenient place so that I don't have to keep track of it elsewhere. Happy to change it up if you think another location would be better?
Hmm. It works for me without the npm install vsce just using npx vsce package.
Ah sorry. When I tried again, it did work as you described. :+1:
Do you mean that vscode might arbitrarily delete files from the extensions directory?
No, not exactly. It's just that when one uninstalls extensions, corresponding directories get removed (actually it requires a subsequent restart IIUC), so the application is known to remove some things from there, so I'm just hinting at caution.
I don't have the reference but I believe I saw a post about the scenario of cloning stuff to the extensions directory to be one that is not supported (though I'm pretty sure it used to work). If I turn that up again I'll post it here.
@foges I poked around a bit more and the following simple steps worked here:
cd ~/.vscode/extensions
git clone https://github.com/janet-lang/vscode-janet
mv extensions.json /tmp/
Then starting VSCode was sufficient.
The trick seemed to be a matter of eliminating extensions.json
-- which appears to be created again (with updated content) anyway.
No clue whether there is anything important in that file that one might regret losing though.
That indeed worked for me as well. A side effect of that seems to be that now every time when I run npx vsce package
vscode cleans up the ~/.vscode/extensions
directory and the vscode-janet directory disappears (as you'd previously mentioned). The only thing I've found that works consistently is to clone to the repo in a separate directory and build it there. I'll update the readme to include this.
@sogaiu I've updated the PR to reflect your suggestions.
@foges Thanks, I took a look and it looks pretty good to me :+1:
@sogaiu Awesome. Thank you.
I found that even with building locally sometimes it won't reload and then I still need to remove the extensions.json file. Amended that.
That is strange.
Glad there is at least a work-around.
As far as I can tell the documentation for installing this extension is incomplete (ie. just cloning the repo didn't work for me). I ended up following these instructions: https://stackoverflow.com/questions/50714638/install-extension-from-a-specific-repo-branch-on-github, which worked great. Updating the readme to reflect this.
NB: Will make sure to squash and merge.