Fork me on GitHub
#cursive
<
2017-05-05
>
cfleming00:05:14

1.5.0 is finally out, for those of you sticking to stable builds.

julienielsen07:05:26

I get the following error in intelliJ when I try to import a project or add a module from existing source: Can't change/establish root binding of: *ns* with set. I have tried reinstalling IntelliJ and updating java, but the error still appears. Anybody who have a suggestion to what I can try?

julienielsen08:05:52

Problem solved: The dobbelt-plings in my lein profiles file were formatted.

tianshu08:05:22

@cfleming Personally, in Parinfer mode, I think some enhancement is needed for pasting code. After

(defn hello [x])
   |  <-- cursor here, paste
I have to indent code manually, or I have to switch to paredit, paste, then switch back.

cfleming08:05:46

@doglooksgood Yeah, I know 😞. I’m planning to fix that.

tianshu08:05:57

Parinfer has a feature called previewCursorScope, maybe this can help?

cfleming08:05:11

No, I already use that.

cfleming08:05:27

The pasting thing is IntelliJ trying to be too clever - it’s not Cursive/parinfer doing it.

tianshu08:05:17

If my cursor is located before a close paren, the pasting works fine.

(defn hello [x]
   |)  <-- this works
no matter in parinfer or paredit

cfleming08:05:51

Oh, right - previewCursorScope holds the parens there when the caret is there, right?

cfleming08:05:17

I remember now, I did use that but then turned it off. I can’t remember why now.

cfleming08:05:44

I believe it was because it made editing totally not work in some contexts that are not normal editors, like diff views.

tianshu08:05:39

personally I don't use previewCursorScope, In my personal opinion, when pasting, parinfer indent mode should always preserve indentation.

cfleming09:05:24

Yes, I agree.

tianshu09:05:18

I don't know if there's a hook or some stuff for paste in IntelliJ, that's pretty easy in Emacs though.

cfleming09:05:37

There are tons of them, it’s pretty complex 🙂

cfleming09:05:42

I haven’t dug into it yet.

psalaberria00210:05:08

I have a problem with the REPL, hopefully an easy one to solve. At work I am forced to use aws-vault for authenticating to aws. That means I need to prepend aws-vault exec profile -- to any command. aws-vault exec profile -- lein repl works fine. How can I achieve this in Intellij when opening a REPL?

psalaberria00210:05:44

aws-vault exec profile -- idea works, but I want to be able to use use different aws profiles for different REPLs

cfleming11:05:22

@psalaberria002 What does that do? I guess it sets environment variables?

psalaberria00211:05:50

yes, that’s what it does under the hood. But it keeps credentials in a vault.

cfleming11:05:03

I don’t think there’s any way to do that with the Cursive REPL, since it invokes lein in a non-standard way.

psalaberria00211:05:04

manually adding the env variables is not an option

cfleming11:05:33

Then unfortunately I think your only option is to run lein repl :headless on the command line, and connect a remote REPL to it.

cfleming11:05:02

It’s a little fiddly, https://github.com/cursive-ide/cursive/issues/1039 would make it better.

cfleming11:05:12

This is a great use case for that issue, actually.

cfleming11:05:07

The only other option I can think of would be to have an option to execute a command, and then use the env vars set by that command to run the REPL.

cfleming11:05:24

I actually don’t even know if Java would allow me to do that (read the env as set by a process I’ve run)

cfleming11:05:45

I think #1039 is probably a better option.

psalaberria00211:05:52

I will keep am eye on the issue in github. in the meantime I will have to open another terminal

cfleming11:05:56

I put a comment on that issue with your use case.

cfleming11:05:07

You can use the terminal built into IntelliJ, in case that helps.

souenzzo12:05:43

Informal feature request: please do some var highlight match inside datalog 😞

jtth18:05:18

Is there a built-in way to rename a leiningen project in Cursive? (change all namespaces/folders/references from “project-a” to “mything-b”)

chrisdevo20:05:42

jtth: Have you tried highlighting the project name in project.clj and clicking shift+F6?

cfleming22:05:12

@U4Q7NLNMC There’s no refactoring support for this, no, sadly.

moizsj18:05:17

@cfleming some love for this one please (if priorities permit) https://github.com/cursive-ide/cursive/issues/1439

mkeathley21:05:27

Thank you for making dependency management better ❤️

cfleming22:05:41

@souenzzo Do you have an example of what you’d like?

cfleming22:05:30

@danielcompton Thanks for writing that up!

danielcompton22:05:10

You're welcome 🙂

cfleming22:05:41

@mkeathley No problem! Glad it’s helpful.

cfleming22:05:53

@moizsj Ok, I’ll look at that one.

souenzzo22:05:56

'[:find ?e :where [?e :user/name]] When cursor was on ?e, highlight the other ?e.

cfleming22:05:13

Ok, is that always in the context of a particular datomic call, or would you want that in general data structures?

cfleming22:05:51

I don’t use datomic, but I think queries are often built up dynamically, right?

danielcompton22:05:54

Typically you would write Datomic queries like parameterised SQL queries

danielcompton22:05:10

Structure stays constant, variable values are passed in as :in

danielcompton22:05:25

Datomic has a query cache, so reusing the structure for the same query helps

cfleming22:05:36

Right, but what I mean is, is this always something like (d/whatever '[:find ?e :where [?e :user/name]]) or:

(let [my-query '[:find ?e :where [?e :user/name]]]
  (d/do-something my-query))

cfleming22:05:12

One means that the functionality can be keyed off the function use, the other means I’d have to look for any vector that looks like a query in any namespace requiring datomic.

souenzzo22:05:13

Maybe "highlight equal symbols inside a quote". No scope or syntax from datomic.

cfleming22:05:09

(which is doable, just trying to figure out the requirement)

souenzzo22:05:20

I almost always (let [query '[] res (d/q query))

danielcompton22:05:20

probably the latter

danielcompton22:05:35

I can see queries being dynamically built once

danielcompton22:05:58

but just highlighting symbols that are equal inside a quoted statement would be a pretty good solution

danielcompton22:05:24

If you wanted to get really fancy, you could follow the scope through rules as well http://www.learndatalogtoday.org/chapter/8

danielcompton22:05:29

which would be very cool

souenzzo22:05:03

But there is no how @cfleming know what is a quote and what is datalog

souenzzo22:05:49

(or there is?)

souenzzo22:05:02

Would be awesome: yellow background on quotes that was a valid datalog(maybe u can check with spec. There is more then one "datomic-spec" on GH), then "datalog syntax highlight" inside yellows.

souenzzo22:05:24

But just equals symbols highlight will help a lot too. ;)