Skip to content

Commit 6b8fc81

Browse files
committed
Add config and docs for local development with Helix
1 parent 320b096 commit 6b8fc81

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Static project files
22
/env/
3+
/tests/django_test/env/
4+
5+
# Test files
6+
/tests/django_test/django_app/templates/test.html
37

48
# Python files
59
.Python
@@ -15,6 +19,7 @@ pip-selfcheck.json
1519

1620
# OS and project files
1721
*sqlite3
22+
*djlsp.log
1823
.DS_Store
1924
.mypy_cache
2025
.template-version
@@ -23,7 +28,7 @@ pip-selfcheck.json
2328
.env
2429
*.swp
2530
.idea/
26-
.helix/
31+
/.helix/
2732

2833
# Coverage
2934
.coverage

Makefile

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ clean:
1313

1414
$(ENV):
1515
python3 -m venv $(ENV)
16-
17-
develop: $(ENV)
1816
$(PYTHON) -m pip install --upgrade pip setuptools wheel twine
1917
$(PYTHON) -m pip install -e .[dev]
2018

19+
develop: $(ENV)
20+
2121
fix-codestyle:
2222
$(BIN)/black $(CODE_LOCATIONS)
2323
$(BIN)/isort $(CODE_LOCATIONS)
@@ -30,6 +30,14 @@ lint:
3030
test: lint
3131
$(BIN)/tox run
3232

33+
django-env:
34+
python3 -m venv tests/django_test/env
35+
tests/django_test/env/bin/python -m pip install django~=4.2.0
36+
37+
helix: $(ENV) django-env
38+
touch tests/django_test/django_app/templates/test.html
39+
. $(ENV)/bin/activate; hx --working-dir tests/django_test tests/django_test/django_app/templates/test.html
40+
3341
install-ci: $(ENV)
3442
$(PYTHON) -m pip install --upgrade pip setuptools wheel twine build .
3543

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,13 @@ require'lspconfig'.djlsp.setup{
119119

120120
To use the Django template LSP with VSCode read the following [readme](vscode/README.md)
121121

122+
## Development
123+
124+
For local development, using [Helix](https://helix-editor.com) is the easiest approach.
125+
The configuration for using the source Django template language server, with logging enabled, is already set up.
126+
127+
To start the Helix editor with the environment activated and the correct workspace loaded, run:
128+
129+
```bash
130+
make helix
131+
```
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[language-server.djlsp]
2+
command = "djlsp"
3+
args = ["--enable-log"]
4+
5+
[language-server.djlsp.config]
6+
django_settings_modules="django_test.settings"
7+
8+
[[language]]
9+
name = "html"
10+
language-servers = [ "djlsp" ]

0 commit comments

Comments
 (0)