You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue where find references missed a reference.
The simplest repro step involves 3 files:
Main.elm: defines alias Person, with field firstName
Group.elm: defines alias Group, which contains a Person (so Group.elm import Main.elm)
Utils.elm: defines a function which takes a Group and accesses group.person.firstName (Utils.elm only needs to import Group.elm, not Main.elm)
The issue is a find references on firstName misses the usage in Utils.elm. Note that if we import Main.elm in Utils.elm, then it gets detected properly.
Main.elm:
moduleMainexposing (..)
importHtmlexposing (Html, span, text)
importHtml.Attributesexposing (class)
type alias Person=-- doing a 'find references' on firstName here won't detect the fact that it is referenced in Utils.elm{ firstName :String}main:Htmlamain =
span [ class "welcome-message"][ text "Hello, World!"]
Group.elm:
moduleGroupexposing (..)
importMainexposing (Person)
type alias Group={ person :Person}
Utils.elm:
moduleUtilsexposing (..)
importGroupexposing (Group)
{-| the key part is that even though we access group.person.firstname, we never import Person in this file.As a result, when we try to 'find references' on 'firstName', it doesn't detect the reference in this file.Note that if you add 'import Main exposing (Person)' then the reference is found-}getFirstName:Group->StringgetFirstName group =
group.person.firstName
my setup:
- latest neovim (compiled a few days ago)
- latest coc.nvim (0.0.80-f6a947a8eb)
- latest elm-language-server (compiled from the main branch on git an hour ago)
- node v14.17.6
- on a M1 mac, running monterey 12.1
The text was updated successfully, but these errors were encountered:
I ran into an issue where find references missed a reference.
The simplest repro step involves 3 files:
Main.elm
: defines aliasPerson
, with fieldfirstName
Group.elm
: defines aliasGroup
, which contains aPerson
(so Group.elm import Main.elm)Utils.elm
: defines a function which takes aGroup
and accessesgroup.person.firstName
(Utils.elm only needs to import Group.elm, not Main.elm)The issue is a find references on
firstName
misses the usage inUtils.elm
. Note that if we import Main.elm inUtils.elm
, then it gets detected properly.Main.elm:
Group.elm:
Utils.elm:
my setup:
The text was updated successfully, but these errors were encountered: