Comments (13)
@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.
#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.
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.
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.
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.
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.
A lot of credit goes to @ajalt. He has done some amazing work on this project.
from intellij-elm.
And you are humble as well!! Great job mate! 👍👊
from intellij-elm.
That's awesome!
from intellij-elm.
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.
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.
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.
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)
- Exception NoClassDefFoundError: JSTypeSerializer after project opened
- Pycharm exception for Elm plugin 4.4.1 HOT 1
- com.intellij.diagnostic.PluginException: The default implementation of method 'getId' is deprecated, you need to override it in 'class org.elm.ide.test.run.ElmTestConfigurationFactory'. The default implementation delegates to 'getName' which may be localized, but return value of this method must not depend on current localization. HOT 2
- Feature request: Show case expression branches in structure view
- The default implementation of method 'getId' is deprecated HOT 14
- add support for locations in elm.json
- Plugins throws in a vanilla JS application HOT 3
- Error occured HOT 1
- Feature request: Find where a record field is used vs where it's assigned HOT 1
- $ELM_HOME is ignored when attaching elm.json files HOT 1
- Very slow start HOT 1
- Please make node path and $ELM_HOME configurable
- Build test failure on JDK 17 HOT 2
- Issue with new version of intellij HOT 2
- java.lang.IllegalStateException: CachedValuesManager.getC… must not be null at org.elm.lang.core.psi.ElmFile.isInTestsDirectory(ElmFile.kt:55)
- Cataloging contents of various intellij-elm forks HOT 1
- error dialog if the path to Lamdera binary is not set HOT 2
- Do not use IntelliJ APIs marked as `@Internal` HOT 2
- com.intellij.diagnostic.PluginException for deprecated ActionUpdateThread.OLD_EDT HOT 2
- Plugin installation breaks Rider startup HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intellij-elm.