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

Abstract the implementation to support other languages #148

Open
LecrisUT opened this issue Aug 12, 2024 · 3 comments
Open

Abstract the implementation to support other languages #148

LecrisUT opened this issue Aug 12, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@LecrisUT
Copy link

Would it be possible to abstract the implementation? From what I see this currently relies on ast module, but if we were to provide a similar python interface, could it work to extend to non-python source as well?

@LecrisUT LecrisUT added the enhancement New feature or request label Aug 12, 2024
@felix-hilden
Copy link
Owner

Hi! That's an interesting idea for sure. I think it'd be quite a lot of work, because not only do we rely on AST, but also largely the project being importable to extract type hints. Not sure about Sphinx internals there, maybe there's something we could use if other languages report types too. What would you use it for?

@LecrisUT
Copy link
Author

LecrisUT commented Aug 14, 2024

but also largely the project being importable to extract type hints

I could use a reference for this to understand. I thought this is still left to the predefined domain role and rely on whatever autoapi was used to extract them.

Not sure about Sphinx internals there, maybe there's something we could use if other languages report types too

For this would the language specific domains be useful, e.g. C++ (also definition). In the sense that you can assume there is a dict between an ast type and one of a sphinx domain role or a function that would translate it?

What would you use it for?

Given that there is already upstream domain and ast implementation for C/C++ I would start there, without autosphinx support if it makes sense.

@felix-hilden
Copy link
Owner

This whole module, starting from the top does the resolving! It's more than just linking AST to Sphinx inventories. When we use a method of a class in code, we need to determine what comes out. And maybe what you described is exactly it, I'll have to have a look later on!

@felix-hilden felix-hilden changed the title Abstract the implementation Abstract the implementation to support other languages Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants