-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update handler for mkdocstrings 0.28 #23
base: master
Are you sure you want to change the base?
Conversation
Oh, let me fix linting. |
Returns: | ||
The combined options. | ||
""" | ||
return {**self.default_config, **local_options} |
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 to deepcopy
here, but I've been bitten by this previously. This creates a new dict, but with references to mutable structures from both default config and local options. The only time config
is mutated is below in render
with config["members_order"] = Order(config["members_order"])
, which I believe doesn't cause any issue.
We can still deepcopy
here just to be safe. Let me know.
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.
Maybe the real solution is to not mutate the config at all. Otherwise yes, let's use deepcopy.
try: | ||
data = self.collect(identifier, {}) | ||
except CollectionError: | ||
return () | ||
return data.path.as_posix(), *(p.signature.name for p in data.procedures) |
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 have replicated previous behavior here, but I have to note that this seems incorrect to return both the path of the file, as well as all the procedure names within it. It's possible that the previous method (get_anchors
) was confusing, and the "anchors" concept not well explained. The renaming to get_aliases
is to make it more clear: it's not really about HTML anchors, it's about obtaining all the different "aliases" ("locations") for a given object, to correctly populate mkdocs-autorefs data. I know nothing about VBA, but surely Procedure1
is not an alias of Procedure2
?
Aliases (and the identifier) are supposed to be strings that you can pass to collect
.
Here I'd either just return (data.path.as_posix(),)
(or even an empty tuple ()
), or add a way to support collecting Procedure1
without a file path (or these procedure objects should expose fully qualified names that can be collected).
@@ -28,7 +28,7 @@ | |||
"setuptools_scm", | |||
], | |||
install_requires=[ | |||
"mkdocstrings>=0.26.1,<1", | |||
"mkdocstrings>=0.28,<1", |
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.
0.28 is not published yet so it will probably fail in CI.
Following discussion in mkdocstrings/mkdocstrings#727.