Skip to content

Conversation

@pawamoy
Copy link
Member

@pawamoy pawamoy commented Jan 24, 2025

Following discussion in mkdocstrings/mkdocstrings#727.

@pawamoy
Copy link
Member Author

pawamoy commented Jan 24, 2025

Oh, let me fix linting.

Comment on lines +196 to 204
try:
data = self.collect(identifier, {})
except CollectionError:
return ()
return data.path.as_posix(), *(p.signature.name for p in data.procedures)
Copy link
Member Author

@pawamoy pawamoy Jan 24, 2025

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).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have to dig in and re-learn this code. A few years ago, I wrote the VBA handler by copying the Python handler and modifying it until it works. Even back then, I did not understand all the code. I'll try to go from this PR and see if I can build up a better understanding.

@pawamoy
Copy link
Member Author

pawamoy commented Aug 24, 2025

The rest of the Mypy warnings are irrelevant to this PR I believe.

@rudolfbyker rudolfbyker merged commit 1e98806 into master Sep 1, 2025
6 checks passed
@rudolfbyker rudolfbyker deleted the mkdocstrings-028 branch September 1, 2025 08:12
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

Successfully merging this pull request may close these issues.

3 participants