Skip to content

definition.Imported symbol (reexported) fails without $TEMPDIR/hls-test-root #4348

@komikat

Description

@komikat

running HLS_TEST_HARNESS_NO_TESTDIR_CLEANUP=1 HLS_TEST_LOG_STDERR=1 TASTY_PATTERN="/definition.Imported symbol (reexported)/" cabal test ghcide-tests
FAILS (>=GHC94)

expected: Location {_uri = Uri {getUri = "$TMPDIR/hls-test-root/extra-dir-85406152527/Bar.hs"}, _range = Range {_start = Position {_line = 3, _character = 5}, _end = Position {_line = 3, _character = 8}}}
 but got: Location {_uri = Uri {getUri = "$TMPDIR/hls-test-root/extra-dir-85406152527/Bar.hs"}, _range = Range {_start = Position {_line = 3, _character = 0}, _end = Position {_line = 3, _character = 14}}}

Notes

  • AtPoint.hs.gotoDefinition calls locationsAtPoint
  • it is using nameToLocation when failing
  • itExists <- liftIO $ doesFileExist fs returns true
  • doesn't seem to be falling back to db
  • in srcSpanToLocation sp
    rng <- srcSpanToRange src
    reports a different location from what's expected in the test
  • the sp comes from
    nameSrcSpan name
    in that branch.

Originally posted by @komikat in #4273 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions