intellij-elm / intellij-elm

Elm plugin for IntelliJ Platform IDEs
MIT License
394 stars 68 forks source link

Cannot find your Elm app's main entry point. Please make sure that it has a type annotation. #659

Open Tallies opened 4 years ago

Tallies commented 4 years ago

Hi,

I followed the resolution given on https://github.com/klazuka/intellij-elm/issues/483, but I still get "Cannot find your Elm app's main entry point. Please make sure that it has a type annotation."

This use to work (I've been away from Elm for a while). I'm using Rider:

JetBrains Rider 2020.1.0 Build #RD-201.6668.197, built on April 15, 2020 Licensed to Charl Marais Subscription is active until October 3, 2020 Runtime version: 11.0.6+8-b765.25 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o .NET Framework 4.0.30319.42000 Windows 10 10.0 GC: ParNew, ConcurrentMarkSweep Memory: 1450M Cores: 12 Registry: debugger.new.debug.tool.window.view=true, ide.tree.horizontal.default.autoscrolling=false, performance.watcher.sampling.interval.ms=200, ide.tooltip.showAllSeverities=true, show.diff.preview.as.editor.tab=true, ide.borderless.title.product=false, ide.title.debug=true, performance.watcher.unresponsive.interval.ms=1000, ide.tooltip.initialDelay.highlighter=0, search.everywhere.settings=true, show.diff.preview.as.editor.tab.with.single.click=true, parameter.info.max.visible.rows=10, ide.win.file.chooser.native=true, vcs.log.show.diff.preview.as.editor.tab=true, ide.borderless.title.debug=true, ide.borderless.title.project.path=false, search.everywhere.pattern.checking=false, ide.tooltip.initialDelay=0, ide.borderless.title.classpath=false, ide.require.transaction.for.model.changes=false Non-Bundled Plugins: com.microsoft.vso.idea, org.intellij.plugins.markdown, com.intellij.resharper.HeapAllocationsViewer, commit-template-idea-plugin, org.elm.klazuka, com.intellij.resharper.azure, reasonml

EditPolicy.elm:

module EditPolicy exposing (..)

import Browser
import Html exposing (..)
import Html.Attributes exposing (..)
import String exposing (..)

main =
    Browser.element
        { init = init
        , subscriptions = subscriptions
        , update = update
        , view = view
        }

type Msg
    = Nothing
    | ChangeStep Int

type alias Model =
    { step : Int
    , stepModel : StepModel
    }

type alias StepModel =
    { name : String
    }

init : () -> ( Model, Cmd Msg )
init _ =
    ( { step = 0
      , stepModel =
            { name = "hallo"
            }
      }
    , Cmd.none
    )

update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
    case msg of
        Nothing ->
            ( model, Cmd.none )

        ChangeStep stepNumber ->
            ( { model | step = stepNumber }, Cmd.none )

view model =
    Html.main_
        [ h1
            []
            [ text "Edit Policy" ]
        , div
            [ classList
                [ ( "wizard-container", True )
                , ( "selected", True )
                ]
            ]
            [ div
                [ class "wiz-steps" ]
                [ stepTab 1 "Client Details" model.step
                , stepTab 2 "Business Details" model.step
                , stepTab 3  "Cover Details" model.step
                , stepTab 4 "summary" model.step
                ]
            , stepContainer 1 model.step
            , stepContainer 2 model.step
            , stepContainer 3 model.step
            , stepContainer 4 model.step 
            ]
        ]

stepTab: Int -> String -> Int ->  Html Msg
stepTab stepNumber stepDescription currentStep =
    let 
        stepNumberAsText = fromInt stepNumber
        isCurrentStep = currentStep == stepNumber 
    in
    [ a
        [ href "#"
        , id ("sh" ++ stepNumberAsText)
        , classList
            [ ( "step-header", True )
            , ( "current-step", isCurrentStep )
            ]
        ]
        [ h3
            []
            [ text stepDescription ]
        ]
    ]

stepContainer: Int -> Int -> Html Msg
stepContainer stepNumber currentStep =
    let
        stepNumberAsText = fromInt stepNumber
    in
    div 
        [ class "step-container", id ("step" ++ stepNumberAsText)]
        [ text "Step " ++ stepNumberAsText]

subscriptions _ =
    Sub.none
agentbellnorm commented 4 years ago

Changing from

-- MAIN

main =
    Browser.element { init = init, update = update, subscriptions = subscriptions, view = view }

to

-- MAIN

main : Program String Model Msg
main =
    Browser.element { init = init, update = update, subscriptions = subscriptions, view = view }

solved it for me. I'm using clion.