-
-
Notifications
You must be signed in to change notification settings - Fork 6
Description
I'm new to LSP, having previously used editors without it, and am having some issues with using django-language-server in Zed via its Django extension. I'm not sure if this is a missing feature or something that I just don't know how to do.
I typically run my Django projects containerized, and specify some environment variables in docker-compose.yml to be passed to my Django process inside the container. Among these is DJANGO_SECRET_KEY. In my settings file, I use SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]. (I mount the code dir from the host to the container, so I can edit it on the host.)
I've got debug = true in my pyproject.toml under [tool.djls], and in the language server debug logs are these rows (among others):
Inspector query 'django_init' returned ok=false, error=Some("'DJANGO_SECRET_KEY'")
templatetags(Id(0)): executing query
Inspector query 'templatetags' returned ok=false, error=Some("'DJANGO_SECRET_KEY'")
template_dirs(Id(0)): executing query
Inspector query 'template_dirs' returned ok=false, error=Some("'DJANGO_SECRET_KEY'")
What I don't understand is how to pass this and any other environment variables needed for settings loading to django-language-server with any mechanism, be it pyproject.toml or the initialization_options object in Zed's settings.json. Is it possible? I've looked at the docs for Zed, the Django extensions AND django-language-server, but have either missed something, or it's not described there.
Metadata
Metadata
Assignees
Labels
Projects
Status