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

Re-implement completion for directives #706

Merged
merged 18 commits into from
Jan 14, 2024
Merged

Conversation

alcarney
Copy link
Member

@alcarney alcarney commented Jan 1, 2024

This re-implements completion suggestions for directives (as in .. figure:: or ```{toctree} ), completions for a directive's arguments and options will come in a future PR.

  • Completions for both reStructuredText and MyST are supported.
    Note: The MyST syntax for directives is a lot more complicated than the rst syntax, so the following is not yet supported
    • Using :::{note} style directives
    • Nesting directives
  • Support for the insert and replace style of completions, using the esbonio.server.completion.preferredInsertBehavior option as before.
    Thanks to the new configuration framework, you can even switch between them without restarting the server!
  • Last but not least, esbonio will finally respect the ..default-domain:: directive when generating completion suggestions! Closes Support the default-domain directive #105

Related: #312

This makes it easy for the parent language server to inspect the values
This allows the user to tell the server how they would prefer
completions to behave.

Also since this is implemented using the new config subscription
framework, the user can change the setting on the fly!
Run `python -i scripts/sphinx-app.py` to easily get an Esbonio enabled
Sphinx application object to inspect
Not only does this simplify the pattern, but this also removes a
"Sphinx-ism" from something that should apply at the docutils/rst spec level
@alcarney alcarney merged commit 231d8a7 into swyddfa:develop Jan 14, 2024
12 of 13 checks passed
@alcarney alcarney deleted the completion branch January 14, 2024 19:27
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.

Support the default-domain directive
1 participant