Fork me on GitHub
#cursive
<
2020-08-26
>
mokr07:08:20

Hi, does anyone know if the keyword navigation changed in one of the latest versions? I used to be able to find usages of my re-frame subscriptions and events (namespaced keywords), by CMD-clicking or using OPT-F7 (“Find usages”). In the latest version it seems to interpret the namespace of the keyword literally so that “Find usages” only searches that namespace in addition to the current file. Example: namespace x.y have (reg-sub :foo/bar …) previously I would be able to find all places this subscription was used, but now it will only show me usages in ns “x.y” or “foo”. Is the old behaviour available behind some setting, perhaps? PS: I actually started using namespace keywords when I found that it allowed that kind of navigation while regular keywords didn’t. (Specs: IntelliJ 2020.2 CE, Cursive 1.9.3-2020.2, MacOS 10.15.6) EDIT: Maybe I got confused by a change in the popup or something. “Find usages” now asks which of the two namespaces I would like to search, but the selection does not seem to have any effect, as it search all anyway. What I’m hoping for is to see usages directly in that popup as that gives a much smoother experience than going via a listing in the “3:Find” panel.

cfleming00:08:27

That sounds very strange. Can you post a screenshot of the find usages panel with the results of a problematic search?

cfleming00:08:17

In particular I’m interested in the summary that says “Usages of <something> in <some scope>” - what does <some scope> look like?

imre14:08:08

Hey @cfleming, has anyone ever requested a feature to highlight unneeded type hints? I find the missing type hint highlighting quite useful

cfleming00:08:49

Yes, I’ve thought about this, as well as related things like moving multiple type hints from usages to the declaration (e.g. if a parameter has type hints on 3 of its usages, you could remove them all and type hint the parameter itself).

cfleming00:08:26

But it’s surprisingly tricky. Here’s an example:

(let [x ^List some-thing
      y x]
  (.iterator y))

cfleming00:08:04

Here the type hint on x is required because later it’s used after being implicitly passed to y. However if y never used interop forms, that would not be required.

cfleming00:08:42

I haven’t sat down to think through all the corner cases, but I suspect it’s a long list 🙂

imre17:08:39

I'm sure about that, thanks for the insight

isak15:08:36

You know the feature where you type something like (rf/dispatch ...), but you have no rf alias in your :require , and Cursive automatically adds or suggests it for you? I'm having a problem where it doesn't work for one namespace aliasing: [lambdaisland.glogi :as log]. Any ideas?

cfleming00:08:04

No, I can’t see why that wouldn’t work - I just tried to repro and it works fine here.

cfleming00:08:35

Can you create a small reproduction project and put it on github so I can try it?

isak14:08:53

@cfleming Sure, here it is: https://github.com/isaksky/cursive-ns-test (for me :require assist does not work in db.cljs), it just looks like this: