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.
@@ -0,0 +1,9 @@
1
+ """The language server for SQLAKit templates.
2
+
3
+ `sqlakit-lsp` runs it over standard input and output, for an editor to start.
4
+ It reads the project the way `sqlakit check` does, without running its code.
5
+ """
6
+
7
+ from ._server import serve
8
+
9
+ __all__ = ["serve"]
@@ -0,0 +1,5 @@
1
+ import sys
2
+
3
+ from ._cli import main
4
+
5
+ sys.exit(main())
sqlakit_lsp/_cli.py ADDED
@@ -0,0 +1,22 @@
1
+ """`sqlakit-lsp`, the command line."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ from importlib.metadata import version
7
+
8
+ from ._server import serve
9
+
10
+
11
+ def main(argv: list[str] | None = None) -> int:
12
+ """Serve an editor over standard input and output until it hangs up."""
13
+ parser = argparse.ArgumentParser(
14
+ prog="sqlakit-lsp",
15
+ description="The language server for SQLAKit templates, over stdio.",
16
+ )
17
+ parser.add_argument("--version", action="version", version=version("sqlakit-lsp"))
18
+ # Some editors pass it to every server: stdio is the only way this one talks.
19
+ parser.add_argument("--stdio", action="store_true", help=argparse.SUPPRESS)
20
+ parser.parse_args(argv)
21
+ serve() # pragma: no cover - run by an editor
22
+ return 0 # pragma: no cover