Fork me on GitHub
#calva
<
2024-04-12
>
James Pratt08:04:44

hiya. I'm working with fulcro. Is there a way from calva to search the code base of a library you are using, using file search? I have cloned the fulcro code and have it open in a second visual studio window but suspect there is a way to search through the files of a library direct from a project that has it as a dependency?

pez08:04:54

I am not aware of any such feature. But maybe clojure-lsp has something that we could leverage for this, @UKFSJSM38?

❤️ 1
James Pratt08:04:12

Possibly there is another way to achieve what I want to, I want to be able to find functions without knowing what name space they are defined in, just from the function name.

jpmonettas10:04:34

for that you can call (clojure.repl/apropos "a-fn-name-sub-str")

metal 1
jpmonettas11:04:45

assuming the namespaces are loaded in the repl

ericdallo12:04:41

we have the https://clojure-lsp.io/features/#project-tree feature which you can navigate on all deps, public functions and classes

James Pratt05:04:27

it'd be very cool to see this integrated into calva though I imagine that'd take a fair amount of work.

pez06:04:12

It is integrated to Calva. It looked like a ton of work to me too, but @UKFSJSM38 whipped it together in what seemed like a jiffy. 😀

pez06:04:52

It’s not integrated with the code search of VS Code, though. I don’t know if that is possible.

Eugen19:04:49

hi, we've noticed some changes regarding logging and Jack-in. Not sure if it's calva to blame but it ight be. Now when we jack into a polylith app, initial logs are displayed in Jack-in terminal window and no logs are displayed after that . We are using amperty dialog (slf4j 2.x implementation) .

Eugen19:04:48

nREPL server started on port 34333 on host localhost - 
19:29:21.227 [clojure-agent-send-off-pool-0] DEBUG org.cache2k.core.log.Log  Using Slf4jLogger
19:29:21.236 [clojure-agent-send-off-pool-0] INFO org.cache2k.core.Cache2kCoreProviderImpl  cache2k starting. version=2.6.1.Final
19:29:21.554 [clojure-agent-send-off-pool-0] INFO org.eclipse.jetty.util.log  Logging initialized @15266ms to org.eclipse.jetty.util.log.Slf4jLog
19:29:26.328 [clojure-agent-send-off-pool-0] DEBUG org.docx4j.XmlUtils  Eclipse Adoptium
19:29:26.329 [clojure-agent-send-off-pool-0] DEBUG org.docx4j.XmlUtils  21.0.1
19:29:26.333 [clojure-agent-send-off-pool-0] DEBUG org.docx4j.utils.ResourceUtils  Attempting to load: docx4j.properties
19:29:26.336 [clojure-agent-send-off-pool-0] DEBUG org.docx4j.utils.ResourceUtils  Trying Thread.currentThread().getContextClassLoader()
19:29:26.340 [clojure-agent-send-off-pool-0] WARN org.docx4j.utils.ResourceUtils  Couldn't get resource: docx4j.properties
19:29:26.347 [clojure-agent-send-off-pool-0] WARN org.docx4j.Docx4jProperties  Couldn't find/read docx4j.properties; docx4j.properties not found via classloader.
19:29:26.355 [clojure-agent-send-off-pool-0] INFO org.docx4j.XmlUtils  default SAXParserFactory property : null
 Please consider using Xerces.
19:29:26.377 [clojure-agent-send-off-pool-0] WARN org.docx4j.XmlUtils  actual SAXParserFactory: org.apache.xerces.jaxp.SAXParserFactoryImpl
19:29:26.380 [clojure-agent-send-off-pool-0] INFO org.docx4j.XmlUtils  default DocumentBuilderFactory property: null
 Please consider using Xerces.
19:29:26.391 [clojure-agent-send-off-pool-0] WARN org.docx4j.XmlUtils  actual DocumentBuilderFactory: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

seancorfield19:04:05

Did you check Calva's new output terminal to see if logging shows up there?

Eugen19:04:36

this part?

This is not a "real" terminal.
You can type into the terminal, but there is no process that will handle your input.

To reveal this terminal, use the command  Calva: Show/Open the Calva Output Terminal .

