How does one debug a vscode extension that runs fine when ran with Debug, but not when running from the .vsix?
Adding a console.log does nothing
In what wat does it not run fine?
in that I don't see anything happening
So if you console.log as the first thing in activate()
, do you see that in the dev tools in debug, but not with the vsix?
@pez yeah: https://github.com/borkdude/clj-kondo.lsp/blob/9aea308985c99471b13f9231549a3edb925ef921/vscode-extension/src/extension.ts#L23
dev tools = debug console?
Also I see this in debug mode: https://www.dropbox.com/s/z4ysi6j1bljm2n7/Screenshot%202019-10-22%2016.49.05.png?dl=0
But not with the vsix (which I suspect is a problem with the packed binary, but not sure, since I don't see anything)
(if you want to build the binary that's included in the extension, run script/build-server from the root of the repo)
dev tools = Help menu -> Toggle Developer Tools.
aaaaah
abstractExtensionService.ts:396 Activating extension 'vscode.lsp-sample-client' failed: Cannot find module 'vscode-languageclient'.
So, maybe .vscodeignore is a source of the problem?
aaah
I have had troubles with that one at least. I couldn't ignore node-modules for a long time. But then changed to use Webpack.
I actually removed a bunch of code there, but that's probably the problem yeah
https://github.com/microsoft/vscode-extension-samples/blob/master/lsp-sample/.vscodeignore#L9-L14
that's the part I removed
because I didn't know what I was doing ๐
Haha, been there, I almost said, but I am still there, of course. ๐
now it works. stoked! https://www.dropbox.com/s/a22ijrrlx6xrrlr/Screenshot%202019-10-22%2017.00.42.png?dl=0
@pez are you by any chance using a Windows machine?
@borkdude, not really. I have it in a Virtual Box that I try to avoid using. ๐ But @slack1038 and @c.fehse both have Windows machines available.
I'll try Filipe, he also uses Windows
(I can of course test something for you in Virtual Box, because Iโm curious about what you are up to.)
Windows just drives me nuts, so for my healthโs sake I try to use it as little as possible.
@pez only if it's not too much trouble: https://www.dropbox.com/s/t9owpu6a5d2ouh1/lsp-sample-client-0.0.1.vsix?dl=0 that's an extension which packs a binary. when visiting a Clojure file it should say "this is wrong" on the first line and first position, that's all
it's just a POC to see if it works on Windows. it's an all in one thing
the binary should also work on Windows, because it's just a jar basically
it can take a few seconds before the extension loads (jvm)
meanwhile I've setup a Win virtual machine myself
I'm seeing this: https://www.dropbox.com/s/gi9o6fdcw1zzxzc/Screenshot%202019-10-22%2017.28.27.png?dl=0 ๐
I get:
[Error - 08:25:32] Starting client failed
Error: spawn UNKNOWN
at ChildProcess.spawn (internal/child_process.js:358:11)
at Object.spawn (child_process.js:543:9)
at createMessageTransports._getServerWorkingDir.then.serverWorkingDir (C:\Users\User\.vscode\extensions\vscode.lsp-sample-client-0.0.1\node_modules\vscode-languageclient\lib\main.js:354:40)
exactly
Ah, i see you had the same.
I do get this in the console: c:\Users\IEUser\.vscode\extensions\vscode.lsp-sample-client-0.0.1\clj-kondo.lsp
so I guess the "binary" is in there
This is interesting. Renaming it to .exe and then running it from the prompt, I get this: https://www.dropbox.com/s/liilxonroemoizj/Screenshot%202019-10-22%2017.40.45.png?dl=0
maybe I'll just try the jar file then
for some reason my 2019 Macbook Pro crashes horribly when working with VirtualBox
Mine behaves. Knock on wood.
yueeha! https://www.dropbox.com/s/bs6pt0k08vqpym6/Screenshot%202019-10-22%2018.09.46.png?dl=0
mine usually crashes when trying to restore machine state
but eh, something works now!
And then my computer crashed horribly. Haha.
really? ๐
Yeah, really. I jinxed it, probably.
does this error ring a bell? I get this in the developer console. my plugin stopped working without a clear reason:
ERR spawn /usr/local/bin/git EACCES: Error: spawn /usr/local/bin/git EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
@pez I added build instructions here: https://github.com/borkdude/clj-kondo.lsp
I've no clue what's happening here
Doesn't ring a bell. But I'll have a look.
thanks in advance
huh, now it works again
and I didn't change anything ... state!
I donโt get any linting when running this in the debugger. The console.log of the jarPath happens.
it might take some seconds on the first time and it only happens when you change the file
did you build the jar?
I think so. I followed the instructions. ๐
@pez I see this: https://www.dropbox.com/s/e8gpi3an0bkxco2/Screenshot%202019-10-22%2020.52.32.png?dl=0
I see this
no errors in console?
(development console - why are these terms so overloaded)
pff, now I have this error again: ERR spawn /usr/bin/git EACCES: Error: spawn /usr/bin/git EACCES
Haha. no, only the logging of the jarPath there.
How do you put up with this stuff all day? ๐
Never seen it!
it doesn't seem to be related to any of my instructions, it doesn't matter what code I comment out, it still happens
I think it is something with your git install that doesnโt play well with vscode.
I tried setting "git.path"
in the VSCode settings to the brew version. No avail
and if you spawn code
from a shell where you have /usr/local/bin first in PATH?
it does change the error message git path, but same error
I see.
I'll try to re-install vscode, see if that helps
install insiders maybe. That will be a really clean install.
@pez I "fixed" something, so please do git pull first before you try again clean install of VSCode worked (removing everything, settings included)
the error reporting when something fails in the server process could maybe be more clear
not sure how to accomplish that
You seem to have โfixedโ the right thing. Now I get that discouraging message.
๐
thanks dude
You should write a positive linter coach. โThis looks swell!โ, โNice, all bindings are used, keep this up.โ