Skip to content

Commit 00ac27c

Browse files
update docs
1 parent fd58222 commit 00ac27c

File tree

1 file changed

+42
-58
lines changed

1 file changed

+42
-58
lines changed

docs/index.md

Lines changed: 42 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,31 @@ A language server for the Django web framework.
1212

1313
## Features
1414

15-
**None.**
15+
**Almost none!**
1616

1717
😅
1818

19-
However, the foundation has been laid:
19+
Well, we've achieved the bare minimum of "technically something":
20+
21+
- [x] Template tag autocompletion
22+
- It works! ...when you type `{%`
23+
- That's it. That's the feature.
24+
25+
The foundation is solid though:
2026

2127
- [x] Working server architecture
22-
- [x] Server implementing the Language Server Protocol written in Rust
23-
- [x] Python agent running as a persistent process within the Django project's virtualenv
24-
- [x] Server-agent communication via Protocol Buffers
28+
- [x] Language Server Protocol implementation in Rust
29+
- [x] Direct Django project interaction through PyO3
30+
- [x] Single binary distribution with Python packaging
2531
- [x] Custom template parser to support LSP features
2632
- [x] Basic HTML parsing, including style and script tags
2733
- [x] Django variables and filters
2834
- [ ] Django block template tags
2935
- Early work has been done on an extensible template tag parsing specification (TagSpecs)
30-
- [ ] Actual LSP features (coming soon!... hopefully)
36+
- [ ] More actual LSP features (coming soon!... hopefully)
37+
- We got one! Well, half of one. Only like... dozens more to go? 🎉
38+
39+
Django wasn't built in a day, and neither was a decent Django language server. 😄
3140

3241
## Requirements
3342

