Fork me on GitHub
#cursive
<
2019-05-21
>
mfikes01:05:51

@cfleming Ahh, cool. It works. The trick is, you have to make a change to the file. Then it lets you select the "Only VCS Changed Text" selection. The key aspect is that this choice appears to be "sticky", so it starts behaving that way.

mfikes01:05:06

For those curious, the above is accessed via the Code > Show Reformat File Dialog menu

tap04:05:27

Has anyone had this issue where syntax checker is messed up when opening more than one clojure projects concurrently?

cfleming04:05:21

@tap yes, that’s https://github.com/cursive-ide/cursive/issues/2173. It’s not clear yet whether it’s a bug in Cursive or in IntelliJ - the corresponding platform bug is https://youtrack.jetbrains.com/issue/IDEA-211736.

cfleming04:05:31

Are you experiencing it right now?

cfleming04:05:44

If so, I have some questions for you 🙂

tap05:05:11

@cfleming Yes, I am. Anything I can help?

tap05:05:50

I can always make it happen actually

cfleming05:05:10

@tap Oh, great. Can you check your project view, and see if everything looks ok? i.e all your modules and libraries are there?

cfleming05:05:22

Is this a big project? Are you using lein or deps?

tap05:05:33

One thing I found is when I open the second project, the first project start indexing as well.

tap05:05:41

In project view, libraries are there.

tap05:05:58

Hmm, it happens only when I open a project that I didn't open recently. The projects that have the issue, after restart, the issue disappear. I remember the issue reappear at some point. I'll pay attention to that next time.

cfleming07:05:13

@tap Ok - when you get the issue again, could you try refreshing your lein projects in the lein toolwindow, and see if that fixes the problem?

flowthing11:05:49

FWIW, I experienced the same problem today and refreshing Leiningen projects fixed the issue for me. On the other hand, it seems to happen quite frequently with the project I'm currently working on, and sometimes making any change to the ClojureScript file fixes symbol resolution. :man-shrugging:

tap07:05:26

@cfleming No, that doesn't fix the problem. Neither refreshing from lein toolwindow nor right-click on project.clj and "Refresh Leiningen Projects"

cfleming07:05:13

@tap Ok, thanks - that’s a bummer.

cfleming07:05:45

Does restarting the IDE help?

cfleming07:05:58

That seems to be what fixes it for most people.

tap07:05:50

Yes, it does help

tap07:05:04

I get a feeling that I reappear often though. Maybe after cursive update and/or IntelliJ update. I can't make it happen now.

cfleming07:05:55

Yeah, it only seems to happen on IntelliJ 2019.1, but that doesn’t mean it’s an IntelliJ bug - something may have changed which has provoked a bug in Cursive.

tony.kay16:05:57

Any chance we’ll get decent keyword rename refactoring soon? Currently I’m adopting the following rule: New Rule: always prefer

(let [{:keys [::a/b]}] ...)
over
(let [{::a/keys [b]}] ...)
The former can handle kw renames via refactoring tools, the latter cannot. I’ve lost like 4-5 hours this week trying to keep things organized…and that kills me every time

roklenarcic18:05:32

does anyone else have a problem with autocomplete and source lookup when using deps+shadowcljs+npm

roklenarcic18:05:57

instead of autocomplete showing me results from cljs, it shows me results from compiled js

cfleming23:05:10

@tony.kay I’m definitely interested in cases where the current rename refactoring doesn’t work. I wasn’t aware that some of them don’t.

tony.kay23:05:34

yeah, I’m writing Fulcro 3 and spec’ing a lot of things…but heavy refactoring is a continuous need…and renaming spec keywords (or moving them to new nses when I start out with ::kw) does not work well

tony.kay23:05:11

mainly in destructuring

tony.kay23:05:41

this one is a real bear:

(let [{::keys [a b]} something] ...)

;; to: I move a to diff ns, which would need to end up liek this:

(let [{::other/keys [a] ::keys [b]} something] ...)

cfleming23:05:47

@roklenarcic That’s probably because you have a CLJS output directory which hasn’t been excluded. Cursive tries to do that automatically, but may not understand Shadow’s output dir locations.

roklenarcic07:05:58

Excluded in deps.edn or somewhere in cursive settings?

roklenarcic08:05:22

There's also the thing that all my clj, cljc files are yellow all over the clojure.core functions, but cljs files are not. Cursive seems to not be able to recognize clojure.core functions in my clj files

roklenarcic08:05:54

The deps file isn't my own, it was generated by lein new fulcro I just ran "New -> Project from existing sources"

cfleming21:05:15

Re: the exclusion, hopefully you can figure out where the compiled JS is being stored - you might be able to do this by accepting one of the erroneous completions and then navigating to the result. Once you have the JS file open, then use Navigate | Select in… to open the file in the project view. There you’ll be able to see which directory that’s being stored under, and then you can right click | Mark directory as… | Excluded.

cfleming23:05:38

@tony.kay Ok, so there if you rename :keys/a to :other-keys/a then it doesn’t work.

tony.kay23:05:26

it works fine as long as the keyword is “contiguous”…e.g. (let [{:keys [::b ::a]} thing] ...)

tony.kay23:05:39

that will refactor rename correctly, but it’s an ugly notation

cfleming23:05:54

Yeah, the split keyword thing (this, and namespaced maps) are really a pain to handle.