Skip to content

Commit 5edb240

Browse files
committed
initial commit
0 parents  commit 5edb240

File tree

12 files changed

+387
-0
lines changed

12 files changed

+387
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
**Describe the bug**
10+
11+
<!-- A clear and concise description of what the bug is. -->
12+
13+
**Steps to reproduce**
14+
15+
<!-- Steps to reproduce the behavior: -->
16+
17+
**Expected behavior**
18+
19+
<!-- A clear and concise description of what you expected to happen. -->
20+
21+
**Screenshots**
22+
23+
<!-- If applicable, add screenshots to help explain your problem. -->
24+
25+
**Additional context**
26+
27+
<!-- Add any other context about the problem here. -->
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ""
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
11+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
12+
13+
**Describe the solution you'd like**
14+
15+
<!-- A clear and concise description of what you want to happen. -->
16+
17+
**Describe alternatives you've considered**
18+
19+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
20+
21+
**Additional context**
22+
23+
<!-- Add any other context or screenshots about the feature request here. -->
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
5+
<!--- Describe your changes in detail -->
6+
7+
## Motivation and Context
8+
9+
<!--- Why is this change required? What problem does it solve? -->
10+
<!--- If it fixes an open issue, please link to the issue here. -->
11+
12+
## Types of changes
13+
14+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
15+
16+
- [ ] Bug fix (non-breaking change which fixes an issue)
17+
- [ ] New feature (non-breaking change which adds functionality)
18+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
19+
20+
## Usage examples
21+
22+
<!--- Provide examples of intended usage -->
23+
24+
## How Has This Been Tested?
25+
26+
<!--- Please describe in detail how you tested your changes. -->
27+
28+
## Checklist:
29+
30+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
31+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
32+
33+
- [ ] I have updated the documentation accordingly.
34+
- [ ] I have added tests to cover my changes.

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
# dependabot for GitHub Actions for this repo
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
# dependabot for GitHub Actions for the template
9+
- package-ecosystem: "github-actions"
10+
directory: "template/.github/"
11+
schedule:
12+
interval: "weekly"

.github/workflows/build.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
10+
jobs:
11+
script-test:
12+
env:
13+
ASDF_DOWNLOAD_PATH: /tmp/asdf-download
14+
ASDF_INSTALL_VERSION: 0.14.1
15+
ASDF_INSTALL_TYPE: version
16+
ASDF_INSTALL_PATH: /tmp/asdf-install
17+
strategy:
18+
matrix:
19+
os:
20+
- ubuntu-latest
21+
- macos-latest
22+
runs-on: ${{ matrix.os }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- run: |
26+
bin/download
27+
- run: |
28+
bin/install
29+
- run: |
30+
${ASDF_INSTALL_PATH}/bin/zls --version
31+
32+
plugin-test:
33+
strategy:
34+
matrix:
35+
os:
36+
- ubuntu-latest
37+
- macos-latest
38+
runs-on: ${{ matrix.os }}
39+
steps:
40+
- name: asdf_plugin_test
41+
uses: asdf-vm/actions/plugin-test@v3
42+
with:
43+
command: zls --version

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 ZigCC contributors
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.

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<div align="center">
2+
3+
# asdf-zls [![Build](https://github.com/zigcc/asdf-zls/actions/workflows/build.yml/badge.svg)](https://github.com/zigcc/asdf-zls/actions/workflows/build.yml)
4+
5+
[ZLS](https://zigtools.org/zls/install/) plugin for the [asdf version manager](https://asdf-vm.com).
6+
7+
</div>
8+
9+
# Dependencies
10+
11+
- `bash`, `python3`, `tar`, and [POSIX utilities](https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html).
12+
- asdf 0.16+
13+
14+
# Install
15+
16+
First add asdf-zls as plugin:
17+
18+
```shell
19+
asdf plugin add zls https://github.com/zigcc/asdf-zls.git
20+
```
21+
22+
Then use `asdf-zls` to install zls:
23+
24+
```shell
25+
# Show all installable versions
26+
asdf list all zls
27+
28+
# Install specific version
29+
asdf install zls 0.14.1
30+
31+
# Set a version globally (on your ~/.tool-versions file)
32+
asdf set --home zig 0.14.1
33+
34+
# Now zls commands are available
35+
zls --version
36+
```
37+
38+
Check [asdf](https://github.com/asdf-vm/asdf) readme for more instructions on how to
39+
install & manage versions.
40+
41+
# License
42+
43+
See [LICENSE](LICENSE) © [zigcc](https://github.com/zigcc/)

bin/download

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
current_script_path=${BASH_SOURCE[0]}
6+
plugin_dir=$(dirname "$(dirname "$current_script_path")")
7+
8+
download_zls() {
9+
local download_path="$1"
10+
local version="$2"
11+
local release_file="${download_path}/${version}.tar.xz"
12+
mkdir -p "$download_path"
13+
14+
"${plugin_dir}/lib/utils.py" download "${version}" "${release_file}"
15+
tar -xf "$release_file" -C "$download_path"
16+
rm "$release_file"
17+
}
18+
19+
20+
download_zls "$ASDF_DOWNLOAD_PATH" "$ASDF_INSTALL_VERSION"

bin/install

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
tool_name="zls"
6+
7+
install_version() {
8+
local install_type="$1"
9+
local version="$2"
10+
local install_path="$3"
11+
12+
if [ "$install_type" != "version" ]; then
13+
fail "asdf-zig supports release installs only"
14+
fi
15+
16+
(
17+
mkdir -p "$install_path"
18+
cp -r "$ASDF_DOWNLOAD_PATH"/* "$install_path"
19+
mkdir -p "$install_path/bin"
20+
mv "$install_path/$tool_name" "$install_path/bin/$tool_name"
21+
22+
if ! test -x "$install_path/bin/$tool_name"; then
23+
echo "Expected $install_path/bin/$tool_name to be executable."
24+
exit 1
25+
fi
26+
27+
echo "zls $version installation was successful!"
28+
) || (
29+
rm -rf "$install_path"
30+
fail "An error occurred while installing $TOOL_NAME $version."
31+
)
32+
}
33+
34+
install_version "$ASDF_INSTALL_TYPE" "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH"

bin/latest-stable

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
6+
"${SCRIPT_DIR}/../lib/utils.py" latest-version

0 commit comments

Comments
 (0)