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

Add support for :external: role completions #856

Merged
merged 4 commits into from
Jul 19, 2024

Conversation

alcarney
Copy link
Member

@alcarney alcarney commented Jul 19, 2024

image

While it works, this feels a little bit like a hack, since to enable the completions the sphinx agent generates a role definition for every combination of external, +invname and domain:objtype. I'm sure a future version of this can be smarter about it.

The role completions are also starting to feel perhaps a little clunky? The completions can get quite long... perhaps having the server return just external and then on the + return a list of invnames could be potential improvement to explore...

Closes #464, supersedes #514

This adds code to dump all objects defined in intersphinx inventories
into the `objects` table in the SQLite DB.

So that the language server can distinguish between local objects and
objects defined in another project, the `objects` table has been
extended to include a `project` column. It will be `NULL` for objects
in the local project or be set to the intersphinx inventory name
otherwise.

To ensure that the language server is able to surface these items in
completions this commit updates the domain role indexing code to
also store `external:domain:role` and `external+invname:domain:role`
variants of the role in the DB.

This feels... hacky but seems to work well. Maybe this can be
revisited in the future and improved with a more dynamic role
completion system...
@alcarney alcarney merged commit 015087b into swyddfa:develop Jul 19, 2024
12 of 13 checks passed
@alcarney alcarney deleted the intersphinx branch July 19, 2024 18:48
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 for the new intersphinx syntax (:external: role)
1 participant