vscode 2019-10-22

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?

dev tools = debug console?

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.

abstractExtensionService.ts:396 Activating extension 'vscode.lsp-sample-client' failed: Cannot find module 'vscode-languageclient'.

So, maybe .vscodeignore is a source of the problem?

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

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. ๐Ÿ˜ƒ

@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.

@c.fehse has joined the channel

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 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)

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.

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)

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. ๐Ÿ˜ƒ

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? ๐Ÿ˜‰

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'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.โ€

๐Ÿ˜„ 1