Fork me on GitHub
#cursive
<
2016-04-29
>
stijn08:04:16

@cfleming: I reported an error with the IntelliJ built in tool for exceptions in plugins, is that the right way to do it, or better report it as a github issue?

moizsj08:04:48

@cfleming: I am on the latest cursive on IDEA 15. Is there a setting that will not auto reindent open files? (parinfer turned on). it creates unnecessary changes in my git working copy

cfleming08:04:07

@stijn: Reporting like that is generally fine, thanks, but let me know here or file an issue if it’s particularly annoying - it can be hard to tell how many times a particular exception occurs from the tracker, or if it prevents something critical from happening.

stijn08:04:55

well, it seems that everything is still working, but I got a lot of

IndexOutOfBoundsException: chars sequence.length:502, start:3116, end:3647

cfleming08:04:03

@moizsj: No, that’s an important part of how parinfer works. For indent mode to work correctly the file has to be indented according to its rules, and that’s what that does.

stijn08:04:05

and then

com.intellij.diagnostic.MessagePool$TooManyErrorsException: Too many IDE fatal errors. Monitoring stopped.

cfleming08:04:27

@moizsj: I agree it’s annoying, and I’m considering an alternative to parinfer which would avoid that.

cfleming08:04:58

@stijn: That sounds quite bad, if you have the full trace there can you paste it here?

moizsj08:04:34

@cfleming: I like parinfer but I think i'll have to turn it off for just this reason. I work with large codebases and cant really afford to keep making commits for indents

cfleming08:04:17

@moizsj: Yeah, I know. It also gives me unnecessary merge conflicts when I merge across branches.

cfleming08:04:07

@stijn: It looks like File-&gt;Invalidate caches and restart might help with that.

moizsj08:04:12

@cfleming: it'd be nice if parinfer could only do local indenting for the parts of the code that I am actually modifying

cfleming08:04:43

@moizsj: That’s more or less what I’m planning. It’s tricky to get all of the benefit of parinfer, but it’ll reduce the annoyance significantly too.

cfleming08:04:11

i.e. it won’t be full inference, but will work locally when you indent or dedent.

moizsj08:04:21

@cfleming: what would that mean in terms of feature loss?

cfleming08:04:38

I’m not 100% sure yet.

moizsj08:04:52

@cfleming: ok. thanks for the updates!

cfleming08:04:13

One thing that is really nice is that you can just duplicate the last line in a form, and it will automatically extend the form to include the new line.

cfleming08:04:24

It’s useful for adding new test cases and so on.

cfleming08:04:39

Similarly with deleting a line.

cfleming08:04:16

Those operations would require specific handling in the action, and there are potentially a lot of actions that might need handling.

stijn08:04:20

@cfleming: it looks like that solved the problem, yes. thanks!

moizsj09:04:30

@cfleming: or another option - let parinfer reindent the whole file, but only if I start editing it first. and not do it for all open files.

moizsj09:04:10

that way i can gradually include the reindents in my commits as and when i touch those files (for other reasons besides indent)

cfleming09:04:21

So I tried that too 😞

cfleming09:04:25

It’s difficult.

cfleming09:04:24

It’s because the integration is driven by modifications to the document. Once I receive an event that the document is being modified, it’s too late to modify it myself first.

cfleming09:04:02

I thought about doing it when an action is triggered, but actions in IntelliJ are used for pretty much everything, and there’s no way to tell if an action will try to modify the doc or not.

moizsj09:04:38

maybe after the first edit?

cfleming09:04:17

The problem then is that the doc has already been modified in a way that may not be consistent with parinfer.

moizsj09:04:54

thats ok right? I mean treat it like parinfer was doing it the first time on file open (but after 1 edit). it'd be like parinfer wont work till you make the first edit, but at least it'll keep the working copy clean

moizsj09:04:34

but anyway, even with that, i still dont think i'd want parinfer to reindent the whole file. it would upset a lot of people during code reviews (unnecessary noise)

moizsj09:04:46

so what you're suggesting might be better

cfleming09:04:11

I’m actually not sure about that. If that first action is a parinfer one which assumes the doc is correct, then it will behave incorrectly in ways that paren mode might not be able to fix.

moizsj09:04:50

does it work the same way in other editors that have integrated parinfer?

cfleming09:04:55

Yes, it does.

cfleming09:04:44

I’m not sure if more people are using Cursive for work than Atom (I don’t think Emacs has a useful parinfer integration yet), but certainly numerous people have told me that they can’t use it because of that.

moizsj09:04:31

I, for example, cant use it at work because everyone else uses emacs. so they woudnt be expecting all those indent related edits.

cfleming09:04:04

I’ve been planning an alternative, hopefully I’ll have a beta at some point that everyone can try.

moizsj09:04:35

cool! hats off to you for being so user focussed. thanks!

cfleming09:04:57

No worries! And thanks for the feedback, it’s useful to know this sort of thing.

ckarlsen12:04:17

is there an easy way to clear a single record from the REPL history? I had a huge data structure in my clipboard which i accidently evaluated in the REPL, and now it's superslow

ckarlsen12:04:17

(the repl history that is)

manutter5112:04:02

I notice there’s a file named replstate.xml inside the .idea folder; no idea what would happen if you were to edit that or rename it, but...

manutter5112:04:34

I imagine you’d want to stop the repl first

manutter5112:04:46

and of course back up the file

manutter5112:04:05

Hmm, the history’s there, but yikes, not what I’d call easily editable.

manutter5112:04:13

Ok, just did a trivial edit, and successfully restarted the repl, and my change took effect, so looks like it’s doable. Definitely want that backup though, just in case.

manutter5112:04:34

@ckarlsen: you know about the cmd-up-arrow shortcut in the REPL, right?

manutter5112:04:53

(or ctrl-up-arrow on Windows? I forget)

ckarlsen12:04:14

thanks i'll try edit the file

ckarlsen12:04:26

whats c-up-arrow supposed to do?

manutter5112:04:44

It moves thru the repl history in units of one form at a time instead of one line at a time

manutter5112:04:54

same for c-down-arraw

ndroock113:04:14

Does the following sound familiar? I open a ClojureScript with figwheel configured in IntelliJ, I start a REPL. So far so good. Then I open another ClojureScript project in a new IntelliJ window. I close the REPL in the old project, I close <localhost://3449> in Chrome. Then I start a REPL in the newly opened IntelliJ window which closes with the message: " Port 3449 is already being used. " When I kill two Java processes with the ( sorry: Windows ) task manager I can start the REPL in the second project. - Have I done something wrong? If not, who did?

manutter5114:04:05

Are you using :cljs/quit to close the repl?

avery18:04:30

@cfleming: Hey Colin. I was writing a block comment in a source file, and was looking to get it to “fill” to n-characters wide in a fashion similar to what the Edit > Fill Paragraph action does with defn’s doc string.