Metadata-Version: 2.4
Name: craft-ls
Version: 0.3.3
Summary: A Language Server Protocol implementation for *craft files.
Project-URL: Repository, https://github.com/batalex/craft-ls
Project-URL: Releases, https://github.com/batalex/craft-ls/releases
Author-email: Alex Batisse <alex.batisse@canonical.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: charmcraft,lsp,rockcraft,snapcraft
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Requires-Dist: jsonpath-ng>=1.7.0
Requires-Dist: jsonref>=1.1.0
Requires-Dist: jsonschema>=4.23.0
Requires-Dist: lsprotocol>=2023.0.0
Requires-Dist: pygls>=1.1.0
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: referencing>=0.36.2
Description-Content-Type: text/markdown

# craft-ls

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/batalex/craft-ls/ci.yaml)

Get on\
[![PyPI - Version](https://img.shields.io/pypi/v/craft-ls)](https://pypi.org/project/craft-ls/)
[![FlakeHub](https://img.shields.io/badge/FlakeHub-5277C3)](https://flakehub.com/flake/Batalex/craft-ls)
[![Snap - Version](https://img.shields.io/snapcraft/v/craft-ls/latest/edge)](https://snapcraft.io/craft-ls)
[![VSCode Marketplace](https://vsmarketplacebadges.dev/version-short/abatisse.craft-ls.svg)](https://marketplace.visualstudio.com/items?itemName=abatisse.craft-ls)

`craft-ls` is a [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) implementation for *craft[^1] tools.

`craft-ls` enables editors that support the LSP to get quality of life improvements while working on *craft configuration files.

## Features

| Feature              | Snapcraft | Rockcraft | Charmcraft[^1] |
| :------------------- | :-------: | :-------: | :------------: |
| Diagnostics          |    ✅     |    ✅     |       ✅       |
| Symbol documentation |    ✅     |    ✅     |       ✅       |
| Autocompletion       |    ❌     |    ❌     |       ❌       |

https://github.com/user-attachments/assets/e4b831b5-dcac-4efd-aabb-d3040899b52b

## Usage

### Installation

Using `uv` or `pipx`

```shell
uv tool install craft-ls

pipx install craft-ls
```

### Setup

#### Helix

```toml
# languages.toml
[[language]]
name = "yaml"
language-servers = ["craft-ls"]

[language-server.craft-ls]
command = "craft-ls"
```

#### VSCode

The VSCode extension can be installed from the marketplace.
It requires a Python 3.12 interpreter.
If not automatically picked, you may configure it using the following key:

```json
"craft-ls.interpreter": [
  "/usr/bin/python3.12"
]
```

TBD: neovim

## Roadmap

Project availability:

- Python package
- Snap
- Nix flake
- VSCode extension

Features:

- Diagnostics
- Autocompletion **on typing**
- Symbol documentation

Ecosystem:

- Encourage *craft tools to refine their JSONSchemas even further

[^1]: snapcraft, rockcraft and partial support for charmcraft (all-in-one `charmcraft.yaml` only)
