cursive

Issues at: https://git.io/cursive-issues
kenny 2021-04-22T00:10:28.235800Z

They tie data to code. Copy pasting code does not work. Renaming a namespace breaks all keywords (bad if that data went into a DB).

kenny 2021-04-22T00:11:03.236Z

I've started to think of them as an anti-pattern.

kenny 2021-04-22T00:12:00.236200Z

It's really hard to move away from it when autocomplete so strongly wants me to use them, haha.

cfleming 2021-04-22T00:28:17.236400Z

Interesting. I’m actually planning to fix the copy paste issue, for keywords and also for symbols referring to vars. In the case of data, systems wouldn’t store them as aliased anyway normally, would they? I’d assume they’d be using a semantic kw object with ns and name parts. The alias thing is really just a reader shortcut, and doesn’t exist in e.g. EDN.

kenny 2021-04-22T00:30:09.236600Z

It is recommended for all data stored in Datomic to be qualified keywords. Data is inputted and outputted in keywords.

cfleming 2021-04-22T00:30:46.236800Z

Sure, but what I mean is that Datomic won’t store it with the alias, it’ll store it with the full ns/name combo, right?

kenny 2021-04-22T00:31:21.237Z

Oh, haha. Yes - that is correct. The reader always expands first.

kenny 2021-04-22T00:35:17.237200Z

It still seems to be mixing my data with my code. I have no need to require a namespace simply to refer to my data (I'm assuming that's the thought on how to fix it). I only want to work with the data.

cfleming 2021-04-22T00:56:17.237500Z

I’m not proposing a solution, just trying to understand the problem better. Is there a case where the aliasing causes a problem? I get the copy/paste issue. Renaming namespaces shouldn’t be a problem, renaming aliases might if Cursive doesn’t handle that properly.

imre 2021-04-22T05:30:56.237700Z

One way perhaps could be that paths that are in aliases/test/extra-paths and also under aliases/somethingelse/extra-paths could be handled per point 2. Approaching another way: only paths that only appear in the test alias would be automarked as test source roots

imre 2021-04-22T05:31:08.237900Z

Of course this could break another edge case

2021-04-22T06:29:03.238100Z

Makes sense to only mark paths that are exclusively in :test alias as test source. Test classpath needs, by nature, to include source under test, and tools-deps doesn’t provide a way to inherit paths from other aliases, only from the top level :paths. If I include src/clj in the top level :paths it will also be part of the ClojureScript part of our build, which I am trying to avoid. Of course there is the possibility to invoke test with more aliases to combine the needed classpath, something like clj -A:clj-src:test , but there is something nice about expecting all projects to run tests with the simple clj -A:test

golanweiss 2021-04-22T07:46:25.238500Z

@cfleming > 2. If you have other source roots (either from `:paths` or some `:extra-paths`), if you have manually marked those as a test root then Cursive will continue to respect that. This is great, indeed works! Can it be done also for “Resources root”? Right now if I put the “resources” folder under :path it override-marks it with “Source root”, and if I put in :extra-paths it just clears my marking.

cfleming 2021-04-22T09:35:03.238800Z

Yeah, I’m not sure about making that change, since it’s very hard to predict what it might break. I guess the effect would be limited to the IDE (i.e. it won’t break anything for deps itself), and the workaround would just be to manually mark those cases as tests.

cfleming 2021-04-22T09:37:17.239Z

> Can it be done also for “Resources root”? Right now if I put the “resources” folder under :path it override-marks it with “Source root”, and if I put in :extra-paths it just clears my marking. In :extra-paths it will also mark as a source root if the alias is selected to be synced as described in the doc link above. Cursive doesn’t support resource paths for deps, because deps itself doesn’t support them - it only has the concept of “things which are on the classpath”. I wouldn’t even worry about the test marking (since deps doesn’t support that concept either), except that some things in IntelliJ rely on it.

2👍
borkdude 2021-04-22T10:46:08.239400Z

Are there any clj-kondo users that can help @jtlocsei?

kari 2021-04-23T07:16:23.240900Z

Heh, I am happy I was able to help anyway. 😀

borkdude 2021-04-23T07:33:16.241100Z

@kari.marttila Take care!

kari 2021-04-23T07:42:10.241300Z

I will! Thanks!

borkdude 2021-04-22T11:15:07.239700Z

He just let me know that it works using the LSP plugin

kari 2021-04-22T13:18:51.240Z

@jtlocsei I use clj-kondo with Cursive (using LSP) and it should just work. Do you see the little green ball in bottom right info area saying that connection to LSP server is established? Are you sure the path to your clj-kondo standalone jar is correct? Are you sure you are using stanalone version? I could have a screen sharing session with you but unfortunately I was suddenly hospitalized last weekend and now mostly laying in bed without my gallbladder and a huge incision carve in my belly and cannot sit. 😀

kari 2021-04-22T13:20:06.240200Z

Ah... I missed that he already got it working with LSP.

tobias 2021-04-22T22:32:03.240500Z

@kari.marttila I appreciate your offer of help! I got it working before I saw your comment but your comment was still useful because I hadn't noticed the green ball with the connection info. Occasionally the LSP fails to load so it's handy to be able to restart it from the green ball. Good luck with the recovery from your surgery! It sounds like a big surgery.