Closed klazuka closed 7 years ago
@durkiewicz I see that this was merged a while ago, but it doesn't seem functional in IDEA yet. Is something broken or has structure view not yet been released?
@reitzig it hasn't been released yet. As best I can tell, Kamil isn't using Elm much these days. I've been working on my own re-write of this plugin. It's not yet usable for daily use, but it's getting close. I hope to have something ready to release in December or January.
@klazuka I may be tempted to have a look, if/when you put in on Github.
@reitzig I've released my re-write of the plugin, and it includes support for Structure View. It's available now through the JetBrains plugin repository under the name "Elm". You will have to un-install the old plugin before installing the new one.
This enables:
Changes
lang.psiStructureViewFactory
extension pointorg.elmlang.intellijplugin.features.structure
packageQuestions
One thing I was unsure about is where to put the logic to decide whether an
ElmValueDeclarationBase
is a function or a value. It seems like it should live on the Psi element itself, but I don't fully understand how GrammarKit does mixins.Another problematic thing is that my solution for determining whether an
ElmValueDeclaration
is a value or a function will be incorrect when the function is written in point-free style. We could mitigate this by searching the Psi tree for its type annotation, but that would only work when the user added a type annotation. Solving it for all cases would require that we do the type inference in the plugin (a big job). One option would be to avoid distinguishing between functions and values in the first place--but it seems like a useful distinction when trying to orient yourself in a file.