Ticket #78 (closed defect: fixed)

Opened 6 years ago

Last modified 2 years ago

Quoting full qualified names to refer to entities that are not in scope don't work.

Reported by: gsan@… Owned by:
Priority: major Milestone:
Version: 2.4.2 Keywords:
Cc:

Description

References to entities that are exported by another module, but not imported by the current one don't work, though single quotes are removed.

module Other (other, test2) where

-- | Doc
other :: Int
other = 2

-- | Doc
test2 :: Bool
test2 = False
module Test (test) where

import Other (test2)

import Data.Maybe

-- | These links don't work: 'other', 'Other.other', 'Data.List.sortBy'.
--   These do work: 'test2', 'Other.test2', 'Data.Maybe.fromMaybe'.
test :: Int
test = 1

Interestingly enough, full qualified names get detected in prologue (index.html) but they're not hyperlinked. Tested on 2.4.1 and 2.4.2.

Change History

Changed 6 years ago by waern

I don't think we should support this. What if multiple modules export the same name? I think we should at least require the user to qualify the name with a module, if the name is from the same package, and otherwise perhaps require a package qualification (see #13).

Changed 6 years ago by waern

Sorry, I misread the ticket and thought it was about unqualified names. So, yes, we should support this when the names are qualified like I said in my previous note :)

Changed 6 years ago by waern

  • milestone changed from 2.4.2 to 2.5.0

Changed 6 years ago by gsan

IIRC, the documentation says that the qualified names just create a link without doing any checks. This worked in the past but I don't know since when it's broken. This is from the latest documentation:

It is also possible to refer to entities that are not in scope in the current module, by giving the full qualified name of the entity:

-- | The identifier 'M.T' is not in scope

If M.T is not otherwise in scope, then Haddock will simply emit a link pointing to the entity T exported from module M (without checking to see whether either M or M.T exist).

Changed 5 years ago by waern

  • version changed from 2.4.1 to 2.4.2

The problem here is that we convert DocIdentifier? into DocString? if we can't find the id during renaming in GHC. If we move renaming of HsDoc? into Haddock as part of Isaac Dupree's SoC project then we can fix this in Haddock. In any case we need to wait until the next GHC release before we can release a Haddock version which fixes this.

Changed 5 years ago by duncan

Bytestring is another test case for this, in particular the docs for fromForeignPtr (in darcs atm, not released).

Changed 3 years ago by waern

  • status changed from new to closed
  • resolution set to fixed

Changed 2 years ago by anonymous

  • milestone 2.5.0 deleted

Milestone 2.5.0 deleted

Note: See TracTickets for help on using tickets.