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

Doc target completions needs to take into account file locations #102

Closed
alcarney opened this issue Feb 11, 2021 · 0 comments · Fixed by #108
Closed

Doc target completions needs to take into account file locations #102

alcarney opened this issue Feb 11, 2021 · 0 comments · Fixed by #108
Assignees
Labels
bug Something isn't working lsp Issues that relate to the language server

Comments

@alcarney
Copy link
Member

Offering a completions for the :doc: role need a little more intelligence behind them. Consider the following hierarchy

docs
|- a
|   |- x.rst
|   \- y.rst
\- b
    \- z.rst

Typing :doc:`b/z` in a/x.rst will result in Sphinx not being able to resolve the reference.
It either needs to be

  • a relative reference to the a/x.rst file (:doc:`../b/z` )
  • an "absolute" reference, relative to the project's conf.py (:doc:`/b/z` )

The insert_text for the target's CompletionItem needs to be tweaked to fix this

@alcarney alcarney added bug Something isn't working lsp Issues that relate to the language server labels Feb 11, 2021
@alcarney alcarney self-assigned this Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lsp Issues that relate to the language server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant