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

Support for the new intersphinx syntax (:external: role) #464

Open
stsewd opened this issue Oct 16, 2022 · 4 comments · May be fixed by #514
Open

Support for the new intersphinx syntax (:external: role) #464

stsewd opened this issue Oct 16, 2022 · 4 comments · May be fixed by #514
Labels
enhancement New feature or request lsp Issues that relate to the language server

Comments

@stsewd
Copy link
Contributor

stsewd commented Oct 16, 2022

Sphinx 4.4 introduced a new syntax for using intersphinx (the :external: role) https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#explicitly-reference-external-objects.

Basically:

  • :external:domain:reftype:`target`
  • :external:reftype:`target`
  • :external+invname:domain:reftype:`target`
  • :external+invname:reftype:`target`

Esbonio should

  • Suggest :external: when typing :
  • Suggest the intersphinx projects when typing :external+ (or maybe even when typing just :external)
  • Suggest all roles as usual after :external:
  • Don't include intersphinx projects when suggesting targets, since the invname:target syntax doesn't work when using the external role
@stsewd
Copy link
Contributor Author

stsewd commented Oct 17, 2022

The :external:* roles are resolved dynamically, that's why they aren't listed in the normal registry

https://github.com/sphinx-doc/sphinx/blob/ae42de48eba28718ba4a2f91945a2800ff7c48df/sphinx/ext/intersphinx.py#L467-L478

I guess esbonio needs a way for extensions to register roles, like a add_role_completion_provider?

def add_target_completion_provider(self, provider: TargetCompletion) -> None:

@alcarney alcarney added enhancement New feature or request lsp Issues that relate to the language server labels Oct 17, 2022
@github-actions github-actions bot added this to Backlog in Language Server Oct 17, 2022
@alcarney
Copy link
Member

I guess esbonio needs a way for extensions to register roles, like a add_role_completion_provider?

Yes, in #453 I've just refactored support for directives and made it possible for 1st and 3rd party extensions to contribute directive completion suggestions. Once a similar refactoring for roles lands, adding support for this should be relatively straightforward.

@alcarney
Copy link
Member

alcarney commented Nov 28, 2022

With #495 it should now be possible to implement this - would you be interested in having a go? 🙂

@stsewd
Copy link
Contributor Author

stsewd commented Nov 29, 2022

would you be interested in having a go? slightly_smiling_face

would love to! I'll give it a try next week.

@stsewd stsewd linked a pull request Dec 10, 2022 that will close this issue
@alcarney alcarney added this to the Language Features milestone Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lsp Issues that relate to the language server
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants