vscode

Quiet in here? Check #calva-dev out :smiley:
borkdude 2019-10-22T14:33:38.030Z

How does one debug a vscode extension that runs fine when ran with Debug, but not when running from the .vsix?

borkdude 2019-10-22T14:33:48.030300Z

Adding a console.log does nothing

pez 2019-10-22T14:35:58.030600Z

In what wat does it not run fine?

borkdude 2019-10-22T14:36:07.030800Z

in that I don't see anything happening

pez 2019-10-22T14:44:40.032100Z

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?

borkdude 2019-10-22T14:47:55.033100Z

dev tools = debug console?

borkdude 2019-10-22T14:49:10.033400Z

Also I see this in debug mode: https://www.dropbox.com/s/z4ysi6j1bljm2n7/Screenshot%202019-10-22%2016.49.05.png?dl=0

borkdude 2019-10-22T14:49:31.034Z

But not with the vsix (which I suspect is a problem with the packed binary, but not sure, since I don't see anything)

borkdude 2019-10-22T14:50:31.034700Z

(if you want to build the binary that's included in the extension, run script/build-server from the root of the repo)

pez 2019-10-22T14:51:22.035200Z

dev tools = Help menu -> Toggle Developer Tools.

borkdude 2019-10-22T14:51:47.035400Z

aaaaah

borkdude 2019-10-22T14:52:19.035600Z

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

pez 2019-10-22T14:53:34.036400Z

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

borkdude 2019-10-22T14:53:46.036700Z

aaah

pez 2019-10-22T14:54:25.037700Z

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.

borkdude 2019-10-22T14:54:32.037900Z

I actually removed a bunch of code there, but that's probably the problem yeah

borkdude 2019-10-22T14:55:16.038600Z

that's the part I removed

borkdude 2019-10-22T14:55:28.039Z

because I didn't know what I was doing ๐Ÿ™‚

pez 2019-10-22T14:55:46.039500Z

Haha, been there, I almost said, but I am still there, of course. ๐Ÿ˜ƒ

borkdude 2019-10-22T15:01:05.039800Z

now it works. stoked! https://www.dropbox.com/s/a22ijrrlx6xrrlr/Screenshot%202019-10-22%2017.00.42.png?dl=0

borkdude 2019-10-22T15:02:03.040200Z

@pez are you by any chance using a Windows machine?

pez 2019-10-22T15:05:43.041700Z

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

borkdude 2019-10-22T15:06:06.042600Z

I'll try Filipe, he also uses Windows

pez 2019-10-22T15:06:28.043100Z

(I can of course test something for you in Virtual Box, because Iโ€™m curious about what you are up to.)

pez 2019-10-22T15:07:14.044Z

Windows just drives me nuts, so for my healthโ€™s sake I try to use it as little as possible.

borkdude 2019-10-22T15:10:33.044900Z

@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

borkdude 2019-10-22T15:10:44.045300Z

it's just a POC to see if it works on Windows. it's an all in one thing

borkdude 2019-10-22T15:11:07.045700Z

the binary should also work on Windows, because it's just a jar basically

borkdude 2019-10-22T15:13:43.046Z

it can take a few seconds before the extension loads (jvm)

borkdude 2019-10-22T15:27:44.046500Z

meanwhile I've setup a Win virtual machine myself

borkdude 2019-10-22T15:28:35.047300Z

I'm seeing this: https://www.dropbox.com/s/gi9o6fdcw1zzxzc/Screenshot%202019-10-22%2017.28.27.png?dl=0 ๐Ÿ˜ž

pez 2019-10-22T15:30:21.047600Z

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)

borkdude 2019-10-22T15:30:30.047900Z

exactly

pez 2019-10-22T15:30:38.048100Z

Ah, i see you had the same.

borkdude 2019-10-22T15:38:40.048600Z

I do get this in the console: c:\Users\IEUser\.vscode\extensions\vscode.lsp-sample-client-0.0.1\clj-kondo.lsp

borkdude 2019-10-22T15:38:48.048900Z

so I guess the "binary" is in there

borkdude 2019-10-22T15:40:57.049300Z

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

borkdude 2019-10-22T15:42:37.049800Z

maybe I'll just try the jar file then

borkdude 2019-10-22T15:50:57.050300Z

for some reason my 2019 Macbook Pro crashes horribly when working with VirtualBox

pez 2019-10-22T16:00:47.050600Z

Mine behaves. Knock on wood.

borkdude 2019-10-22T16:10:54.051300Z

mine usually crashes when trying to restore machine state

borkdude 2019-10-22T16:11:19.051500Z

but eh, something works now!

pez 2019-10-22T16:13:05.051900Z

And then my computer crashed horribly. Haha.

borkdude 2019-10-22T16:17:47.052100Z

really? ๐Ÿ™‚

pez 2019-10-22T17:28:18.052800Z

Yeah, really. I jinxed it, probably.

borkdude 2019-10-22T18:00:19.053400Z

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)

