sqlakit-lsp 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlakit_lsp/__init__.py +9 -0
- sqlakit_lsp/__main__.py +5 -0
- sqlakit_lsp/_cli.py +22 -0
- sqlakit_lsp/_server.py +2448 -0
- sqlakit_lsp/py.typed +0 -0
- sqlakit_lsp-0.1.0.dist-info/METADATA +79 -0
- sqlakit_lsp-0.1.0.dist-info/RECORD +10 -0
- sqlakit_lsp-0.1.0.dist-info/WHEEL +4 -0
- sqlakit_lsp-0.1.0.dist-info/entry_points.txt +3 -0
- sqlakit_lsp-0.1.0.dist-info/licenses/LICENSE +21 -0
sqlakit_lsp/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sqlakit-lsp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The language server for SQLAKit templates.
|
|
5
|
+
Keywords: sqlalchemy,sqlakit,lsp,language-server,sql
|
|
6
|
+
Author: Anton Ruhlov
|
|
7
|
+
Author-email: Anton Ruhlov <antonruhlov@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Topic :: Database
|
|
19
|
+
Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Dist: sqlakit>=0.21.0,<0.22
|
|
22
|
+
Requires-Dist: pygls>=2.1,<3
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Project-URL: Repository, https://github.com/sqlakit/sqlakit-lsp
|
|
25
|
+
Project-URL: Documentation, https://github.com/sqlakit/sqlakit-lsp#readme
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# sqlakit-lsp
|
|
29
|
+
|
|
30
|
+
The language server for [SQLAKit](https://sqlakit.readthedocs.io/en/stable/)
|
|
31
|
+
templates. In a `.sql` template:
|
|
32
|
+
|
|
33
|
+
- the problems `sqlakit check` finds, as you type
|
|
34
|
+
- completion after `tpl.` and in `tpl.include('`, and a macro's arguments while
|
|
35
|
+
you write them
|
|
36
|
+
- on hover, the SQL a call writes, above the macro's signature and docstring
|
|
37
|
+
- go to definition, implementation and references of a macro or a template
|
|
38
|
+
- rename of a macro or a template across the project
|
|
39
|
+
- the macros' calls and the parameters coloured
|
|
40
|
+
- a parameter no call of the project passes, marked, with a quick fix for a
|
|
41
|
+
name close to one the calls pass
|
|
42
|
+
- **Show rendered SQL**, the whole template as the SQL it writes
|
|
43
|
+
- the outline of a template, and a search for a macro or a template
|
|
44
|
+
|
|
45
|
+
In Python, the template name in `db.sql("...")` completes and links to its
|
|
46
|
+
file, and a value the template does not read is marked.
|
|
47
|
+
|
|
48
|
+
```console
|
|
49
|
+
$ pip install sqlakit-lsp
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Register `sqlakit-lsp` for `.sql` and `.py` files in your editor. It talks over
|
|
53
|
+
stdio. In Neovim 0.11:
|
|
54
|
+
|
|
55
|
+
```lua
|
|
56
|
+
vim.lsp.config("sqlakit", {
|
|
57
|
+
cmd = { "sqlakit-lsp" },
|
|
58
|
+
filetypes = { "sql", "python" },
|
|
59
|
+
root_markers = { "pyproject.toml" },
|
|
60
|
+
})
|
|
61
|
+
vim.lsp.enable("sqlakit")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Zed colours the macros' calls and the parameters of a template from the
|
|
65
|
+
server once its settings say `"semantic_tokens": "combined"`.
|
|
66
|
+
|
|
67
|
+
It reads the project the way `sqlakit check` does, from the `Templates(...)`
|
|
68
|
+
the code builds, without running it. [SQL
|
|
69
|
+
templates](https://sqlakit.readthedocs.io/en/stable/sql/#template-validation)
|
|
70
|
+
covers what it reads, and `[tool.sqlakit.templates]` for a project whose code
|
|
71
|
+
builds its paths in a way it can't follow.
|
|
72
|
+
|
|
73
|
+
## Development
|
|
74
|
+
|
|
75
|
+
```console
|
|
76
|
+
$ uv sync
|
|
77
|
+
$ uv run poe test
|
|
78
|
+
$ uv run poe lint
|
|
79
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
sqlakit_lsp/__init__.py,sha256=v_EAAUNQv0_D1WRdtCBkpZs16rw2gK48HIfAIBXbryU,255
|
|
2
|
+
sqlakit_lsp/__main__.py,sha256=arq9FhDc5f2AZchKpqlkQwTT-bKvMcj3iAXJg8GRLCc,53
|
|
3
|
+
sqlakit_lsp/_cli.py,sha256=rBYxDww0ZHoSeGJ_kQCn1nFHs9IxXJ9Jux8QifyqHKM,796
|
|
4
|
+
sqlakit_lsp/_server.py,sha256=aKQi16qHUk5TS_m_nPNLKK5pEcMMv46x-lCB_rwjUOQ,98419
|
|
5
|
+
sqlakit_lsp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
sqlakit_lsp-0.1.0.dist-info/licenses/LICENSE,sha256=7PvNQp62qbFhtaJTzG4bjNGYVX58VPm_Kika2ZbjhJQ,1069
|
|
7
|
+
sqlakit_lsp-0.1.0.dist-info/WHEEL,sha256=e4_1dyBeezi8ZjfxrZ3bnVOxFDa3ksqVqH0jTHkUZ3k,81
|
|
8
|
+
sqlakit_lsp-0.1.0.dist-info/entry_points.txt,sha256=Z6PcvdBScbWwOIagZB0pmjmInCyuCmM4roqzchPX0CA,55
|
|
9
|
+
sqlakit_lsp-0.1.0.dist-info/METADATA,sha256=9cXG-mk1lcepZKEkfwfP-7z7DSFdxZKNroz1uSx6tAE,2821
|
|
10
|
+
sqlakit_lsp-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Anton Ruhlov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|