Eugen19:04:26

now, they don't show there

seancorfield19:04:21

What is calva.outputDestinations set to in your settings JSON?

seancorfield19:04:09

I have

"calva.redirectServerOutputToRepl": false,
    "calva.outputDestinations": {
      "evalResults": "terminal",
      "evalOutput": "terminal",
      "otherOutput": "terminal"
    },
    "calva.useLegacyReplWindowPath": false,

Eugen19:04:51

"calva.outputDestinations": {
    
        "evalResults": "repl-window",
        "evalOutput": "repl-window",
        "otherOutput": "repl-window"
    },

seancorfield19:04:17

And the logging doesn't show up in the REPL window either?

Eugen19:04:19

no. after the above logging that is shown in Jack in window, no other logging is shown

seancorfield19:04:00

Dunno then. @U0ETXRFEW might have to pitch in when he's around...

Eugen19:04:19

I'll try to use an older version of calva anmd see if it works

pez19:04:17

There’s yet another setting about repl stdout or something. Dunno if that’s the culprit, but just maybe. Calva shouldn’t have any power on what is logged in the jack-in terminal, though. That’s entirely a different process.

Eugen19:04:51

using an older Calva version from ~ 1 week ago gets logging back

Eugen19:04:38

I am going to try and upgrade again and restart code to double check

Eugen19:04:33

using calva 435 now

Eugen19:04:36

yes, I can confirm. Upgraded to latest Calva and I have the logging issue.

(clojure.tools.logging/info "tools.logging info")
  ;; => nil

Eugen20:04:12

used 436 and it works - logs are visible

Eugen20:04:26

so it might be 437

seancorfield20:04:02

I can confirm that logging doesn't appear in any window -- but I have logging wired up to tap> and Portal so that's where I expect to see log output (and I do), so I hadn't noticed it had disappeared elsewhere...

Eugen20:04:06

it's 2.0.437 that causes this

Eugen20:04:25

I believe it's related to cidr-nrepl with logjam updates

seancorfield20:04:39

Guess I'm lucky I am not affected 😉

Eugen20:04:07

thanks for looking and trying to help though 🙂

pez20:04:31

Interesting. The setting is only providing the defaults, though, so you can use whatever versions. At least that’s how it’s supposed to work.

pez20:04:59

I do wonder how we can get the logs back with latest nrepl.

Eugen20:04:27

not sure, but repl messing with the logging is not ok. we load the app in the repl and logging should be configured by the app IMO

seancorfield20:04:54

Yup, but CIDER already messes with a lot of stuff... This is why I really prefer a bare nREPL... but some of Calva's functionality doesn't work properly then. I've always felt CIDER does far too much.

pez20:04:56

What I mean is that the jack-in nrepl dependency versions is configurable.

Eugen20:04:18

we'll see how we can handle this. We use tools.logging with dialog (slf4j 2.x) as backend. we redirect all logging to slf4j since that is what we need . I believe logjam tries to do the same

Eugen20:04:32

and hence logging is broken

Eugen20:04:38

I'll see if I can report the issue to cidr-nrepl channel

Eugen20:04:31

I can confirm logjam tries to capture logging from all java logging frameworks. I see issues with this going forward.

Eugen20:04:58

and using an older cidre-nrepl version will only take you so far.

seancorfield20:04:16

(see my comment about CIDER doing too much 😉 )

Eugen20:04:48

let's see what we can do

Eugen20:04:33

> What I mean is that the jack-in nrepl dependency versions is configurable. we can try that - but I wonder for how long we can do that until Calva will require newer repl features ?!

pez20:04:29

Yeah, it’s not sustainable, I just wasn’t aware if you are aware of how it worked. 😃

Eugen20:04:15

🙂 I'm not sure I am aware of how it works right now

pez20:04:17

The cider-nrepl maintainers are very attentive so I am sure we’ll get some good help figuring the longer game out.

Eugen21:04:22

he mentioned logjam as optional but I wonder if pulling the tranitive deps might cause some issue with dynamic configuration / discovery of logging frameworks

pez21:04:35

He’s right that Calva isn’t intentionally using it. 😃