Fork me on GitHub
#calva
<
2022-02-10
>
Stefan10:02:15

I was kind’o hoping that it would resolve itself automatically, but I seem to have a regression that Calva/ClojureLSP does not automatically put a namespace form in new files anymore. This was broken end of last year and then fixed but now it seems to be broken again?

maxt19:02:24

I haven't dug in to it, but I'm experiencing the same

ericdallo22:02:49

Not aware of any LSP big related to that, does that happens for all projects?

ericdallo22:02:03

Is it possible to make a repro where I can test it?

Stefan07:02:42

I’ll try @UKFSJSM38. It’s a polylith repo by the way.

Stefan08:02:28

A small clean repo does not suffer from this issue.

Stefan08:02:51

This is the clojure-lsp trace when I make a file (and the ns is not inserted):

[Trace - 9:19:11 AM] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///Users/redacted/development/src/dev/foo.clj",
        "languageId": "clojure",
        "version": 1,
        "text": ""
    }
}


[Trace - 9:19:11 AM] Sending request 'textDocument/documentSymbol - (135)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/redacted/development/src/dev/foo.clj"
    }
}


[Trace - 9:19:11 AM] Sending request 'textDocument/semanticTokens/full - (136)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/redacted/development/src/dev/foo.clj"
    }
}


[Trace - 9:19:11 AM] Received response 'textDocument/documentSymbol - (135)' in 11ms.
Result: [
    {
        "name": "/Users/redacted/development/src/dev/foo.clj",
        "kind": 21,
        "range": {
            "start": {
                "line": 0,
                "character": 0
            },
            "end": {
                "line": 999999,
                "character": 999999
            }
        },
        "selectionRange": {
            "start": {
                "line": 0,
                "character": 0
            },
            "end": {
                "line": 999999,
                "character": 999999
            }
        },
        "children": []
    }
]


[Trace - 9:19:11 AM] Received response 'textDocument/semanticTokens/full - (136)' in 12ms.
Result: {
    "data": []
}


[Trace - 9:19:11 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///Users/redacted/development/src/dev/foo.clj",
    "diagnostics": []
}


[Trace - 9:19:11 AM] Sending request 'textDocument/codeLens - (137)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/redacted/development/src/dev/foo.clj"
    }
}


[Trace - 9:19:11 AM] Sending request 'textDocument/codeLens - (138)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/redacted/development/src/dev/foo.clj"
    }
}


[Trace - 9:19:11 AM] Received response 'textDocument/codeLens - (137)' in 12ms.
Result: []


[Trace - 9:19:11 AM] Received response 'textDocument/codeLens - (138)' in 11ms.
Result: []


[Trace - 9:19:11 AM] Sending notification 'workspace/didChangeWatchedFiles'.
Params: {
    "changes": [
        {
            "uri": "file:///Users/redacted/development/src/dev/foo.clj",
            "type": 1
        }
    ]
}

Stefan08:02:59

Does that help?

ericdallo11:02:10

Not really, a simple repo would be better

Stefan14:02:47

Yeah! I think we stumbled upon the issue. We’re using a polylith repo, and I had the dev project configured incorrectly: I had included all components as :local/root deps in :extra-deps. I changed it to use the :extra-paths prescribed method instead, and now the automatic namespaces are working again. 🎉

Stefan14:02:12

Maybe that helps you somehow as well @U0773UB6D?

ericdallo15:02:32

The good news are, probably this will not be a issue next clojure-lsp release as we will use the classpath to find source-paths

Max21:02:53

Has anyone else on a mac noticed a second vscode icon showing up in their dock and cmd+tab menu? I think it’s the LSP, but it’s hard to tell. I assume that’s not intentional?

ericdallo22:02:43

Calva launches a clojure-lsp process indeed but I don't think it's clojure-lsp since it has no visual ui, quite odd indeed

Max22:02:30

This is what I see in activity monitor, not sure if that’s helpful:

😔 1
Max22:02:38

Also, if I force-quit the second one, I get the following error message in VSCode:

ericdallo22:02:29

Sounds like something else related to some of your extensions

Max22:02:03

Going down the rabbit hole identified the Spell Right extension as the culprit. Sorry for the false alarm!

nice 1
Cora (she/her)23:02:31

I had this same problem, same extension. I wonder what the problem with it is

Max02:02:07

looks like it’s tracked, but the maintainers have not responded: https://github.com/bartosz-antosik/vscode-spellright/issues/465