Fork me on GitHub
#cursive
<
2018-05-14
>
Oliver George05:05:55

Bit of a thought bubble but how about using spec's generative features to do "type checking" like behaviour in the IDE: https://gist.github.com/olivergeorge/584b54fe0b1d4c6ce3c7a44ee8c29095

Oliver George22:05:32

@cfleming can’t sell you on this one? :-)

cfleming22:05:31

@U055DUUFS Yep, was just walking to the office 🙂

cfleming22:05:22

It’s an interesting idea. So you’re thinking something like being able to right click in the editor and say “test this function” or something similar?

Oliver George00:05:26

I think cursive users would love red squiggles to appear as they are working on code. Clearly that's a big step though. Something that let you check a namespace and identify these bugs would be good so something like "Test Fn" or "Test Ns" sounds like a good step forward.

cfleming00:05:58

Right, red squiggles would require something like https://github.com/arohner/spectrum, which is a neat idea but still alpha state I believe.

Oliver George00:05:30

I'm not sure why the approach I describe couldn't be applied. Its a "brute force" approach but a simple technique which would (might?) be efficient with a cache. Key thing is the code driving it needs to understand bindings (thus it's an IDE thing).

Oliver George00:05:02

All from an idealistic user perspective. You're the expert.

Oliver George00:05:29

Anyway, just wanted to share.

cfleming10:05:56

Well, it still requires type propagation, which is similar to spectrum or what Cursive does for Java interop

cfleming10:05:28

i.e. in your example, Cursive would have to understand that a should have type string?, and since it’s used as an arg to bar then the IDE would check that particular use by generating from string? and validating it against coll? - is that what you have in mind?

cfleming10:05:37

I’m not sure whether that could feasibly be run in the background, since there are likely to be a lot of these. Caching the results might be tricky too. I’ll think about it, since it would be much easier than using something like spectrum.

Oliver George11:05:38

I think you're on the same page. There's definitely a price to pay (performance, caching practicalities) but the rewards could be quite interesting. Thanks for listening & taking the time to think about it.

Oliver George05:05:04

(Still requires a JVM to build "facts" so not perfect)

Mudge17:05:10

@cfleming it happens on all my files in the project

Mudge17:05:44

@cfleming Cursive says "defn" cannot be resolved. How do I fix this?

Mudge17:05:38

@cfleming how do I get updates to the cursive plugin or do they happen automatically?

Mudge17:05:22

@cfleming I reinstalled Intellij using the latest version and installed Cursive and now it all works.

rnagpal19:05:48

Is there any way I can fold the brackets

rnagpal19:05:04

we can fold HTML element tags

rnagpal19:05:08

and functions

rnagpal19:05:24

would be good to fold code based on brackets too