borkdude 2019-10-22T18:09:25.053600Z

@pez I added build instructions here: https://github.com/borkdude/clj-kondo.lsp

borkdude 2019-10-22T18:09:36.054Z

I've no clue what's happening here

pez 2019-10-22T18:13:42.054500Z

Doesn't ring a bell. But I'll have a look.

borkdude 2019-10-22T18:19:38.054800Z

thanks in advance

borkdude 2019-10-22T18:34:55.055Z

huh, now it works again

borkdude 2019-10-22T18:35:05.055300Z

and I didn't change anything ... state!

pez 2019-10-22T18:49:10.057Z

I donโ€™t get any linting when running this in the debugger. The console.log of the jarPath happens.

borkdude 2019-10-22T18:50:00.057400Z

it might take some seconds on the first time and it only happens when you change the file

borkdude 2019-10-22T18:50:27.057800Z

did you build the jar?

pez 2019-10-22T18:50:46.058100Z

I think so. I followed the instructions. ๐Ÿ˜ƒ

pez 2019-10-22T18:54:31.058600Z

I see this

borkdude 2019-10-22T18:55:03.059200Z

no errors in console?

borkdude 2019-10-22T18:55:17.059500Z

(development console - why are these terms so overloaded)

borkdude 2019-10-22T18:57:12.060Z

pff, now I have this error again: ERR spawn /usr/bin/git EACCES: Error: spawn /usr/bin/git EACCES

pez 2019-10-22T18:57:17.060200Z

Haha. no, only the logging of the jarPath there.

borkdude 2019-10-22T18:57:29.060600Z

How do you put up with this stuff all day? ๐Ÿ˜‰

pez 2019-10-22T18:57:36.060800Z

Never seen it!

borkdude 2019-10-22T19:01:17.061400Z

it doesn't seem to be related to any of my instructions, it doesn't matter what code I comment out, it still happens

pez 2019-10-22T19:03:24.061900Z

I think it is something with your git install that doesnโ€™t play well with vscode.

borkdude 2019-10-22T19:03:53.062400Z

I tried setting "git.path" in the VSCode settings to the brew version. No avail

pez 2019-10-22T19:04:33.063100Z

and if you spawn code from a shell where you have /usr/local/bin first in PATH?

borkdude 2019-10-22T19:04:36.063200Z

it does change the error message git path, but same error

pez 2019-10-22T19:04:42.063400Z

I see.

borkdude 2019-10-22T19:05:09.063700Z

I'll try to re-install vscode, see if that helps

pez 2019-10-22T19:05:33.064200Z

install insiders maybe. That will be a really clean install.

borkdude 2019-10-22T19:15:45.064500Z

@pez I "fixed" something, so please do git pull first before you try again clean install of VSCode worked (removing everything, settings included)

borkdude 2019-10-22T19:17:17.065Z

the error reporting when something fails in the server process could maybe be more clear

borkdude 2019-10-22T19:17:29.065200Z

not sure how to accomplish that

pez 2019-10-22T19:19:22.065900Z

You seem to have โ€œfixedโ€ the right thing. Now I get that discouraging message.

borkdude 2019-10-22T19:19:31.066100Z

๐Ÿ˜„

borkdude 2019-10-22T19:19:38.066300Z

thanks dude

pez 2019-10-22T19:20:31.067300Z

You should write a positive linter coach. โ€œThis looks swell!โ€œ, โ€œNice, all bindings are used, keep this up.โ€

๐Ÿ˜„ 1