Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested module comment scope differs between before/after decl #38

Open
dsheets opened this issue Jan 14, 2015 · 4 comments
Open

Nested module comment scope differs between before/after decl #38

dsheets opened this issue Jan 14, 2015 · 4 comments

Comments

@dsheets
Copy link
Contributor

dsheets commented Jan 14, 2015

type t

(** This module has {{!t}type t}! *)
module M : sig
  type t
end

is scoped to the container but

type t

module M : sig
  (** This module has {{!t}type t}! *)

  type t
end

is scoped to the child, M.

See also dsheets/ocamlary-test-library@f326339.

@lpw25
Copy link
Collaborator

lpw25 commented Jan 14, 2015

This is an interesting variation on #15. It seems that we would like self-reference to subcomponents to be highest priority but self-reference to the same definition to be lowest priority.

@dsheets
Copy link
Contributor Author

dsheets commented Jan 14, 2015

I think the rules for the second case work ok. As far as I understand them, the path is searched ancestor-ward starting with self.

I don't understand why the first case is different as I thought both resulted in an annotation node on the same signature item (M).

@lpw25
Copy link
Collaborator

lpw25 commented Jan 14, 2015

I think that the second one is a stand-alone comment within M rather than it's description. I think that only the top-level modules treat the first comment specially. To be honest I can't actually remember whether this is the case, nor whether this is what ocamldoc currently implements, but I think it is probably the right implementation.

@dsheets
Copy link
Contributor Author

dsheets commented Jan 15, 2015

This affects documentation of cmdliner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants