fjkit-lsp
A language server that links the three things a fjkit page is made of: the
route (@render("tasks/page.html", partial="tasks/_board.html")), the response
model it returns (-> BoardResponse), and the templates.
What it answers:
| Cursor on | Go to definition | Find references | Hover |
|---|---|---|---|
tasks in a template |
BoardResponse.tasks in schemas.py |
every tasks in the templates that model reaches |
model, annotation, routes |
task.title (loop var or macro parameter) |
Task.title |
every x.title where x is a Task |
type of the chain head |
task_row (imported macro) |
the {% macro %} |
every call, in every template | source template |
"tasks/_board.html" (Jinja tag or Python string) |
the file | include/extends/import tags and @render decorators |
routes and parents |
"tasks_advance" inside url_for(...) |
the handler | every template naming the route | handler location |
url_for |
env.globals["url_for"] in templating.py |
— | — |
| a field in a model class (Python) | — | its uses in templates | occurrence count |
| a model class name (Python) | — | the routes returning it | routes and templates |
"task-changed" in an hx-trigger value, or in subscribe(request, x, ["task-changed"]) |
every @render(…, hx_trigger=…) raising it |
every listener, and every emitter | which routes raise it, as HX-Trigger or HX-Trigger-After-Swap, via which constant |
CHANGED_EVENT in Python, when its value is an event a route raises |
— (Pyright's) | every template listening for it | the same |
hx-target="#board" (attribute or macro kwarg) |
the element with id="board" |
every hx-* naming #board |
where the id is |
id="board" |
— | every hx-* naming #board |
how many |
hx-get="/tasks/7/advance" — a literal URL |
the route whose path it hits, router prefix included | the route | method, path template, handler |
Context is followed the way Jinja passes it: a route's model reaches its
template, whatever that template includes, and whatever it extends. Macro
parameters have no annotation, so their type is inferred from what the call
sites pass. Only code inside {{ }} / {% %} and outside string literals
counts as a reference, and a comment counts for nothing — a macro's signature
note quoting hx_target="#board" is not a target.
Model fields and classes have no definition on the Python side on purpose: the cursor is on the definition already and Pyright answers it; a second copy would only lengthen the editor's list. What the kit adds there is references.
Files under tests/ are not indexed. A route in a test never ships.
One repository, several applications
A template name is only unique inside one application's loader chain. This
repository has three base.html files — one per demo, one for the docs site —
so the index keeps a chain per application rather than a single name table,
mirroring the ChoiceLoader that build_environment assembles:
| Kind of root | Who sees it | Here |
|---|---|---|
an application's own templates/ |
that application only | each demo, the docs workbench |
a distribution's, under src/ |
every application, plugins before the kit | fjkit-admin, fjkit-apidocs, fjkit-charts, then fjkit |
Every lookup is made from the file that wrote the name, so base.html in a demo
page means that demo's, and admin/page.html means the one fjkit-admin ships.
fjkit/ui/form.html always means the kit's own copy, exactly as
_ReservedNamespace guarantees at runtime.
In an editor
The client is the repository's own extension, tools/fjkit-vscode — plain
JavaScript on the VS Code API, no npm, packaged by a Python script:
uv sync # puts the server in .venv
uv run python tools/fjkit-vscode/build.py # dist/fjkit-vscode-<version>.vsix
code --install-extension tools/fjkit-vscode/dist/fjkit-vscode-*.vsix
cursor --install-extension tools/fjkit-vscode/dist/fjkit-vscode-*.vsix
It attaches to html, jinja-html, jinja and python, so a @render
string opens its template and a model field finds its uses without leaving the
editor. Its README has the rest — how it finds
the server, and why by path.
Neovim, Helix, Zed and Emacs configure a language server themselves and need
no extension: point them at .venv/bin/fjkit-lsp.
Command line
uv run fjkit-lsp index # the roots, and what was indexed
uv run fjkit-lsp where tasks/_board.html # who renders / includes / imports it
uv run fjkit-lsp var tasks/_board.html tasks # where a template identifier comes from
uv run fjkit-lsp at app/templates/tasks/macros.html 13 20 # definition + references at a cursor
Paths are relative to the current directory; run from the repository root. A bare template name is read on the default chain, so pass the path instead when two applications share the name:
uv run fjkit-lsp where examples/fjkit-demo/app/templates/base.html
Metadata
Release files for fjkit-lsp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fjkit_lsp-0.1.0.tar.gz | 25.0 kB | Without provenance | Details for fjkit_lsp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fjkit_lsp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for fjkit_lsp-0.1.0-py3-none-any.whl |
Total release size: 49.3 kB
Release files / fjkit_lsp-0.1.0.tar.gz
| Download URL | fjkit_lsp-0.1.0.tar.gz |
|---|---|
| Size | 25.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e9cc2e554d97486bc0f9f6fe58fa7eb6feca9dbc60487c61b5dbc75060ba949
|
|
BLAKE2b-256 checksum How to use checksums |
e3f04ff2a3ca8de70b3b991ac41150abcc51908627ca63069b8826bbe3c30290
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fjkit_lsp-0.1.0-py3-none-any.whl
| Download URL | fjkit_lsp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 24.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66e5b6f5b45216904cd60b5595fac2b78544d8405ba1738efb8b2c895a0cc3e2
|
|
BLAKE2b-256 checksum How to use checksums |
16aab62d8a6ebf3f592a914fe0aea53b3b1803fa212b79f1579f7684e032c53f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for fjkit-lsp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.