Fork me on GitHub
#conjure
<
2020-09-24
>
dharrigan07:09:26

Observing something new with conjure + clojure-lsp + coc

dharrigan07:09:44

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

dharrigan07:09:46

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

dharrigan07:09:53

In the hud, this shows:

dharrigan07:09:09

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

dharrigan07:09:22

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

dharrigan07:09:47

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

dharrigan07:09:43

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

Olical07:09:53

😕 oh dear, that sucks

Olical07:09:56

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.

dharrigan07:09:24

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

dharrigan07:09:31

It could be coc or conjure?

Olical07:09:26

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.

dharrigan07:09:20

Happy to try out a branch for if you wish 🙂

dharrigan08:09:29

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)

dharrigan08:09:37

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

Olical08:09:52

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

dharrigan08:09:54

then coc then flags the file needs saving

Olical08:09:39

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

Olical08:09:45

And maybe that's what's tripping Conjure up

Olical08:09:55

So it's unrelated to the sponsor information

Olical08:09:21

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.

dharrigan08:09:28

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

Olical08:09:38

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

Olical08:09:16

But that's probably not your issue.

dharrigan08:09:14

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

dharrigan08:09:21

Seems plausible

dharrigan08:09:01

you do write out a conjure-log right?

Olical08:09:18

It is never written to disk

Olical08:09:21

If it is, that's not me

Olical08:09:27

It's an in memory only buffer

dharrigan08:09:39

then coc is broken then

Olical08:09:52

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

Olical08:09:57

It'd be great to rule things out

Olical08:09:07

(I don't trust anything JavaScript 😬)

dharrigan08:09:18

[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)"
                    }
                ]
            }
        ]
    }
}

dharrigan08:09:39

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

Olical08:09:08

Can you configure coc to exclude the log buffer maybe?

dharrigan08:09:16

I'll have a play

Olical08:09:51

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.

dharrigan08:09:52

I trust you 🙂