-
Notifications
You must be signed in to change notification settings - Fork 100
Report failures when resolving references #717
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
Conversation
Add a warning when a reference couldn't be resolved. The behavior doesn't change.
To add more context into the error message.
@@ -23,30 +23,40 @@ type type_lookup_result = | |||
| `C of class_lookup_result | |||
| `CT of class_type_lookup_result ] | |||
|
|||
type value_lookup_result = Resolved.Value.t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't need these let's get rid of them rather than just commenting them out.
src/xref2/ref_tools.ml
Outdated
end | ||
|
||
module CT = struct | ||
type t = class_type_lookup_result | ||
(* type t = class_type_lookup_result *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these I'm quite tempted to keep the type here as documentation (internal right now, since it's not actually exposed in the interface) - though the alias is not terribly helpful. How about:
type t = Resolved.ClassType.t * Component.ClassType.t
It also might be useful to declare the error type too - again, mainly for documentation purposes. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd too prefer to define this type fully and define class_type_lookup_result
as alias to it but I prefer to not duplicate the definition.
I've added back all the types and added an instance of the result type to the first function of every modules (for documentation).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need class_type_lookup_result
- so no duplication needed. I think the only one actually exposed is module_lookup_result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(beyond the fact that they are used in subsequent result types, which we can duplicate in the modules I think)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not exposed but it's used to define type_lookup_result
and that's the duplication I would like to avoid. I think it's also useful to show that type_lookup_result
is an aggregate of existing return types rather than a new thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's keep this as-is for now, we might still be able to tidy up but it's not a big issue :-)
CHANGES: Breaking changes - Remove odoc-parser into a separate repository (@jonludlam, ocaml/odoc#700) Additions - OCaml 4.13 support (@Octachron, ocaml/odoc#687, ocaml/odoc#689) - Better errors/warnings (@Julow, ocaml/odoc#692, ocaml/odoc#717, ocaml/odoc#720, ocaml/odoc#732) - ModuleType 'Alias' support (@jonludlam, ocaml/odoc#703) - Improved test suite (@lubega-simon, ocaml/odoc#697) - Improved documentation (@lubega-simon, @jonludlam, ocaml/odoc#702, ocaml/odoc#733) - Strengthen module types (@jonludlam, ocaml/odoc#731) Bugs fixed - `uwt` now can be documented (@jonludlam, ocaml/odoc#708) - Fix resolution involving deeply nested substitutions (@jonludlam, ocaml/odoc#727) - Fix off-by-one error in error reporting (@asavahista, ocaml/odoc#736)
Closes #664
Add a warning when a reference failed to resolve. Before, this was not reported at all.