Skip to content

Commit 7dec501

Browse files
charliie-devJint-lzxyayamirgithub-actions[bot]fioncat
authored
Sync with main (#1563)
* feat: use vim.env and vim.uv for env and cwd access (#1507) Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * fix: LSP start logic (#1504) * Revert "fix: remove manual `LspStart`, close #1478. (#1479)" This reverts commit 7dab4b9. * Revert "fixup(#1466): load lsp config with proper event. (#1472)" This reverts commit 53eeeec. * fix: LSP start logic This should acc fix #1472 and #1479 cuz iirc the root cause was that lspconfig changed how `LspStart` works. Now it only starts one _specific_ server (passed via the first argument), instead of starting all matching servers automatically. So we gotta manually start all the servers that match the current filetype instead. Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * fix: redundant return Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * fix: invoke `:LspStart` correctly Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * feat(mason)!: migrate to v2.x (#1502) * feat(mason)!: migrate to v2.x Just wrapped up going thru all the changes in mason 2.x (and nvim 0.11 too)! This should be a follow up to #1466 and (hopefully) fix all the issues related to the updated LSP API (like servers not spawning and other weirdness) and works together w #1496. Acc the main issue was that some mason package names don't match their names in lspconfig, so just using `lsp_deps` directly works for most, but breaks a bunch of others (tldr: that mismatch is what was causing all the edge cases and broken behavior). I also went ahead and enabled `automatic_installation` because why not lol means we don't have to manually call `vim.lsp.enable()` for everything, which might save a tiny bit of perf too. Didn't test this super thoroughly yet so pls lmk if anything's still broken! Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * fixup! feat(mason)!: migrate to v2.x * fixup! feat(mason)!: migrate to v2.x * fixup! feat(mason)!: migrate to v2.x * fix: LSP start logic (#1496) * Revert "fix: remove manual `LspStart`, close #1478. (#1479)" This reverts commit 7dab4b9. * Revert "fixup(#1466): load lsp config with proper event. (#1472)" This reverts commit 53eeeec. * fix: LSP start logic This should acc fix #1472 and #1479 cuz iirc the root cause was that lspconfig changed how `LspStart` works. Now it only starts one _specific_ server (passed via the first argument), instead of starting all matching servers automatically. So we gotta manually start all the servers that match the current filetype instead. Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * fix: unresolved nvim_lsp * feat(lsp): unify language server setup Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Co-authored-by: ayamir <lgt986452565@gmail.com> * chore(lockfile): auto update lazy-lock.json * refactor(tool): simplify fzf-lua usage and improve lazy loading (#1506) * refactor(tool): simplify fzf-lua usage and improve lazy loading Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * feat: minor optimizations Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * style: remove reduntant short circuit logic. --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Co-authored-by: ayamir <lgt986452565@gmail.com> * fix: avoid require nil. * chore(lockfile): auto update lazy-lock.json * fix(event): fix "Autojump to last edit" event (#1509) * chore(lockfile): auto update lazy-lock.json * chore(gh_act): update components (#1510) * chore(lockfile): auto update lazy-lock.json * fix: abnormal window behavior when use fzf (#1511) * chore(lockfile): auto update lazy-lock.json * fix(project_nvim): rename module name to project (#1514) * chore(lockfile): auto update lazy-lock.json * fix: adapt codecompanion newest api * chore(lockfile): auto update lazy-lock.json * fix: use realpath of vim related path (#1516) * chore(lockfile): auto update flake.lock * fix: only use realpath for vim_path (#1522) * chore(lockfile): auto update lazy-lock.json * fix: typos in comment and install message (#1525) * chore(lockfile): auto update lazy-lock.json * chore(lockfile): auto update flake.lock * fix: temporarily disable project.nvim 'lsp' attach mode (#1529) See [DrKJeff16/project.nvim#24](DrKJeff16/project.nvim#24) for details * chore(lockfile): auto update lazy-lock.json * fix(lspconfig): remove deprecated legacy framework of lspconfig (#1530) Co-authored-by: misumisumi <s.kobayashi@misumi-sumi.com> * fix(#1520): disable swapfile (#1531) * chore(lockfile): auto update lazy-lock.json * perf(ci): update ci config (#1534) * perf(ci): make bot commit verified and add `dependabot` for ci component autoupdate * chore(doc): update username from `CharlesChiuGit` to `charliie-dev` * chore(lockfile): auto update lazy-lock.json * fix(lockfile): update flake.lock to make ci works (#1535) * chore(ci): set schedule to every 2 week (#1536) * chore(lockfile): auto update lazy-lock.json * chore(lockfile): auto update flake.lock * fix(project): re-enable LSP detection (#1539) Signed-off-by: Guennadi Maximov C <g.maxc.fox@protonmail.com> * chore(lockfile): auto update lazy-lock.json * feat(python-lsp)!: replace the old pylsp with zuban and ruff (#1528) * chore(lockfile): auto update lazy-lock.json * chore(ci.deps): bump actions/checkout in the actions-dependencies group (#1542) Bumps the actions-dependencies group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 5 to 6 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(lockfile): auto update lazy-lock.json * chore: pin codecompanion in case breaking change temprarily (#1543) details: olimorris/codecompanion.nvim#2439 Co-authored-by: liuguangtian.1024 <liuguangtian.1024@bytedance.com> * chore(lockfile): auto update flake.lock * chore(lockfile): auto update lazy-lock.json * [migration] set nvim-treesitter to main branch, close #1541 (#1544) * feat!(plugins.editor): set `nvim-treesitter` and `nvim-treesitter-textobjects` branch to `main` * fix(lockfile): manually remove lockfile to make branch-changing effective * feat!(configs.editor): migrate `treesitter` and `ts-textobjects` config * feat!(keymap.editor): move `ts-textobjects`' keymap here --------- Signed-off-by: Charles Chiu <mail@charliie.dev> * chore(lockfile): auto update lazy-lock.json * fix(edgy): add nil check for toggleterm terminal (#1546) Fixes #1545 When toggleterm terminal has not been created yet, `require("toggleterm.terminal").get(1)` returns nil, causing an error when trying to access `term.direction`. This commit adds a nil check before accessing the direction property to prevent the error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * chore(lockfile): auto update lazy-lock.json * fix(treesitter): add autocmd for highlight and fix load plugin (#1547) Co-authored-by: misumisumi <s.kobayashi@misumi-sumi.com> * chore(lockfile): auto update lazy-lock.json * chore(lockfile): auto update flake.lock * chore(lockfile): auto update flake.lock * fix: using project's clang-format config first. (#1550) * fix: using project's clang-format config first. * fix: style lua ci/cd * chore(lockfile): auto update lazy-lock.json * chore(lockfile): auto update flake.lock * fix(ruff): use project config first (#1558) * Fix deprecated tree-sitter package and update codecompanion v18 (#1557) * fix(codecompanion): update to v18 * fix(settings): remove jsonc treesitter - jsonc is not available on upstream by nvim-treesitter/nvim-treesitter#8316 --------- Co-authored-by: misumisumi <s.kobayashi@misumi-sumi.com> * chore(lockfile): auto update lazy-lock.json * chore(tool.project): update `project.nvim` config (#1559) * chore(lockfile): auto update lazy-lock.json * chore(lockfile): auto update flake.lock * chore(lockfile): auto update flake.lock * chore(lockfile): auto update flake.lock * feat(keymap): add `<leader>dC` to close dapui. #1552 * chore(lockfile): auto update lazy-lock.json * chore(lockfile): auto update flake.lock * refactor: use telescope/fzf-lua to replace glance.nvim (#1519) * refactor: use telescope/fzf-lua to replace glance.nvim * fix(ci): lint code * refactor(ci): remove lint args * chore(lockfile): auto update lazy-lock.json * chore(lockfile): auto update flake.lock --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Signed-off-by: Guennadi Maximov C <g.maxc.fox@protonmail.com> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Charles Chiu <mail@charliie.dev> Co-authored-by: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Co-authored-by: ayamir <lgt986452565@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: wenqian <lazycat7706@gmail.com> Co-authored-by: Cloud <60375730+Cloud0310@users.noreply.github.com> Co-authored-by: MiSumiSumi <dragon511southern@gmail.com> Co-authored-by: misumisumi <s.kobayashi@misumi-sumi.com> Co-authored-by: Guennadi Maximov C <g.maxc.fox@protonmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: liuguangtian.1024 <liuguangtian.1024@bytedance.com> Co-authored-by: Zonghao Yuan <64521992+zonghaoyuan@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: ayamir <61657399+ayamir@users.noreply.github.com>
1 parent 51b0ef3 commit 7dec501

43 files changed

Lines changed: 890 additions & 716 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Please see the documentation for all configuration options:
2+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: "github-actions"
7+
#NOTE: no need to specify `/.github/workflows` for `directory`. use `directory: "/"`
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
time: "07:00"
12+
target-branch: "main"
13+
commit-message:
14+
prefix: "chore(ci.deps)"
15+
groups:
16+
actions-dependencies:
17+
patterns:
18+
- "*"
19+
labels:
20+
- "ci"

.github/workflows/lint_code.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
luacheck:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v4
8+
- uses: actions/checkout@v6
99
- uses: lunarmodules/luacheck@v1
1010
with:
11-
args: . --std luajit --max-line-length 150 --no-config --globals vim _debugging _command_panel _flash_esc_or_noh _telescope_collections _toggle_inlayhint _toggle_virtuallines _toggle_lazygit _select_chat_model
11+
args: . --std luajit --max-line-length 150 --no-config --globals vim _debugging

.github/workflows/style_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
stylua:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v4
8+
- uses: actions/checkout@v6
99
- uses: JohnnyMorganz/stylua-action@v4
1010
with:
1111
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/update_flake.yml

Lines changed: 89 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,100 @@
1-
name: update flake.lock
1+
---
2+
name: "Flake.lock: update Nix dependencies (Verified)"
23
on:
3-
# Scheduled update (1st of every month)
4-
schedule: [{ cron: "30 02 1 * *" }]
4+
schedule:
5+
- cron: 00 00 1,15 * * # At 00:00 on day-of-month 1 and 15
6+
7+
env:
8+
BRANCH: "main"
9+
COMMIT_MESSAGE: "chore(lockfile): auto update flake.lock"
510

611
jobs:
7-
update-lockfile:
12+
nix-flake-update:
813
if: github.repository_owner == 'ayamir'
9-
runs-on: ubuntu-latest
1014
permissions:
1115
contents: write
16+
id-token: write
17+
runs-on: ubuntu-latest
18+
1219
steps:
13-
- uses: actions/checkout@v4
14-
- uses: cachix/install-nix-action@v26
20+
- name: Checkout repository
21+
uses: actions/checkout@v6
22+
23+
- name: Install Nix
24+
uses: DeterminateSystems/determinate-nix-action@v3
25+
26+
- name: Check Nix flake inputs
27+
uses: DeterminateSystems/flake-checker-action@v12
1528
with:
16-
nix_path: nixpkgs=channel:nixos-unstable
17-
- name: Run flake-update
29+
ignore-missing-flake-lock: false
30+
fail-mode: true
31+
32+
- name: Update flake.lock
1833
run: |
1934
nix flake update
20-
- uses: stefanzweifel/git-auto-commit-action@v5
35+
36+
- name: Detect modified files
37+
id: diff
38+
shell: bash
39+
run: |
40+
set -euo pipefail
41+
# List modified (tracked) files relative to HEAD.
42+
# If you only want specific patterns, add a grep here (e.g., grep -E '(^|/)flake\.lock$').
43+
mapfile -t changed < <(git ls-files -m --full-name)
44+
45+
if [ "${#changed[@]}" -eq 0 ]; then
46+
echo "changed=false" >> "$GITHUB_OUTPUT"
47+
echo "changed_files=" >> "$GITHUB_OUTPUT"
48+
exit 0
49+
fi
50+
51+
# Join into a comma-separated string for downstream steps.
52+
IFS=',' read -r -a _ <<< ""
53+
changed_csv="$(printf "%s," "${changed[@]}")"
54+
changed_csv="${changed_csv%,}"
55+
56+
echo "Changed files:"
57+
printf ' - %s\n' "${changed[@]}"
58+
59+
echo "changed=true" >> "$GITHUB_OUTPUT"
60+
echo "changed_files=${changed_csv}" >> "$GITHUB_OUTPUT"
61+
62+
- name: Commit via REST Contents API (server-signed ??Verified)
63+
if: steps.diff.outputs.changed == 'true'
64+
uses: actions/github-script@v8
65+
env:
66+
CHANGED_FILES: ${{ steps.diff.outputs.changed_files }}
2167
with:
22-
commit_message: "chore(lockfile): auto update flake.lock"
23-
commit_user_name: "github-actions[bot]"
24-
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"
25-
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
26-
file_pattern: "flake.lock"
68+
script: |
69+
const fs = require('fs');
70+
const owner = context.repo.owner;
71+
const repo = context.repo.repo;
72+
const branch = process.env.BRANCH;
73+
const message = process.env.COMMIT_MESSAGE;
74+
75+
const files = (process.env.CHANGED_FILES || '')
76+
.split(',')
77+
.map(s => s.trim())
78+
.filter(Boolean);
79+
80+
for (const path of files) {
81+
const content = fs.readFileSync(path, { encoding: 'base64' });
82+
83+
// Get existing sha if the file already exists
84+
let sha;
85+
try {
86+
const res = await github.rest.repos.getContent({ owner, repo, path, ref: branch });
87+
if (!Array.isArray(res.data)) sha = res.data.sha;
88+
} catch (e) {
89+
if (e.status !== 404) throw e;
90+
}
91+
92+
// NOTE: author/committer intentionally omitted to allow platform signing
93+
const r = await github.rest.repos.createOrUpdateFileContents({
94+
owner, repo, path, branch,
95+
message,
96+
content,
97+
sha
98+
});
99+
core.info(`Committed ${path}: ${r.data.commit.sha}`);
100+
}
Lines changed: 94 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,117 @@
1-
name: update lockfile
1+
---
2+
name: "lazy-lock: update lazy.nvim dependencies (Verified)"
23
on:
3-
# Scheduled update (each day)
4-
schedule: [{ cron: "30 01 * * *" }]
4+
workflow_dispatch: # allows manual triggering
5+
schedule:
6+
# Scheduled update (each day)
7+
- cron: 30 01 * * *
8+
9+
env:
10+
BRANCH: "main"
11+
COMMIT_MESSAGE: "chore(lockfile): auto update lazy-lock.json"
512

613
jobs:
714
update-lockfile:
815
if: github.repository_owner == 'ayamir'
9-
runs-on: ubuntu-latest
1016
permissions:
1117
contents: write
18+
id-token: write
19+
runs-on: ubuntu-latest
20+
1221
steps:
13-
- uses: actions/checkout@v4
22+
- name: Checkout repository
23+
uses: actions/checkout@v6
1424
with:
1525
fetch-depth: 0 # Required to count the commits
16-
- uses: andstor/file-existence-action@v3
26+
27+
- name: Check if lockfile existed
28+
uses: andstor/file-existence-action@v3
1729
id: check_lockfile
1830
with:
1931
files: "lazy-lock.json"
32+
2033
- name: Run count-new-commits
34+
id: new-commits
2135
run: |
22-
echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' --perl-regexp --author='^((?!github-actions).*)$' | wc -l)" >> "$GITHUB_ENV"
23-
- uses: rhysd/action-setup-vim@v1
24-
if: ${{ steps.check_lockfile.outputs.files_exists == 'true' && env.NEW_COMMIT_COUNT > 0 }}
36+
echo "new_commit_count=$(git log --oneline --since '24 hours ago' --perl-regexp --author='^((?!github-actions).*)$' | wc -l)" >> "$GITHUB_OUTPUT"
37+
38+
- name: Setup neovim
39+
uses: rhysd/action-setup-vim@v1
40+
if: ${{ steps.check_lockfile.outputs.files_exists == 'true' && steps.new-commits.outputs.new_commit_count > 0 }}
2541
with:
2642
neovim: true
27-
- name: Run lockfile-autoupdate
28-
if: ${{ steps.check_lockfile.outputs.files_exists == 'true' && env.NEW_COMMIT_COUNT > 0 }}
43+
44+
- name: Run lazy update
45+
if: ${{ steps.check_lockfile.outputs.files_exists == 'true' && steps.new-commits.outputs.new_commit_count > 0 }}
2946
timeout-minutes: 5
3047
run: |
3148
./scripts/install.sh
3249
nvim --headless "+Lazy! update" +qa
3350
cp -pv "${HOME}/.config/nvim/lazy-lock.json" .
34-
- uses: stefanzweifel/git-auto-commit-action@v5
35-
if: ${{ steps.check_lockfile.outputs.files_exists == 'true' && env.NEW_COMMIT_COUNT > 0 }}
51+
52+
- name: Detect modified files
53+
if: ${{ steps.check_lockfile.outputs.files_exists == 'true' && steps.new-commits.outputs.new_commit_count > 0 }}
54+
id: diff
55+
shell: bash
56+
run: |
57+
set -euo pipefail
58+
# List modified (tracked) files relative to HEAD.
59+
# If you only want specific patterns, add a grep here (e.g., grep -E '(^|/)lazy-lock\.json$').
60+
mapfile -t changed < <(git ls-files -m --full-name)
61+
62+
if [ "${#changed[@]}" -eq 0 ]; then
63+
echo "changed=false" >> "$GITHUB_OUTPUT"
64+
echo "changed_files=" >> "$GITHUB_OUTPUT"
65+
exit 0
66+
fi
67+
68+
# Join into a comma-separated string for downstream steps.
69+
IFS=',' read -r -a _ <<< ""
70+
changed_csv="$(printf "%s," "${changed[@]}")"
71+
changed_csv="${changed_csv%,}"
72+
73+
echo "Changed files:"
74+
printf ' - %s\n' "${changed[@]}"
75+
76+
echo "changed=true" >> "$GITHUB_OUTPUT"
77+
echo "changed_files=${changed_csv}" >> "$GITHUB_OUTPUT"
78+
79+
- name: Commit via REST Contents API (server-signed ??Verified)
80+
if: ${{ steps.diff.outputs.changed == 'true' && steps.new-commits.outputs.new_commit_count > 0 }}
81+
uses: actions/github-script@v8
82+
env:
83+
CHANGED_FILES: ${{ steps.diff.outputs.changed_files }}
3684
with:
37-
commit_message: "chore(lockfile): auto update lazy-lock.json"
38-
commit_user_name: "github-actions[bot]"
39-
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"
40-
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
41-
file_pattern: "lazy-lock.json"
85+
script: |
86+
const fs = require('fs');
87+
const owner = context.repo.owner;
88+
const repo = context.repo.repo;
89+
const branch = process.env.BRANCH;
90+
const message = process.env.COMMIT_MESSAGE;
91+
92+
const files = (process.env.CHANGED_FILES || '')
93+
.split(',')
94+
.map(s => s.trim())
95+
.filter(Boolean);
96+
97+
for (const path of files) {
98+
const content = fs.readFileSync(path, { encoding: 'base64' });
99+
100+
// Get existing sha if the file already exists
101+
let sha;
102+
try {
103+
const res = await github.rest.repos.getContent({ owner, repo, path, ref: branch });
104+
if (!Array.isArray(res.data)) sha = res.data.sha;
105+
} catch (e) {
106+
if (e.status !== 404) throw e;
107+
}
108+
109+
// NOTE: author/committer intentionally omitted to allow platform signing
110+
const r = await github.rest.repos.createOrUpdateFileContents({
111+
owner, repo, path, branch,
112+
message,
113+
content,
114+
sha
115+
});
116+
core.info(`Committed ${path}: ${r.data.commit.sha}`);
117+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ It's strongly recommended to read [Wiki: Prerequisites](https://github.com/ayami
206206

207207
- [ayamir](https://github.com/ayamir)
208208
- [Jint-lzxy](https://github.com/Jint-lzxy)
209-
- [CharlesChiuGit](https://github.com/CharlesChiuGit)
209+
- [charliie-dev](https://github.com/charliie-dev)
210210
- [aarnphm](https://github.com/aarnphm)
211211
- [misumisumi](https://github.com/misumisumi)
212212

flake.lock

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)