calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
maxp 2020-08-25T12:38:22.053Z

I've moved repl tab to group1 - it works well!

2
Alex J Henderson 2020-08-25T15:03:45.055100Z

I'm writing a little vs code extension to help working with Clojure code it works fine in the main editor window but doesn't work in the calva repl window. Any way I can have an extension edit the text in the calva repl window? (it doesn't seem to be vscode.window.activeTextEditor)

Alex J Henderson 2020-08-26T08:24:45.064200Z

@pez I'm using Calva 2.0.108

Alex J Henderson 2020-08-26T08:30:18.064400Z

@brandon.ringe by 'fire it off' I mean either select the command from the command search box, or hitting my assigned keyboard shortcut. Both methods work fine in the main editor window. However in the repl window the keyboard shortcut for some reason doesn't start the extension and when I select extension command from the command search box (with focus in the repl window) I can trip the debugger only to find that vscode.window.activeTextEditor is undefined)

pez 2020-08-26T08:50:41.064600Z

So 108 was what I suspected. 😃 All bets are off. That repl window is a totally different beast. Please upgrade, and your extension will start working with the new repl window.

Alex J Henderson 2020-08-26T08:51:50.064800Z

ah! ok, thanks, I'll try that now

Alex J Henderson 2020-08-26T08:54:53.065Z

cool, that works now! thanks @pez!😀

🤘 2
pez 2020-08-26T09:00:23.066600Z

Awesomeness. This all highlights the key reason why we switched repl window implementation.

☝️ 1
pez 2020-08-25T15:10:49.055200Z

It is just a regular editor actually. In what way does your extension not work with it? Can you describe it a bit, I think I might be able to see what is going on.

Alex J Henderson 2020-08-25T16:24:33.055500Z

my extension is called remove-whitespace-close-paren, the idea is when you tap ']' it will remove any whitespace around the cursor and close any open paren, either ')', ']' or '}'. If I fire off the extension whilst in the repl window then vscode.window.activeTextEditor is undefined. Github project: https://github.com/jahenderson777/remove-whitespace-close-paren Here's the relevant section: var editor = vscode.window.activeTextEditor; const cursorPosition = editor.selection.end; const startPosition = new vscode.Position(0,0); const rangeToCursor = new vscode.Range(startPosition, cursorPosition); const rangeFromCursor = new vscode.Range(cursorPosition, editor.document.positionAt(editor.document.getText().length -1)); editor.edit((editBuilder) => { const originalStart = editor.document.getText(rangeToCursor); const start = originalStart.trimRight(); const rangeToCursorToEdit = new vscode.Range(editor.document.positionAt(start.length), cursorPosition); editBuilder.replace(rangeToCursorToEdit, ""); const originalEnd = editor.document.getText(rangeFromCursor) const end = originalEnd.trimLeft(); const rangeFromCursorToEdit = new vscode.Range(cursorPosition, editor.document.positionAt(originalStart.length + (originalEnd.length - end.length))); const nextChar = end.substring(0,1); editBuilder.replace(rangeFromCursorToEdit, ""); if (nextChar == ")" || nextChar == "]" || nextChar == "}" || nextChar == "") { vscode.commands.executeCommand('cursorRight'); } })

pez 2020-08-25T16:51:28.056700Z

Neat! Which version of Calva are you using?

bringe 2020-08-25T19:10:48.057Z

What do you mean by "fire off the extension"? I'm wondering if it could be some action that's taking focus away from any editor. Also what's happening before you run that code? It may be that you need to click (for example) the repl window (or any editor) for the active editor to be defined.

bringe 2020-08-25T19:13:08.058800Z

Hello Calva friends. I've been working to fix and improve Calva's test commands. This vsix could use some testing if you don't mind at least installing and using it while you work, even if you don't use the test commands (though that would be good too of course). https://7889-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.123-fix-test-runner-issues-c0d4793a.vsix We had no docs for these commands so I added this doc: https://calva.io/test-runner/

Cris B 2020-08-26T09:11:45.066800Z

I was puzzled with a tools.deps project when the run tests ('all' and 'in namespace') commands didn't find the tests. I knew the tests were there! Then I realised that I had to jack in with an alias including the project's test dir in the classpath. I guess this should be obvious, but it wasn't to me 😳. Might be worth mentioning in the User Guide.

bringe 2020-08-26T17:07:06.067Z

Ah good point! This puzzled me too and then I wrote the docs way later and didn't think to mention 😆

bringe 2020-08-26T17:07:11.067200Z

I'll document

bringe 2020-08-26T18:07:38.069900Z

https://calva.io/test-runner/#tests-are-not-found 🎉

1
Cris B 2020-08-26T22:33:30.092100Z

It's really hard to keep fresh on what tripped you up when first using a tool/library/language. I always mean to document as I go, with the thought that the notes might be useful to write up for other beginners. Unfortunately my best intentions tend to fall way ...

bringe 2020-08-26T23:32:31.092300Z

It's definitely a hard thing to stay on top of

manas_marthi 2020-08-25T23:30:26.063200Z

I am unable to launch the repl while trying out the quil package

manas_marthi 2020-08-27T17:08:39.097900Z

Hi, I created a quil project, and then tried to Jack in. It crashed code. I am on Windows 10, and using Jdk12.

manas_marthi 2020-08-27T17:08:58.098100Z

I opened repl on command prompt and I connected from code as a workaround

bringe 2020-08-27T18:01:05.098300Z

Interesting. Would you mind creating an issue with details and repro steps? Please mention jdk and OS version there too as you did here, and if you used a template to create the project, mention that as well. Would be helpful.

manas_marthi 2020-08-25T23:30:35.063500Z

did anyone try calva with quil?