GithubHelp home page GithubHelp logo

Comments (13)

klazuka avatar klazuka commented on August 21, 2024 1

@DoctypeRosenthal version 2.2.3 fixes the "has parse errors" restriction described above. Previously, if there were any parse errors in your function, record field completion wouldn't work. But not we do the best we can given the information we have. There are still some cases where it won't work (if you don't have a type annotation, or if there are syntax errors in the function parameter list itself), but this should cover a lot of the real-world cases.

The new version will show up in the JetBrains plugin repo soon, or you can download it now from the link above.

from intellij-elm.

ajalt avatar ajalt commented on August 21, 2024 1

#459 implemented this for all references to aliases and annotations within annotated functions. I don't think it's feasible to implement for unannotated functions.

from intellij-elm.

klazuka avatar klazuka commented on August 21, 2024 1

When I created this issue almost 3 years ago, I never fully expected that it would ever get implemented. Thank you @ajalt for making it happen. PR #697 was the last piece in the puzzle.

🎉

from intellij-elm.

DoctypeRosenthal avatar DoctypeRosenthal commented on August 21, 2024

Any chance we see this feature in the near future?

(I thought about some clever word plays with "feature" and "future" but no chance man!)

from intellij-elm.

klazuka avatar klazuka commented on August 21, 2024

Yes! Most of the hard work needed to implement this has already been done by AJ. And we do currently support record field completion when accessing a record field.

The last foundational things remaining are:

  • allow parse errors during inference (needed for good code completion) (DONE 2019-02-06)
  • figure out how to make reference resolve be able to use type inference without creating an infinite loop (needed for rename / find usages)
  • implement unification in type inference (needed to finish type inference)

Once those things are done, there would need to be some additional work to actually finish the work described by this issue. I would hope to have this done by the summer. But certainly in 2019!

from intellij-elm.

DoctypeRosenthal avatar DoctypeRosenthal commented on August 21, 2024

Hey man.
I have to say I am deeply impressed by your swiftness and your will to take responsibility! Amazing work! Keep on rocking! :)

from intellij-elm.

klazuka avatar klazuka commented on August 21, 2024

A lot of credit goes to @ajalt. He has done some amazing work on this project.

from intellij-elm.

DoctypeRosenthal avatar DoctypeRosenthal commented on August 21, 2024

And you are humble as well!! Great job mate! 👍👊

from intellij-elm.

DoctypeRosenthal avatar DoctypeRosenthal commented on August 21, 2024

That's awesome!

from intellij-elm.

mattiasw2 avatar mattiasw2 commented on August 21, 2024

Once you support find usage of record fields, I also assume you will be able to support rename of record fields? (I am really impressed by 3.0, installed into Android Studio 3.3.1, and could play around with my project directly.)

from intellij-elm.

klazuka avatar klazuka commented on August 21, 2024

Correct.

Doing this right may be a bit tricky, though, due to the variety of ways in which records and fields can be used in Elm (structural subtyping, record extension, field accessor functions).

from intellij-elm.

mattiasw2 avatar mattiasw2 commented on August 21, 2024

Yes, this is the most complicated part of Elm's typing system. How complete is your implementation? Does it use the Elm compiler?

from intellij-elm.

klazuka avatar klazuka commented on August 21, 2024

We don't use the Elm compiler at all. The type system is fully implemented with the exception of unification of type variables in functions that lack a type annotation. So if you write something like:

foo x = x
quux = foo [1,2,3]

... we cannot infer the type of the expression foo [1, 2, 3]. But if you add a type annotation to foo (foo : a -> a), it will correctly infer the type as List number.

from intellij-elm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.