Fork me on GitHub
#calva
<
2022-06-23
>
Ivan Koz04:06:21

anyone knows how to disable line numbers in output.calva-repl editor buffer?

pez07:06:32

I saw you found your way to #joyride. 😃 I didn't even know you could disable line numbers targeting just one editor, but this does the trick:

(set! (.-lineNumbers vscode/window.activeTextEditor.options) 0)

Ivan Koz07:06:54

yep ty, i've subscribed to a document open event and disabled line numbers for the repl

joyride 1
pez08:06:49

Github Copilot is cool and works with both Clojure and ClojureScript. However, doesn't play well with Calva yet. Issue here: https://github.com/BetterThanTomorrow/calva/issues/1781

Robert Wood08:06:18

I am having quite a strange issue with Calva/Clojure-lsp as far as I can tell. While looking up the definition of a function, it does not respect the source paths defined in .lsp/config.edn It does respect the source paths when looking up usages. So to take it to the extreme case, I removed all source paths, and below are the results. If anyone could shed some light on how to go about debugging this, it would be greatly appreciated. (I have been sifting through the Clojure Language Client output to gleam anything of use, but no success yet.)

Robert Wood08:06:00

Just to expand on the above, I am new to calva, so could be missing a simple answer, and I am using VS Code's remote development via ssh setup.

pez09:06:22

One thing you could try is to run it locally and see if that behaves differently.

ericdallo10:06:09

Could you try latest release from yesterday or make sure calva is using it? We fixed a issue about target folder

Robert Wood13:06:18

Okay, so with "server-version": "2022.06.22-14.09.50", The issue still seems to occur. That being said, having tried locally, I cannot reproduce the issue. (It correctly identifies that it cannot find any definitions) Here is the output from the clojure language client in each case: Remote:

[Trace - 14:58:05] Sending request 'textDocument/definition - (67)'.
Params: {
    "textDocument": {
        "uri": "file:///data/home/robert/storage/web-server/src/api/printer/directprint.clj"
    },
    "position": {
        "line": 10,
        "character": 17
    }
}


[Trace - 14:58:05] Received response 'textDocument/definition - (67)' in 2ms.
Result: {
    "uri": "file:///data/home/robert/storage/web-server/src/api/printer/directprint.clj",
    "range": {
        "start": {
            "line": 10,
            "character": 6
        },
        "end": {
            "line": 10,
            "character": 17
        }
    }
}


[Trace - 14:58:05] Sending request 'textDocument/references - (68)'.
Params: {
    "textDocument": {
        "uri": "file:///data/home/robert/storage/web-server/src/api/printer/directprint.clj"
    },
    "position": {
        "line": 10,
        "character": 17
    },
    "context": {
        "includeDeclaration": true
    }
}


[Trace - 14:58:05] Received response 'textDocument/references - (68)' in 49ms.
Result: [
    {
        "uri": "file:///data/home/robert/storage/web-server/src/api/printer/directprint.clj",
        "range": {
            "start": {
                "line": 10,
                "character": 6
            },
            "end": {
                "line": 10,
                "character": 17
            }
        }
    },
    {
        "uri": "file:///data/home/robert/storage/web-server/target/classes/api/printer/directprint.clj",
        "range": {
            "start": {
                "line": 10,
                "character": 6
            },
            "end": {
                "line": 10,
                "character": 17
            }
        }
    }
]


[Trace - 14:58:05] Sending request 'textDocument/references - (69)'.
Params: {
    "textDocument": {
        "uri": "file:///data/home/robert/storage/web-server/src/api/printer/directprint.clj"
    },
    "position": {
        "line": 10,
        "character": 17
    },
    "context": {
        "includeDeclaration": false
    }
}


[Trace - 14:58:05] Received response 'textDocument/references - (69)' in 52ms.
Result: []
Local:
[Trace - 3:10:01 PM] Sending request 'textDocument/definition - (98)'.
Params: {
    "textDocument": {
        "uri": "file:///home/rob/storage/web-server/src/api/printer/directprint.clj"
    },
    "position": {
        "line": 10,
        "character": 6
    }
}


[Trace - 3:10:01 PM] Received response 'textDocument/definition - (98)' in 1ms.
Result: {
    "uri": "file:///home/rob/storage/web-server/src/api/printer/directprint.clj",
    "range": {
        "start": {
            "line": 10,
            "character": 6
        },
        "end": {
            "line": 10,
            "character": 17
        }
    }
}


[Trace - 3:10:01 PM] Sending request 'textDocument/references - (99)'.
Params: {
    "textDocument": {
        "uri": "file:///home/rob/storage/web-server/src/api/printer/directprint.clj"
    },
    "position": {
        "line": 10,
        "character": 6
    },
    "context": {
        "includeDeclaration": true
    }
}


[Trace - 3:10:01 PM] Received response 'textDocument/references - (99)' in 8ms.
Result: [
    {
        "uri": "file:///home/rob/storage/web-server/src/api/printer/directprint.clj",
        "range": {
            "start": {
                "line": 10,
                "character": 6
            },
            "end": {
                "line": 10,
                "character": 17
            }
        }
    }
]

Robert Wood13:06:24

Interesting to see that the remote version has three calls vs the two calls from the local version. This is being invoked with the following actions:

{
        "key": "ctrl+b",
        "command": "editor.action.revealDeclaration"
    },
    {
        "key": "ctrl+b",
        "command": "editor.action.revealDefinition",
        "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
    },

ericdallo13:06:22

is there a repro project so I can try? Could you try restarting vscode? I suspect you have the target file open so clojure-lsp thinks you wanna edit that file and include it on the find definition

Robert Wood13:06:58

Hmm, it is persistent over a restart, but the file within the target is still in the recently opened list. Is it possible to clear all the caches in vs code/calva/clojure-lsp?

ericdallo13:06:32

the cache should not be related to that, but if you want you can rm -r .lsp/.cache

Robert Wood13:06:58

Also I will get to work replicating it in a public repo. Will only be able to do that later today though.

👍 2
vlad_poh17:06:47

Apart from calva what other vscode plugins are y’all using

pez19:06:06

Chronicler, CSpell and GitLens are my main ones.

👍 3
seancorfield19:06:14

• Portal -- I rely very heavily on this during dev/test. • Joyride -- for customizing Calva/VS Code. Then on the process side I have: • GitHub Pull Requests and Issues (I wish it would display GH pages inline in VS Code but otherwise it's pretty good), • New Relic CodeStream (still early days with this and I'm not using it a lot yet) • Jira and BitBucket (because work... and I live and die in these extensions all day, for better or for worse!) And some other random stuff: • Remote -- for SSH and for WSL2 (both my dev envs are Windows machines running Ubuntu in WSL2) • vscode-pdf -- because sometimes I need to read a PDF and don't want to switch out of my editor • YAML -- mostly for CI files (GH workflows, BitBucket Pipelines)

👍 2
nnichols20:06:55

Outside of Calva + basic extensions for the other languages/file types/tools I interact with, I keep mine pretty minimal. The only addition to the above is TLDraw, to make quick visuals to explain myself while pairing.

👍 1
bringe03:06:26

Markdown All in One for keeping table of contents in readmes updated automatically as the content changes (for work projects.) Prettier for TS formatting. Docker for editing docker files.

👍 1
Max13:06:26

@U06GMV0B0 oops, other @U01EB0V3H39 should get the credit here 🙂

Max13:06:43

I had no idea slack let names overlap, TIL

😮 1
Max13:06:50

me either!