Skip to content

Plugin system #102

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

Open
wolflu05 opened this issue Mar 31, 2025 · 0 comments
Open

Plugin system #102

wolflu05 opened this issue Mar 31, 2025 · 0 comments

Comments

@wolflu05
Copy link
Contributor

wolflu05 commented Mar 31, 2025

As discussed in #98 it would be really nice to add plugin support to djlsp.

For defining plugins it the importlib metadata entrypoints: https://docs.python.org/3/library/importlib.metadata.html#entry-points can be used so that there can be not only first party plugins, but also plugins that can be loaded from sources outside of this repository.
Plugins should be able to inference in multiple ways with the LSP.

1. Data collection

Plugins should be able to:

  • modify existing collected data
  • add new collect data (e.g. discover custom templates, ...)
  • collect custom data for plugin usage later (add custom data to the collected data that they can later use in the LSP)

The wagtail collector can the be moved into a contrib package.

2. Custom parser

Plugins should be able to add custom completion and hover rules. This would be useful to extract internal contrib things as well as for external projects using djlsp. These plugins then should have access to the data they have collected. E.g.

3. Provide live context

Plugins should be able to provide the actual context data for using in hover/completions to help the user decide on a specific variable. This can be used with jedi.Interpreter.

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

No branches or pull requests

1 participant