Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
haddock
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Glasgow Haskell Compiler
haddock
Commits
3077a12b
Commit
3077a12b
authored
7 years ago
by
alexbiehl
Browse files
Options
Downloads
Patches
Plain Diff
Hyperlinker: Links for TyOps, class methods and associated types
parent
87d95b2d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
5 merge requests
!38
Make --no-tmp-comp-dir the default
,
!37
Adapt to latest xhtml version, various optimizations
,
!31
Support HsToken in DataDecl and ClassDecl
,
!12
Drop orphan instance when defined upstream.
,
!10
Haddock interfaces produced from `.hi` files
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
+14
-1
14 additions, 1 deletion
haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
hypsrc-test/ref/src/Classes.html
+30
-10
30 additions, 10 deletions
hypsrc-test/ref/src/Classes.html
with
44 additions
and
11 deletions
haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs
+
14
−
1
View file @
3077a12b
...
...
@@ -93,9 +93,12 @@ variables =
types
::
GHC
.
RenamedSource
->
LTokenDetails
types
=
everythingInRenamedSource
ty
where
ty
::
forall
a
.
Data
a
=>
a
->
[(
GHC
.
SrcSpan
,
TokenDetails
)]
ty
term
=
case
cast
term
of
(
Just
((
GHC
.
L
sspan
(
GHC
.
HsTyVar
_
name
))
::
GHC
.
LHsType
GHC
.
GhcRn
))
->
pure
(
sspan
,
RtkType
(
GHC
.
unLoc
name
))
(
Just
((
GHC
.
L
sspan
(
GHC
.
HsOpTy
l
name
r
))
::
GHC
.
LHsType
GHC
.
GhcRn
))
->
(
sspan
,
RtkType
(
GHC
.
unLoc
name
))
:
(
ty
l
++
ty
r
)
_
->
empty
-- | Obtain details map for identifier bindings.
...
...
@@ -141,6 +144,7 @@ decls :: GHC.RenamedSource -> LTokenDetails
decls
(
group
,
_
,
_
,
_
)
=
concatMap
(
$
group
)
[
concat
.
map
typ
.
concat
.
map
GHC
.
group_tyclds
.
GHC
.
hs_tyclds
,
everythingInRenamedSource
fun
.
GHC
.
hs_valds
,
everythingInRenamedSource
fix
.
GHC
.
hs_fixds
,
everythingInRenamedSource
(
con
`
Syb
.
combine
`
ins
)
]
where
...
...
@@ -148,7 +152,10 @@ decls (group, _, _, _) = concatMap ($ group)
GHC
.
DataDecl
{
tcdLName
=
name
}
->
pure
.
decl
$
name
GHC
.
SynDecl
name
_
_
_
_
->
pure
.
decl
$
name
GHC
.
FamDecl
fam
->
pure
.
decl
$
GHC
.
fdLName
fam
GHC
.
ClassDecl
{
..
}
->
[
decl
tcdLName
]
++
concatMap
sig
tcdSigs
GHC
.
ClassDecl
{
..
}
->
[
decl
tcdLName
]
++
concatMap
sig
tcdSigs
++
concatMap
tyfam
tcdATs
fun
term
=
case
cast
term
of
(
Just
(
GHC
.
FunBind
(
GHC
.
L
sspan
name
)
_
_
_
_
::
GHC
.
HsBind
GHC
.
GhcRn
))
|
GHC
.
isExternalName
name
->
pure
(
sspan
,
RtkDecl
name
)
...
...
@@ -171,8 +178,14 @@ decls (group, _, _, _) = concatMap ($ group)
Just
(
field
::
GHC
.
ConDeclField
GHC
.
GhcRn
)
->
map
(
decl
.
fmap
GHC
.
selectorFieldOcc
)
$
GHC
.
cd_fld_names
field
Nothing
->
empty
fix
term
=
case
cast
term
of
Just
((
GHC
.
FixitySig
names
_
)
::
GHC
.
FixitySig
GHC
.
GhcRn
)
->
map
decl
names
Nothing
->
empty
tyfam
(
GHC
.
L
_
(
GHC
.
FamilyDecl
{
..
}))
=
[
decl
fdLName
]
sig
(
GHC
.
L
_
(
GHC
.
TypeSig
names
_
))
=
map
decl
names
sig
(
GHC
.
L
_
(
GHC
.
PatSynSig
names
_
))
=
map
decl
names
sig
(
GHC
.
L
_
(
GHC
.
ClassOpSig
_
names
_
))
=
map
decl
names
sig
_
=
[]
decl
(
GHC
.
L
sspan
name
)
=
(
sspan
,
RtkDecl
name
)
tyref
(
GHC
.
L
sspan
name
)
=
(
sspan
,
RtkType
name
)
...
...
This diff is collapsed.
Click to expand it.
hypsrc-test/ref/src/Classes.html
+
30
−
10
View file @
3077a12b
...
...
@@ -60,8 +60,12 @@
></a
><span
>
</span
><span
class=
"hs-identifier"
>
bar
</span
><a
name=
"bar"
><a
href=
"Classes.html#bar"
><span
class=
"hs-identifier"
>
bar
</span
></a
></a
><span
>
</span
><span
class=
"hs-glyph"
...
...
@@ -87,8 +91,12 @@
></a
><span
>
</span
><span
class=
"hs-identifier"
>
baz
</span
><a
name=
"baz"
><a
href=
"Classes.html#baz"
><span
class=
"hs-identifier"
>
baz
</span
></a
></a
><span
>
</span
><span
class=
"hs-glyph"
...
...
@@ -361,8 +369,12 @@
></a
><span
>
</span
><span
class=
"hs-identifier"
>
quux
</span
><a
name=
"quux"
><a
href=
"Classes.html#quux"
><span
class=
"hs-identifier"
>
quux
</span
></a
></a
><span
>
</span
><span
class=
"hs-glyph"
...
...
@@ -470,8 +482,12 @@
></a
><span
>
</span
><span
class=
"hs-identifier"
>
norf
</span
><a
name=
"norf"
><a
href=
"Classes.html#norf"
><span
class=
"hs-identifier"
>
norf
</span
></a
></a
><span
>
</span
><span
class=
"hs-glyph"
...
...
@@ -703,8 +719,12 @@
></a
><span
>
</span
><span
class=
"hs-identifier"
>
plugh
</span
><a
name=
"plugh"
><a
href=
"Classes.html#plugh"
><span
class=
"hs-identifier"
>
plugh
</span
></a
></a
><span
>
</span
><span
class=
"hs-glyph"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment