conjure

:neovim:+:clj: https://github.com/Olical/conjure - If you're enjoying Conjure and want to say thanks: https://github.com/users/Olical/sponsorship :smile: (alt https://conjure.fun/discord)
dharrigan 2020-09-24T07:45:26.000400Z

Observing something new with conjure + clojure-lsp + coc

dharrigan 2020-09-24T07:45:44.000700Z

Opening a file (without a repl reunning), shows this

dharrigan 2020-09-24T07:45:46.000900Z

[coc.nvim] changed 1 buffers, use :wa to save changes to disk and :copen to open quickfix list

dharrigan 2020-09-24T07:45:53.001100Z

In the hud, this shows:

dharrigan 2020-09-24T07:46:09.001400Z

(ns my.funkynamespace.conjure-log-627276)

dharrigan 2020-09-24T07:46:22.001700Z

No changes have been made to the file, it's just on open.

dharrigan 2020-09-24T07:46:47.002100Z

coc thinks there has been changes - perhaps it's refering to the hud window?

dharrigan 2020-09-24T07:51:43.002600Z

yes, it appears that conjure writing into the hud window the log information, causes coc to think there are file changes

Olical 2020-09-24T07:53:53.002900Z

😕 oh dear, that sucks

Olical 2020-09-24T07:54:56.003700Z

That log is very clearly marked as a scratch buffer and as such isn't marked as modified etc since it's never intended to be written.

dharrigan 2020-09-24T07:55:24.004100Z

It only recently started to happen - only noticed past day (or two?)

dharrigan 2020-09-24T07:55:31.004300Z

It could be coc or conjure?

Olical 2020-09-24T07:56:26.005400Z

Could try rolling back Conjure and seeing if it persists I guess :thinking_face: I'm wondering if it's because I'm inserting a sponsor early on in the buffer lifecycle now and there's some race condition in nvim/coc that means I should wait a tick for the buffer to exist then append a line.

dharrigan 2020-09-24T07:57:20.005700Z

Happy to try out a branch for if you wish 🙂

dharrigan 2020-09-24T08:00:29.006500Z

On launch, it fires up, the file is loaded, the hud is displayed, including the sponsor information and connection to localhost refused (as I'm not running a repl)

dharrigan 2020-09-24T08:00:37.006800Z

after about 1-2 seconds the (ns....) appears at the top of the hud

Olical 2020-09-24T08:00:52.007400Z

That ns part is new, I've never seen that before.

dharrigan 2020-09-24T08:00:54.007500Z

then coc then flags the file needs saving

Olical 2020-09-24T08:02:39.008Z

I wonder if the insertion of that ns thing is from one of your plugins because that shouldn't ever happen... I've never written anything to do that

Olical 2020-09-24T08:02:45.008400Z

And maybe that's what's tripping Conjure up

Olical 2020-09-24T08:02:55.008700Z

So it's unrelated to the sponsor information

Olical 2020-09-24T08:03:21.009200Z

I don't do anything else :thinking_face: other than try to eval your current namespace if you have a connection to ensure it's loaded for future evals.

dharrigan 2020-09-24T08:04:28.009900Z

I wonder which plugin, for it would have to be LISPy aware to create the form?

Olical 2020-09-24T08:04:38.010200Z

Apparently coc-conjure is broken with a newer version of coc too due to a breaking API change

dharrigan 2020-09-24T08:04:44.010400Z

oooh

Olical 2020-09-24T08:05:16.011200Z

But that's probably not your issue.

dharrigan 2020-09-24T08:06:14.011700Z

maybe? If it's fixed afer this is patched in, the problem solved.

dharrigan 2020-09-24T08:06:21.012Z

Seems plausible

dharrigan 2020-09-24T08:09:01.012200Z

you do write out a conjure-log right?

Olical 2020-09-24T08:09:18.012400Z

It is never written to disk

Olical 2020-09-24T08:09:21.012600Z

If it is, that's not me

Olical 2020-09-24T08:09:27.012800Z

It's an in memory only buffer

dharrigan 2020-09-24T08:09:39.013100Z

then coc is broken then

Olical 2020-09-24T08:09:52.013500Z

:thinking_face: can you try an older version of it somehow?

Olical 2020-09-24T08:09:57.013800Z

It'd be great to rule things out

Olical 2020-09-24T08:10:07.014300Z

(I don't trust anything JavaScript 😬)

dharrigan 2020-09-24T08:10:18.014600Z

[trace - 09:07:18] received request 'workspace/applyedit - (2)'.
params: {
    "edit": {
        "documentchanges": [
            {
                "textdocument": {
                    "version": 0,
                    "uri": "file:///...../repository/conjure-log-635570.cljc"
                },
                "edits": [
                    {
                        "range": {
                            "start": {
                                "line": 0,
                                "character": 0
                            },
                            "end": {
                                "line": 0,
                                "character": 0
                            }
                        },
                        "newtext": "(ns t.....conjure-log-635570)"
                    }
                ]
            }
        ]
    }
}

dharrigan 2020-09-24T08:10:39.015Z

it's thinking there is a file changed, and since the hud has the focus it's writing out to there.

Olical 2020-09-24T08:11:08.015700Z

Can you configure coc to exclude the log buffer maybe?

dharrigan 2020-09-24T08:11:16.016Z

I'll have a play

dharrigan 2020-09-24T08:11:18.016200Z

brb

Olical 2020-09-24T08:11:51.017Z

Sure thing, but I can promise you that I'm not writing that ns text... I hope. Nowhere in Conjure does it intentionally edit any buffer of yours by adding a ns or whatever, that's down to you to edit.

dharrigan 2020-09-24T08:47:49.017300Z

🙂

dharrigan 2020-09-24T08:47:52.017500Z

I trust you 🙂