@@ -42,62 +51,26 @@ See the [Versioning](#versioning) section for details on how this project's vers
4251

4352
## Installation
4453

45-
The Django Language Server consists of two main components:
46-
47-
- **An LSP server**: Rust binary `djls`, distributed through the Python package `djls-server`
48-
- **A Python agent**: `djls-agent` package that runs in your Django project
49-
50-
Both will need to be available in your Django project in order to function.
51-
52-
The quickest way to get started is to install both the server and agent in your project's environment:
54+
Install the Django Language Server in your project's environment:
5355

5456
```bash
55-
uv add --dev 'djls[server]'
57+
uv add --dev django-language-server
5658
uv sync
5759

5860
# or
5961

60-
pip install djls[server]
62+
pip install django-language-server
6163
```
6264

63-
!!! note
64-
65-
The server should be installed globally on your development machine. The quick-start method above will install the server in each project's environment and is only intended for trying things out. See the [Server](#server) section below for details.
66-
67-
### Server
68-
69-
You can install the pre-built binary package from PyPI, or build from source using cargo.
70-
71-
The server binary is published to PyPI as `djls-server` for easy installation via uv or pipx:
72-
73-
```bash
74-
uv tool install djls-server
75-
76-
# or
77-
78-
pipx install djls-server
79-
```
65+
The package provides pre-built wheels with the Rust-based LSP server compiled for common platforms. Installing it adds the `djls` command-line tool to your environment.
8066

81-
If you have a Rust toolchain available and prefer to build from source, you can install via cargo:
82-
83-
```bash
84-
cargo install --git https://github.com/joshuadavidthomas/django-language-server
85-
```
86-
87-
### Agent
88-
89-
The agent needs to be installed in your Django project's environment to provide project introspection.
90-
91-
The agent is published to PyPI as `djls-agent` and should be added to your project's development dependencies:
67+
!!! note
9268

93-
```bash
94-
uv add --dev djls-agent
95-
uv sync
69+
The server must currently be installed in each project's environment as it needs to run using the project's Python interpreter to access the correct Django installation and other dependencies.
9670

97-
# or
71+
Global installation is not yet supported as it would run against a global Python environment rather than your project's virtualenv. The server uses [PyO3](https://pyo3.rs) to interact with Django, and we aim to support global installation in the future, allowing the server to detect and use project virtualenvs, but this is a tricky problem involving PyO3 and Python interpreter management.
9872

99-
pip install djls-agent
100-
```
73+
If you have experience with [PyO3](https://pyo3.rs) or [maturin](https://maturin.rs) and ideas on how to achieve this, please check the [Contributing](#contributing) section below.
10174

10275
## Editor Setup
10376

@@ -115,8 +88,6 @@ This project adheres to DjangoVer. For a quick overview of what DjangoVer is, he
11588
11689
In short, `v5.1.x` means the latest version of Django the Django Language Server would support is 5.1 — so, e.g., versions `v5.1.0`, `v5.1.1`, `v5.1.2`, etc. should all work with Django 5.1.
11790

118-
At this moment, all components of the Django Language Server (the `djls` binary, the `djls-agent` agent package on PyPI, and the `djls-binary` binary distribution package on PyPI) will share the same version number. When a new version is released, all packages are updated together regardless of which component triggered the release.
119-
12091
### Breaking Changes
12192

12293
While DjangoVer doesn't encode API stability in the version number, this project strives to follow Django's standard practice of "deprecate for two releases, then remove" policy for breaking changes. Given this is a language server, breaking changes should primarily affect:
@@ -137,13 +108,23 @@ The project needs help in several areas:
137108

138109
### Testing and Documenting Editor Setup
139110

140-
The server has only been tested with Neovim. Documentation for setting up the language server in other editors is sorely needed, particularly VS Code. However, any editor that has [LSP client](https://langserver.org/#:~:text=for%20more%20information.-,LSP%20clients,opensesame%2Dextension%2Dlanguage_server,-Community%20Discussion%20Forums) support would be welcome.
111+
The server has only been tested with Neovim. Documentation for setting up the language server in other editors is sorely needed, particularly VS Code. However, any editor that has [LSP client](https://langserver.org/#:~:text=for%20more%20information.-,LSP%20clients,opensesame%2Dextension%2Dlanguage_server,-Community%20Discussion%20Forums) support should work.
112+
113+
If you run into issues setting up the language server:
114+
115+
1. Check the existing documentation in `docs/editors/`
116+
2. [Open an issue](https://github.com/joshuadavidthomas/django-language-server/blob/main/../../issues/new) describing your setup and the problems you're encountering
117+
- Include your editor and any relevant configuration
118+
- Share any error messages or unexpected behavior
119+
- The more details, the better!
141120

142121
If you get it working in your editor:
143122

144123
1. Create a new Markdown file in the `docs/editors/` directory (e.g., `docs/editors/vscode.md`)
145124
2. Include step-by-step setup instructions, any required configuration snippets, and tips for troubleshooting
146125

126+
Your feedback and contributions will help make the setup process smoother for everyone! 🙌
127+
147128
### Feature Requests
148129

149130
The motivation behind writing the server has been to improve the experience of using Django templates. However, it doesn't need to be limited to just that part of Django. In particular, it's easy to imagine how a language server could improve the experience of using the ORM -- imagine diagnostics warning about potential N+1 queries right in your editor!
@@ -154,15 +135,18 @@ All feature requests should ideally start out as a discussion topic, to gather f
154135

155136
### Development
156137

157-
The project consists of both Rust and Python components:
138+
The project is written in Rust using PyO3 for Python integration:
158139

159-
- Rust: LSP server, template parsing, and core functionality (`crates/`)
160-
- Python: Django project and environment introspection agent (`packages/`)
140+
- LSP server implementation (`crates/djls/`)
141+
- Template parsing and core functionality (`crates/djls-template-ast/`)
142+
- Python integration via PyO3 for Django project introspection
161143

162144
Code contributions are welcome from developers of all backgrounds. Rust expertise is especially valuable for the LSP server and core components.
163145

164-
Python and Django developers should not be deterred by the Rust codebase - Django expertise is just as valuable. The Rust components were built by [a simple country CRUD web developer](https://youtu.be/7ij_1SQqbVo?si=hwwPyBjmaOGnvPPI&t=53) learning Rust along the way.
146+
One significant challenge we're trying to solve is supporting global installation of the language server while still allowing it to detect and use project virtualenvs for Django introspection. Currently, the server must be installed in each project's virtualenv to access the project's Django installation. If you have experience with PyO3 and ideas about how to achieve this, we'd love your help!
147+
148+
Python and Django developers should not be deterred by the Rust codebase - Django expertise is just as valuable. Understanding Django's internals and common development patterns helps inform what features would be most valuable. The Rust components were built by [a simple country CRUD web developer](https://youtu.be/7ij_1SQqbVo?si=hwwPyBjmaOGnvPPI&t=53) learning Rust along the way.
165149

166150
## License
167151

168-
django-language-server is licensed under the MIT license. See the [`LICENSE`](https://github.com/joshuadavidthomas/django-language-server/blob/main/LICENSE) file for more information.
152+
django-language-server is licensed under the Apache License, Version 2.0. See the [`LICENSE`](https://github.com/joshuadavidthomas/django-language-server/blob/main/LICENSE) file for more information.

0 commit comments

Comments
 (0)