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

Suffix role markers in reStructuredText docstrings #7015

Open
elspv opened this issue Mar 5, 2025 · 3 comments
Open

Suffix role markers in reStructuredText docstrings #7015

elspv opened this issue Mar 5, 2025 · 3 comments
Assignees

Comments

@elspv
Copy link

elspv commented Mar 5, 2025

reStructuredText allows role markers to be either a prefix or a suffix of interpreted text.

def example():
    """Two ways
    
    * Prefix stye: :func:`example`
    * Postfix stye: `example`:func:
    """
    pass

Pylance currently only supports the prefix style. Sphinx support both. Please add support for suffix role markers.

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Mar 5, 2025
@rchiodo
Copy link
Contributor

rchiodo commented Mar 5, 2025

What would be the expectation of the output? It looks like it's working to me:

Image

@rchiodo
Copy link
Contributor

rchiodo commented Mar 5, 2025

Whoops, I had restructured text turned off. It's showing this

Image

@rchiodo rchiodo removed the needs repro Issue has not been reproduced yet label Mar 5, 2025
@rchiodo
Copy link
Contributor

rchiodo commented Mar 5, 2025

That text gives out this AST in our parser:

Image

We probably just need to handle the case when the role comes after.

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

No branches or pull requests

2 participants