Skip to content

Plugin system #102

@wolflu05

Description

@wolflu05

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions