Fork me on GitHub
#cursive
<
2020-01-15
>
kenny17:01:51

Cursive seems to be ignoring indentation on doc strings. Makes it quite hard to read.

kenny17:01:38

docstring from source has indentation

cfleming20:01:13

Hmm, that’s odd, the doc is HTML but it’s all wrapped in a pre. I’ll look at that one too.

4
cfleming03:01:56

I remember why I did this now. It’s because the first line of a docstring normally has no indentation, but the others have whatever indentation the string itself has in the source code. So like this:

(defn foo
  "Docstring here.
   And here."
  [x]
  ...)

cfleming03:01:49

Here, the second line has 3 spaces at the start of the line. I think what I’ll do is check all the lines excluding the first, find the minimum indent of all those lines and then apply that to all of them.

cfleming04:01:29

That works well:

cfleming04:01:24

Fixed for the next build too.

kenny04:01:39

Awesome, thanks!

kenny18:01:16

Would this also fix the misalignment seen in the below screenshots? Left is the function's source and right is the quick doc view.

cfleming21:01:17

Possibly, I’ll try that and see.

kenny17:01:53

Just updated and the docstrings look much nicer! Looks like the latest eap did not fix the multiline args alignment.

jeff.terrell20:01:38

I'm asking my students to install Cursive with Clojure CLI/deps, and several of them on Windows are having the same problem, which I don't know how to resolve. The "Working with Deps" documentation [1] says to hit "refresh" in a settings panel to download the list of available options for the tools.deps.alpha library version. But that network request seems to be consistently failing, on various Windows computers. Anybody know what the issue might be? [1] https://cursive-ide.com/userguide/deps.html

jeff.terrell20:01:58

Possibly relatedly, I noticed a one-time popup, maybe after installing the Cursive plugin (though I'm not sure), that said it was unable to download a JAR file, I think from Maven Central. It gave the URL. We gave that URL to a web browser and it told us that http:// was disabled and to try https:// instead. When we manually made that substitution in the browser, we were able to download the JAR file. Not that that helped us with whatever problem IntelliJ and/or Cursive had, though.

cfleming20:01:18

@U056QFNM5 That’s definitely odd. The http:// thing sounds related, but I can’t think what that would be. I thought that everything was downloaded over HTTPS anyway.

cfleming20:01:43

Do you see anything in the log on the failed machines? Help-&gt;Show log in Finder/Explorer.

jeff.terrell20:01:54

I'll ask, thanks.

cfleming20:01:59

Also, when the request fails, what does that look like?

jeff.terrell20:01:13

It shows the spinner for a split second is all. <none> is still selected in the list, and no other options are available. No error message or anything.

cfleming20:01:54

Ok, so the Maven Central repo is indeed being fetched over HTTP, which seems wrong. I’ll fix that. In the meantime, you could use the “Use private repo” option, give it the id central2 and the address and see if that helps.

jeff.terrell20:01:00

Great, thanks very much! I'll pass that along. I wonder if Maven Central recently changed their config to block http instead of redirect or something.

cfleming20:01:53

I suspect it’s something in your network environment, since all Cursive users are using HTTP and this is the first time I’ve ever heard of a problem with it.

cfleming20:01:04

(that said, that it uses HTTP by default is definitely a bug - I’ve just fixed that for the next build).

jeff.terrell23:01:46

One user reports that your 'Use private repo' workaround worked. Thanks for the quick responses! I haven't noticed issues with the network before, but I wouldn't rule it out. We're on a large campus (UNC), so maybe there's some weird security policy or something.

cfleming01:01:21

Great, thanks for letting me know!

tanzoniteblack22:01:35

https://support.sonatype.com/hc/en-us/articles/360041287334-Central-501-HTTPS-Required

Effective January 15, 2020, The Central Repository no longer supports insecure communication over plain HTTP and requires that all requests to the repository are encrypted over HTTPS.

💯 4
cfleming03:01:53

Oh wow. I’d better get that release out.

cfleming03:01:11

Although there is a workaround, that’s going to bite a lot of people.

❤️ 8