From 498fabee4803a460b6bfb0264c5806addeafa65f Mon Sep 17 00:00:00 2001 From: pynappo Date: Fri, 19 Sep 2025 03:50:00 -0700 Subject: [PATCH 01/21] ci fixes --- .github/workflows/.luarc-5.1.json | 27 +++--- .github/workflows/.luarc-luajit-master.json | 28 +++--- .github/workflows/luals-check.yml | 17 ++-- .luarc.json | 24 ++--- Makefile | 5 +- .../sources/filesystem/lib/fs_scan.lua | 2 - lua/neo-tree/types/fixes/uv.lua | 28 +++--- mise.toml | 87 ++++++++++++++++++- release.sh | 2 +- .../neo-tree/command/command_current_spec.lua | 4 +- tests/neo-tree/command/command_spec.lua | 4 +- tests/utils/init.lua | 2 +- 12 files changed, 147 insertions(+), 83 deletions(-) diff --git a/.github/workflows/.luarc-5.1.json b/.github/workflows/.luarc-5.1.json index d3a9194a0..1fa962f4d 100644 --- a/.github/workflows/.luarc-5.1.json +++ b/.github/workflows/.luarc-5.1.json @@ -4,30 +4,25 @@ "libraryFiles": "Disable" }, "runtime": { - "version": "LuaJIT", - "path": [ - "lua/?.lua", - "lua/?/init.lua", - "library/?.lua", - "library/?/init.lua" - ] + "version": "Lua 5.1" }, "workspace": { "checkThirdParty": "Disable", "library": [ - "$PWD/.dependencies/pack/vendor/start/plenary.nvim", - "$PWD/.dependencies/pack/vendor/start/nui.nvim", - "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons", - "$PWD/.dependencies/pack/vendor/start/snacks.nvim", - "${3rd}/luassert", - "${3rd}/busted", - "${3rd}/luv", - "$VIMRUNTIME" + "$VIMRUNTIME/lua", + "$PWD/.dependencies/pack/vendor/start/plenary.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/nui.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua", + "$PWD/.dependencies/pack/vendor/start/image.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", + "${3rd}/luassert/library", + "${3rd}/busted/library" ], "ignoreDir": [ ".dependencies", ".luarocks", - ".lua" + ".lua", + ".repro" ] } } diff --git a/.github/workflows/.luarc-luajit-master.json b/.github/workflows/.luarc-luajit-master.json index d3a9194a0..846a28291 100644 --- a/.github/workflows/.luarc-luajit-master.json +++ b/.github/workflows/.luarc-luajit-master.json @@ -4,30 +4,26 @@ "libraryFiles": "Disable" }, "runtime": { - "version": "LuaJIT", - "path": [ - "lua/?.lua", - "lua/?/init.lua", - "library/?.lua", - "library/?/init.lua" - ] + "version": "LuaJIT" }, "workspace": { "checkThirdParty": "Disable", "library": [ - "$PWD/.dependencies/pack/vendor/start/plenary.nvim", - "$PWD/.dependencies/pack/vendor/start/nui.nvim", - "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons", - "$PWD/.dependencies/pack/vendor/start/snacks.nvim", - "${3rd}/luassert", - "${3rd}/busted", - "${3rd}/luv", - "$VIMRUNTIME" + "$VIMRUNTIME/lua", + "$PWD/.dependencies/pack/vendor/start/plenary.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/nui.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua", + "$PWD/.dependencies/pack/vendor/start/image.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", + "${3rd}/luassert/library", + "${3rd}/busted/library", + "${3rd}/luv/library" ], "ignoreDir": [ ".dependencies", ".luarocks", - ".lua" + ".lua", + ".repro" ] } } diff --git a/.github/workflows/luals-check.yml b/.github/workflows/luals-check.yml index ea521523c..d65dae179 100644 --- a/.github/workflows/luals-check.yml +++ b/.github/workflows/luals-check.yml @@ -21,24 +21,17 @@ jobs: with: luaVersion: ${{matrix.lua}} - - name: Install lua-language-server + - name: Install tools uses: jdx/mise-action@v2 with: - mise_toml: | - [tools] - neovim = "${{ matrix.neovim }}" - cargo-binstall = "latest" - "cargo:emmylua_check" = "latest" - "cargo:emmylua_ls" = "latest" - lua-language-server = "3.13.9" + install_args: "neovim" - name: Run lua-language-server check run: | - LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" - make luals-check CONFIGURATION="$LUARC" + mise use neovim + NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run luals-check - name: Run emmylua_check continue-on-error: true # Doesn't type-check well enough to be worth erroring on, but this runs so fast we might as well help test this out. run: | - LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" - make emmylua-check CONFIGURATION="$LUARC" + NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run emmylua-check diff --git a/.luarc.json b/.luarc.json index ebec32bf1..5bc3d922c 100644 --- a/.luarc.json +++ b/.luarc.json @@ -4,25 +4,19 @@ "libraryFiles": "Disable" }, "runtime": { - "version": "LuaJIT", - "path": [ - "lua/?.lua", - "lua/?/init.lua", - "library/?.lua", - "library/?/init.lua" - ] + "version": "LuaJIT" }, "workspace": { "checkThirdParty": "Disable", "library": [ - "$PWD/.dependencies/pack/vendor/start/plenary.nvim", - "$PWD/.dependencies/pack/vendor/start/nui.nvim", - "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons", - "$PWD/.dependencies/pack/vendor/start/snacks.nvim", - "${3rd}/luassert", - "${3rd}/busted", - "${3rd}/luv", - "$VIMRUNTIME" + "$VIMRUNTIME/lua", + "$PWD/.dependencies/pack/vendor/start/plenary.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/nui.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua", + "$PWD/.dependencies/pack/vendor/start/image.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", + "${3rd}/luassert/library", + "${3rd}/busted/library" ], "ignoreDir": [ ".dependencies", diff --git a/Makefile b/Makefile index 0dc509ab8..399b6a15b 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,10 @@ $(DEPS)/plenary.nvim: $(DEPS) $(DEPS)/snacks.nvim: $(DEPS) @test -d "$(DEPS)/snacks.nvim" || git clone https://github.com/folke/snacks.nvim "$(DEPS)/snacks.nvim" -setup: $(DEPS)/nui.nvim $(DEPS)/nvim-web-devicons $(DEPS)/plenary.nvim $(DEPS)/snacks.nvim +$(DEPS)/image.nvim: $(DEPS) + @test -d "$(DEPS)/image.nvim" || git clone https://github.com/3rd/image.nvim "$(DEPS)/image.nvim" + +setup: $(DEPS)/nui.nvim $(DEPS)/nvim-web-devicons $(DEPS)/plenary.nvim $(DEPS)/snacks.nvim $(DEPS)/image.nvim @echo "[setup] environment ready" .PHONY: clean diff --git a/lua/neo-tree/sources/filesystem/lib/fs_scan.lua b/lua/neo-tree/sources/filesystem/lib/fs_scan.lua index ae4c20d14..30cf9a775 100644 --- a/lua/neo-tree/sources/filesystem/lib/fs_scan.lua +++ b/lua/neo-tree/sources/filesystem/lib/fs_scan.lua @@ -201,8 +201,6 @@ local function get_children_async(path, callback) return end local readdir_batch - ---@param _ string? - ---@param stats uv.fs_readdir.entry[] readdir_batch = function(_, stats) if stats then local more = false diff --git a/lua/neo-tree/types/fixes/uv.lua b/lua/neo-tree/types/fixes/uv.lua index 0b209fa99..bf6744998 100644 --- a/lua/neo-tree/types/fixes/uv.lua +++ b/lua/neo-tree/types/fixes/uv.lua @@ -9,17 +9,17 @@ local uv = {} --- `uv.fs_readdir()`. The `entries` parameter defines the maximum number of entries --- that should be returned by each call to `uv.fs_readdir()`. --- @param path string ---- @param entries integer? ---- @return uv.luv_dir_t? dir ---- @return string? err ---- @return string? err_name ---- @overload fun(path: string, callback: fun(err: string?, dir: uv.luv_dir_t?), entries: integer?): uv.uv_fs_t -function uv.fs_opendir(path, entries) end - ---- Equivalent to `lstat(2)`. ---- @param path string ---- @return uv.fs_stat.result? stat ---- @return string? err ---- @return string? err_name ---- @overload fun(path: string, callback: fun(err: string?, stat: uv.fs_stat.result?)): uv.uv_fs_t -function uv.fs_lstat(path) end +--- +--- **Returns (sync version):** `luv_dir_t userdata` or `fail` +--- +--- **Returns (async version):** `uv_fs_t userdata` +--- +---@param path string +---@param callback nil +---@param entries integer? +---@return uv.luv_dir_t|nil dir +---@return uv.error.message|nil err +---@return uv.error.name|nil err_name +--- +---@overload fun(path: string, callback: uv.fs_opendir.callback, entries?: integer):uv.uv_fs_t +function uv.fs_opendir(path, callback, entries) end diff --git a/mise.toml b/mise.toml index 4e8b2ba14..b77c62f72 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,86 @@ [tools] -cargo-binstall = "latest" -"cargo:emmylua_check" = "latest" -"cargo:emmylua_ls" = "latest" lua-language-server = "latest" + +[tasks.test] +run = """ +#!/usr/bin/env bash +nvim --headless --noplugin -u tests/mininit.lua -c "lua require('plenary.test_harness').test_directory('tests/neo-tree/', {minimal_init='tests/mininit.lua',sequential=true})" +""" + +[tasks.test-docker] +run = [ + "docker build -t neo-tree .", + "docker run --rm neo-tree mise test" +] +hide = true # hide this task from the list + +[tasks.format] +run = "stylua --glob '*.lua' --glob '!defaults.lua' ." + +[vars] +deps_dir = '.dependencies/pack/vendor/start' + +[env] +NEOTREE_LUARC = ".luarc.json" + +[tasks.update-dependencies] +alias = 'deps' +run = """ +#!/usr/bin/env bash +update() { + local git_url="$1" + local repo_name="$2" + + mkdir -p "{{vars.deps_dir}}" + + local target_dir="{{vars.deps_dir}}/$repo_name" + if [ -d "$target_dir" ]; then + echo "==> Directory '$target_dir' exists. Updating $repo_name..." + git -C $target_dir fetch --tags -f + git -C $target_dir pull + + # Check the exit code of the subshell command + if [ $? -ne 0 ]; then + echo "Error: Failed to pull updates for '$repo_name'." >&2 + return 1 + fi + echo "==> Successfully updated '$repo_name'." + + else + echo "==> Directory '$target_dir' not found. Cloning repository..." + git clone "$git_url" "$target_dir" + + if [ $? -ne 0 ]; then + echo "Error: Failed to clone '$git_url'." >&2 + return 1 + fi + echo "==> Successfully cloned '$repo_name'." + fi +} +update https://github.com/3rd/image.nvim image.nvim +update https://github.com/folke/snacks.nvim snacks.nvim +update https://github.com/MunifTanjim/nui.nvim nui.nvim +update https://github.com/nvim-tree/nvim-web-devicons nvim-web-devicons +update https://github.com/nvim-lua/plenary.nvim plenary.nvim +""" + +[tasks.luals-check] +run = """ +#!/usr/bin/env bash +VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit') +VIMRUNTIME="${VIMRUNTIME_PATH}" lua-language-server --configpath=$NEOTREE_LUARC --check=. +""" +depends = ['deps'] + +[tasks.emmylua-check] +run = """ +#!/usr/bin/env bash +VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit') +VIMRUNTIME="${VIMRUNTIME_PATH}" emmylua_check -c $NEOTREE_LUARC -i ".dependencies/**" -- . +""" +depends = ['deps'] + +[tasks.clean] +run = [ + "rm {{vars.deps_dir}} -rf" +] diff --git a/release.sh b/release.sh index 2053009cf..4ca9fce76 100755 --- a/release.sh +++ b/release.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash REPO="nvim-neo-tree/neo-tree.nvim" LAST_VERSION=$(curl --silent "https://api.github.com/repos/$REPO/releases/latest" | jq -r .tag_name) echo "LAST_VERSION=$LAST_VERSION" diff --git a/tests/neo-tree/command/command_current_spec.lua b/tests/neo-tree/command/command_current_spec.lua index e53298864..7b7410e0c 100644 --- a/tests/neo-tree/command/command_current_spec.lua +++ b/tests/neo-tree/command/command_current_spec.lua @@ -17,7 +17,9 @@ end local run_close_command = function(command) vim.cmd(command) - u.wait_for(function() end, { interval = 200, timeout = 200 }) + u.wait_for(function() + return false + end, { interval = 200, timeout = 200 }) end describe("Command", function() diff --git a/tests/neo-tree/command/command_spec.lua b/tests/neo-tree/command/command_spec.lua index 2fad4899f..e4a1fa622 100644 --- a/tests/neo-tree/command/command_spec.lua +++ b/tests/neo-tree/command/command_spec.lua @@ -40,7 +40,9 @@ end local run_close_command = function(command) vim.cmd(command) - u.wait_for(function() end, { interval = 200, timeout = 200 }) + u.wait_for(function() + return false + end, { interval = 200, timeout = 200 }) end describe("Command", function() diff --git a/tests/utils/init.lua b/tests/utils/init.lua index b0cb24bb8..aadbf7d2c 100644 --- a/tests/utils/init.lua +++ b/tests/utils/init.lua @@ -174,7 +174,7 @@ function mod.assert_highlight(bufnr, ns_id, linenr, text, hl_group) mod.assert_extmark(extmarks[1], linenr, text, hl_group) end ----@param callback fun(): boolean +---@param callback fun():boolean ---@param options? { interval?: integer, timeout?: integer } function mod.wait_for(callback, options) options = options or {} From 524e7c00b856b853b8cd1f04ce644e587e1bc719 Mon Sep 17 00:00:00 2001 From: pynappo Date: Sat, 20 Sep 2025 18:19:15 -0700 Subject: [PATCH 02/21] Remove makefile --- Makefile | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 399b6a15b..000000000 --- a/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -.PHONY: test -test: - nvim --headless --noplugin -u tests/mininit.lua -c "lua require('plenary.test_harness').test_directory('tests/neo-tree/', {minimal_init='tests/mininit.lua', sequential=true})" - -.PHONY: test-docker -test-docker: - docker build -t neo-tree . - docker run --rm neo-tree make test - -.PHONY: format -format: - stylua --glob '*.lua' --glob '!defaults.lua' . - -# Dependencies: - -DEPS := ${CURDIR}/.dependencies/pack/vendor/start - -$(DEPS): - mkdir -p "$(DEPS)" - -$(DEPS)/nui.nvim: $(DEPS) - @test -d "$(DEPS)/nui.nvim" || git clone https://github.com/MunifTanjim/nui.nvim "$(DEPS)/nui.nvim" - -$(DEPS)/nvim-web-devicons: $(DEPS) - @test -d "$(DEPS)/nvim-web-devicons" || git clone https://github.com/nvim-tree/nvim-web-devicons "$(DEPS)/nvim-web-devicons" - -$(DEPS)/plenary.nvim: $(DEPS) - @test -d "$(DEPS)/plenary.nvim" || git clone https://github.com/nvim-lua/plenary.nvim "$(DEPS)/plenary.nvim" - -$(DEPS)/snacks.nvim: $(DEPS) - @test -d "$(DEPS)/snacks.nvim" || git clone https://github.com/folke/snacks.nvim "$(DEPS)/snacks.nvim" - -$(DEPS)/image.nvim: $(DEPS) - @test -d "$(DEPS)/image.nvim" || git clone https://github.com/3rd/image.nvim "$(DEPS)/image.nvim" - -setup: $(DEPS)/nui.nvim $(DEPS)/nvim-web-devicons $(DEPS)/plenary.nvim $(DEPS)/snacks.nvim $(DEPS)/image.nvim - @echo "[setup] environment ready" - -.PHONY: clean -clean: - rm -rf "$(DEPS)" - -CONFIGURATION = ${CURDIR}/.luarc.json -luals-check: setup - VIMRUNTIME="`nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit'`" lua-language-server --configpath=$(CONFIGURATION) --check=. - -emmylua-check: setup - VIMRUNTIME="`nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit'`" emmylua_check -c $(CONFIGURATION) -i ".dependencies/**" -- . From c91a23514194a18e5385304617cea60a249456c9 Mon Sep 17 00:00:00 2001 From: pynappo Date: Mon, 22 Sep 2025 14:15:15 -0700 Subject: [PATCH 03/21] update actions --- .github/workflows/.luarc-5.1.json | 1 + .github/workflows/.luarc-luajit-master.json | 4 +-- .github/workflows/ci.yml | 23 ++++++++------- .github/workflows/emmylua-check.yml | 31 +++++++++++++++++++++ .github/workflows/luals-check.yml | 5 ---- .luarc.json | 1 + mise.toml | 13 +++++---- tests/.luarc.json | 0 8 files changed, 54 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/emmylua-check.yml create mode 100644 tests/.luarc.json diff --git a/.github/workflows/.luarc-5.1.json b/.github/workflows/.luarc-5.1.json index 1fa962f4d..4dbe19919 100644 --- a/.github/workflows/.luarc-5.1.json +++ b/.github/workflows/.luarc-5.1.json @@ -15,6 +15,7 @@ "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua", "$PWD/.dependencies/pack/vendor/start/image.nvim/lua", "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/nvim-window-picker/lua", "${3rd}/luassert/library", "${3rd}/busted/library" ], diff --git a/.github/workflows/.luarc-luajit-master.json b/.github/workflows/.luarc-luajit-master.json index 846a28291..416136645 100644 --- a/.github/workflows/.luarc-luajit-master.json +++ b/.github/workflows/.luarc-luajit-master.json @@ -15,9 +15,9 @@ "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua", "$PWD/.dependencies/pack/vendor/start/image.nvim/lua", "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/nvim-window-picker/lua", "${3rd}/luassert/library", - "${3rd}/busted/library", - "${3rd}/luv/library" + "${3rd}/busted/library" ], "ignoreDir": [ ".dependencies", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 237ae7336..ec25ad54b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,7 @@ name: CI on: push: branches: - - main - - v1.x - - v2.x - - v3.x + - "*" pull_request: workflow_dispatch: @@ -27,21 +24,23 @@ jobs: strategy: fail-fast: false matrix: - rev: ["0.8", "0.9", "0.10", "0.11"] + neovim: ["0.8", "0.9", "0.10", "0.11"] os: [ubuntu-22.04] include: - - rev: "latest" + - neovim: "latest" os: [windows-latest] steps: - uses: actions/checkout@v4 - - uses: jdx/mise-action@v2 + - name: "Install neovim and other deps" + uses: jdx/mise-action@v2 with: install: true # [default: true] run `mise install` - install_args: "neovim@${{matrix.rev}}" # [default: ""] additional arguments to `mise install` - - run: | - mise use neovim@${{matrix.rev}} - make setup - make test + install_args: "neovim@${{matrix.neovim}}" # [default: ""] additional arguments to `mise install` + - name: "Run tests" + run: | + mise use neovim@${{matrix.neovim}} + mise deps + mise test # - name: Upload coverage to Codecov # uses: codecov/codecov-action@v2 diff --git a/.github/workflows/emmylua-check.yml b/.github/workflows/emmylua-check.yml new file mode 100644 index 000000000..d15b11c2c --- /dev/null +++ b/.github/workflows/emmylua-check.yml @@ -0,0 +1,31 @@ +name: Lua Language Server Diagnostics +on: + pull_request: ~ + push: + branches: + - '*' + +jobs: + luals-check: + strategy: + matrix: + lua: ["5.1", "luajit-master"] + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: luarocks/gh-actions-lua@v10 + with: + luaVersion: ${{matrix.lua}} + + - name: Install tools + uses: jdx/mise-action@v2 + with: + install_args: "neovim" + + - name: Run lua-language-server check + run: | + mise use neovim + NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run emmylua-check diff --git a/.github/workflows/luals-check.yml b/.github/workflows/luals-check.yml index d65dae179..339b01208 100644 --- a/.github/workflows/luals-check.yml +++ b/.github/workflows/luals-check.yml @@ -30,8 +30,3 @@ jobs: run: | mise use neovim NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run luals-check - - - name: Run emmylua_check - continue-on-error: true # Doesn't type-check well enough to be worth erroring on, but this runs so fast we might as well help test this out. - run: | - NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run emmylua-check diff --git a/.luarc.json b/.luarc.json index 5bc3d922c..416136645 100644 --- a/.luarc.json +++ b/.luarc.json @@ -15,6 +15,7 @@ "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua", "$PWD/.dependencies/pack/vendor/start/image.nvim/lua", "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", + "$PWD/.dependencies/pack/vendor/start/nvim-window-picker/lua", "${3rd}/luassert/library", "${3rd}/busted/library" ], diff --git a/mise.toml b/mise.toml index b77c62f72..d04095ecb 100644 --- a/mise.toml +++ b/mise.toml @@ -1,10 +1,16 @@ +[env] +NEOTREE_LUARC = ".luarc.json" + [tools] lua-language-server = "latest" +cargo-binstall = "latest" +"cargo:emmylua_ls" = "latest" +"cargo:emmylua_check" = "latest" [tasks.test] run = """ #!/usr/bin/env bash -nvim --headless --noplugin -u tests/mininit.lua -c "lua require('plenary.test_harness').test_directory('tests/neo-tree/', {minimal_init='tests/mininit.lua',sequential=true})" +nvim --headless --noplugin -u tests/mininit.lua -c "lua require('plenary.test_harness').test_directory('tests/neo-tree/', {minimal_init='tests/mininit.lua'})" """ [tasks.test-docker] @@ -12,7 +18,6 @@ run = [ "docker build -t neo-tree .", "docker run --rm neo-tree mise test" ] -hide = true # hide this task from the list [tasks.format] run = "stylua --glob '*.lua' --glob '!defaults.lua' ." @@ -20,9 +25,6 @@ run = "stylua --glob '*.lua' --glob '!defaults.lua' ." [vars] deps_dir = '.dependencies/pack/vendor/start' -[env] -NEOTREE_LUARC = ".luarc.json" - [tasks.update-dependencies] alias = 'deps' run = """ @@ -62,6 +64,7 @@ update https://github.com/folke/snacks.nvim snacks.nvim update https://github.com/MunifTanjim/nui.nvim nui.nvim update https://github.com/nvim-tree/nvim-web-devicons nvim-web-devicons update https://github.com/nvim-lua/plenary.nvim plenary.nvim +update https://github.com/s1n7ax/nvim-window-picker nvim-window-picker """ [tasks.luals-check] diff --git a/tests/.luarc.json b/tests/.luarc.json new file mode 100644 index 000000000..e69de29bb From 00dfd560a5d5306059c6192697142bde2f0d2d54 Mon Sep 17 00:00:00 2001 From: pynappo Date: Mon, 22 Sep 2025 15:07:00 -0700 Subject: [PATCH 04/21] update uv fixes --- .luarc.json | 6 ++- lua/neo-tree/types/fixes/uv.lua | 88 +++++++++++++++++++++++++++------ 2 files changed, 79 insertions(+), 15 deletions(-) diff --git a/.luarc.json b/.luarc.json index 416136645..a197b0484 100644 --- a/.luarc.json +++ b/.luarc.json @@ -4,7 +4,11 @@ "libraryFiles": "Disable" }, "runtime": { - "version": "LuaJIT" + "version": "LuaJIT", + "path": [ + "?.lua", + "?/init.lua" + ] }, "workspace": { "checkThirdParty": "Disable", diff --git a/lua/neo-tree/types/fixes/uv.lua b/lua/neo-tree/types/fixes/uv.lua index bf6744998..e2e422c84 100644 --- a/lua/neo-tree/types/fixes/uv.lua +++ b/lua/neo-tree/types/fixes/uv.lua @@ -2,24 +2,84 @@ ---A series of edited backports from neovim's 0.12 type files since lua-ls has incorrect types. ---@class uv ----@field constants {O_RDONLY: integer, O_WRONLY: integer, O_RDWR: integer, O_APPEND: integer, O_CREAT: integer, O_DSYNC: integer, O_EXCL: integer, O_NOCTTY: integer, O_NONBLOCK: integer, O_RSYNC: integer, O_SYNC: integer, O_TRUNC: integer, SOCK_STREAM: integer, SOCK_DGRAM: integer, SOCK_SEQPACKET: integer, SOCK_RAW: integer, SOCK_RDM: integer, AF_UNIX: integer, AF_INET: integer, AF_INET6: integer, AF_IPX: integer, AF_NETLINK: integer, AF_X25: integer, AF_AX25: integer, AF_ATMPVC: integer, AF_APPLETALK: integer, AF_PACKET: integer, AI_ADDRCONFIG: integer, AI_V4MAPPED: integer, AI_ALL: integer, AI_NUMERICHOST: integer, AI_PASSIVE: integer, AI_NUMERICSERV: integer, SIGHUP: integer, SIGINT: integer, SIGQUIT: integer, SIGILL: integer, SIGTRAP: integer, SIGABRT: integer, SIGIOT: integer, SIGBUS: integer, SIGFPE: integer, SIGKILL: integer, SIGUSR1: integer, SIGSEGV: integer, SIGUSR2: integer, SIGPIPE: integer, SIGALRM: integer, SIGTERM: integer, SIGCHLD: integer, SIGSTKFLT: integer, SIGCONT: integer, SIGSTOP: integer, SIGTSTP: integer, SIGTTIN: integer, SIGWINCH: integer, SIGIO: integer, SIGPOLL: integer, SIGXFSZ: integer, SIGVTALRM: integer, SIGPROF: integer, UDP_RECVMMSG: integer, UDP_MMSG_CHUNK: integer, UDP_REUSEADDR: integer, UDP_PARTIAL: integer, UDP_IPV6ONLY: integer, TCP_IPV6ONLY: integer, UDP_MMSG_FREE: integer, SIGSYS: integer, SIGPWR: integer, SIGTTOU: integer, SIGURG: integer, SIGXCPU: integer} local uv = {} +uv.constants = {} + +--- # Address Families +uv.constants.AF_UNIX = "unix" +uv.constants.AF_INET = "inet" +uv.constants.AF_INET6 = "inet6" +uv.constants.AF_IPX = "ipx" +uv.constants.AF_NETLINK = "netlink" +uv.constants.AF_X25 = "x25" +uv.constants.AF_AX25 = "as25" +uv.constants.AF_ATMPVC = "atmpvc" +uv.constants.AF_APPLETALK = "appletalk" +uv.constants.AF_PACKET = "packet" + +--- # Signals +uv.constants.SIGHUP = "sighup" +uv.constants.SIGINT = "sigint" +uv.constants.SIGQUIT = "sigquit" +uv.constants.SIGILL = "sigill" +uv.constants.SIGTRAP = "sigtrap" +uv.constants.SIGABRT = "sigabrt" +uv.constants.SIGIOT = "sigiot" +uv.constants.SIGBUS = "sigbus" +uv.constants.SIGFPE = "sigfpe" +uv.constants.SIGKILL = "sigkill" +uv.constants.SIGUSR1 = "sigusr1" +uv.constants.SIGSEGV = "sigsegv" +uv.constants.SIGUSR2 = "sigusr2" +uv.constants.SIGPIPE = "sigpipe" +uv.constants.SIGALRM = "sigalrm" +uv.constants.SIGTERM = "sigterm" +uv.constants.SIGCHLD = "sigchld" +uv.constants.SIGSTKFLT = "sigstkflt" +uv.constants.SIGCONT = "sigcont" +uv.constants.SIGSTOP = "sigstop" +uv.constants.SIGTSTP = "sigtstp" +uv.constants.SIGBREAK = "sigbreak" +uv.constants.SIGTTIN = "sigttin" +uv.constants.SIGTTOU = "sigttou" +uv.constants.SIGURG = "sigurg" +uv.constants.SIGXCPU = "sigxcpu" +uv.constants.SIGXFSZ = "sigxfsz" +uv.constants.SIGVTALRM = "sigvtalrm" +uv.constants.SIGPROF = "sigprof" +uv.constants.SIGWINCH = "sigwinch" +uv.constants.SIGIO = "sigio" +uv.constants.SIGPOLL = "sigpoll" +uv.constants.SIGLOST = "siglost" +uv.constants.SIGPWR = "sigpwr" +uv.constants.SIGSYS = "sigsys" + +--- # Socket Types +uv.constants.SOCK_STREAM = "stream" +uv.constants.SOCK_DGRAM = "dgram" +uv.constants.SOCK_SEQPACKET = "seqpacket" +uv.constants.SOCK_RAW = "raw" +uv.constants.SOCK_RDM = "rdm" + +--- # TTY Modes +uv.constants.TTY_MODE_NORMAL = "normal" +uv.constants.TTY_MODE_RAW = "raw" +uv.constants.TTY_MODE_IO = "io" +uv.constants.TTY_MODE_RAW_VT = "raw_vt" + +--- # FS Modification Times +uv.constants.FS_UTIME_NOW = "now" +uv.constants.FS_UTIME_OMIT = "omit" + --- Opens path as a directory stream. Returns a handle that the user can pass to --- `uv.fs_readdir()`. The `entries` parameter defines the maximum number of entries --- that should be returned by each call to `uv.fs_readdir()`. --- @param path string ---- ---- **Returns (sync version):** `luv_dir_t userdata` or `fail` ---- ---- **Returns (async version):** `uv_fs_t userdata` ---- ----@param path string ----@param callback nil ----@param entries integer? ----@return uv.luv_dir_t|nil dir ----@return uv.error.message|nil err ----@return uv.error.name|nil err_name ---- ----@overload fun(path: string, callback: uv.fs_opendir.callback, entries?: integer):uv.uv_fs_t +--- @param callback nil (async if provided, sync if `nil`) +--- @param entries integer? +--- @return uv.luv_dir_t? dir +--- @return string? err +--- @return uv.error_name? err_name +--- @overload fun(path: string, callback: fun(err: string?, dir: uv.luv_dir_t?), entries: integer?): uv.uv_fs_t function uv.fs_opendir(path, callback, entries) end From 9d97e6da5fc3f6801cd7efea8e556e52dd9806f8 Mon Sep 17 00:00:00 2001 From: pynappo Date: Mon, 22 Sep 2025 15:16:49 -0700 Subject: [PATCH 05/21] fix window picker type err --- lua/neo-tree/sources/common/commands.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/neo-tree/sources/common/commands.lua b/lua/neo-tree/sources/common/commands.lua index 0e5671101..f3b0c86ea 100644 --- a/lua/neo-tree/sources/common/commands.lua +++ b/lua/neo-tree/sources/common/commands.lua @@ -968,7 +968,7 @@ local use_window_picker = function(state, path, cmd) events.fire_event(events.FILE_OPENED, path) return end - local picked_window_id = picker.pick_window() + local picked_window_id = picker.pick_window({}) if picked_window_id then vim.api.nvim_set_current_win(picked_window_id) ---@diagnostic disable-next-line: param-type-mismatch From 2fd955fd21e530cabf6883e1a4a2699539374b3e Mon Sep 17 00:00:00 2001 From: pynappo Date: Mon, 22 Sep 2025 18:32:44 -0700 Subject: [PATCH 06/21] add luv for ci --- .github/workflows/.luarc-5.1.json | 3 ++- .github/workflows/.luarc-luajit-master.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/.luarc-5.1.json b/.github/workflows/.luarc-5.1.json index 4dbe19919..7b48103c2 100644 --- a/.github/workflows/.luarc-5.1.json +++ b/.github/workflows/.luarc-5.1.json @@ -17,7 +17,8 @@ "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", "$PWD/.dependencies/pack/vendor/start/nvim-window-picker/lua", "${3rd}/luassert/library", - "${3rd}/busted/library" + "${3rd}/busted/library", + "${3rd}/luv/library" ], "ignoreDir": [ ".dependencies", diff --git a/.github/workflows/.luarc-luajit-master.json b/.github/workflows/.luarc-luajit-master.json index 416136645..e7d20ac06 100644 --- a/.github/workflows/.luarc-luajit-master.json +++ b/.github/workflows/.luarc-luajit-master.json @@ -17,7 +17,8 @@ "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", "$PWD/.dependencies/pack/vendor/start/nvim-window-picker/lua", "${3rd}/luassert/library", - "${3rd}/busted/library" + "${3rd}/busted/library", + "${3rd}/luv/library" ], "ignoreDir": [ ".dependencies", From 26dff2c0a6fb9e133e053a518ae7d7067caf19b0 Mon Sep 17 00:00:00 2001 From: pynappo Date: Mon, 22 Sep 2025 18:37:53 -0700 Subject: [PATCH 07/21] switch neovim to nightly for ci --- .github/workflows/.luarc-5.1.json | 3 +-- .github/workflows/.luarc-luajit-master.json | 3 +-- .github/workflows/emmylua-check.yml | 2 +- .github/workflows/luals-check.yml | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/.luarc-5.1.json b/.github/workflows/.luarc-5.1.json index 7b48103c2..4dbe19919 100644 --- a/.github/workflows/.luarc-5.1.json +++ b/.github/workflows/.luarc-5.1.json @@ -17,8 +17,7 @@ "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", "$PWD/.dependencies/pack/vendor/start/nvim-window-picker/lua", "${3rd}/luassert/library", - "${3rd}/busted/library", - "${3rd}/luv/library" + "${3rd}/busted/library" ], "ignoreDir": [ ".dependencies", diff --git a/.github/workflows/.luarc-luajit-master.json b/.github/workflows/.luarc-luajit-master.json index e7d20ac06..416136645 100644 --- a/.github/workflows/.luarc-luajit-master.json +++ b/.github/workflows/.luarc-luajit-master.json @@ -17,8 +17,7 @@ "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", "$PWD/.dependencies/pack/vendor/start/nvim-window-picker/lua", "${3rd}/luassert/library", - "${3rd}/busted/library", - "${3rd}/luv/library" + "${3rd}/busted/library" ], "ignoreDir": [ ".dependencies", diff --git a/.github/workflows/emmylua-check.yml b/.github/workflows/emmylua-check.yml index d15b11c2c..ed9439dea 100644 --- a/.github/workflows/emmylua-check.yml +++ b/.github/workflows/emmylua-check.yml @@ -23,7 +23,7 @@ jobs: - name: Install tools uses: jdx/mise-action@v2 with: - install_args: "neovim" + install_args: "github:neovim/neovim@nightly" - name: Run lua-language-server check run: | diff --git a/.github/workflows/luals-check.yml b/.github/workflows/luals-check.yml index 339b01208..4299d9df5 100644 --- a/.github/workflows/luals-check.yml +++ b/.github/workflows/luals-check.yml @@ -24,7 +24,7 @@ jobs: - name: Install tools uses: jdx/mise-action@v2 with: - install_args: "neovim" + install_args: "github:neovim/neovim@nightly" - name: Run lua-language-server check run: | From b91e7b872bc0bf46b5b857eede9561fe3a0f1ac2 Mon Sep 17 00:00:00 2001 From: pynappo Date: Mon, 22 Sep 2025 18:42:48 -0700 Subject: [PATCH 08/21] fix nvim used --- .github/workflows/emmylua-check.yml | 5 ++++- .github/workflows/luals-check.yml | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/emmylua-check.yml b/.github/workflows/emmylua-check.yml index ed9439dea..9381462f9 100644 --- a/.github/workflows/emmylua-check.yml +++ b/.github/workflows/emmylua-check.yml @@ -24,8 +24,11 @@ jobs: uses: jdx/mise-action@v2 with: install_args: "github:neovim/neovim@nightly" + mise_toml: | + [tools] + lua-language-server = "latest" - name: Run lua-language-server check run: | - mise use neovim + mise use github:neovim/neovim@nightly NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run emmylua-check diff --git a/.github/workflows/luals-check.yml b/.github/workflows/luals-check.yml index 4299d9df5..0642e168a 100644 --- a/.github/workflows/luals-check.yml +++ b/.github/workflows/luals-check.yml @@ -25,8 +25,13 @@ jobs: uses: jdx/mise-action@v2 with: install_args: "github:neovim/neovim@nightly" + mise_toml: | + [tools] + cargo-binstall = "latest" + "cargo:emmylua_ls" = "latest" + "cargo:emmylua_check" = "latest" - name: Run lua-language-server check run: | - mise use neovim + mise use github:neovim/neovim@nightly NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run luals-check From c1d0cccdf2300e222ff04ae571593c4e0d646e86 Mon Sep 17 00:00:00 2001 From: pynappo Date: Mon, 22 Sep 2025 18:46:53 -0700 Subject: [PATCH 09/21] fix tool installs --- .github/workflows/emmylua-check.yml | 9 +++++---- .github/workflows/luals-check.yml | 8 +++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/emmylua-check.yml b/.github/workflows/emmylua-check.yml index 9381462f9..e7fbcfbc3 100644 --- a/.github/workflows/emmylua-check.yml +++ b/.github/workflows/emmylua-check.yml @@ -5,6 +5,9 @@ on: branches: - '*' +env: + MISE_AUTO_INSTALL_DISABLE_TOOLS: lua-language-server + jobs: luals-check: strategy: @@ -24,11 +27,9 @@ jobs: uses: jdx/mise-action@v2 with: install_args: "github:neovim/neovim@nightly" - mise_toml: | - [tools] - lua-language-server = "latest" - - name: Run lua-language-server check + - name: Run emmylua_check + continue-on-error: true run: | mise use github:neovim/neovim@nightly NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run emmylua-check diff --git a/.github/workflows/luals-check.yml b/.github/workflows/luals-check.yml index 0642e168a..ac424b54c 100644 --- a/.github/workflows/luals-check.yml +++ b/.github/workflows/luals-check.yml @@ -5,6 +5,9 @@ on: branches: - '*' +env: + MISE_AUTO_INSTALL_DISABLE_TOOLS: cargo-binstall,cargo:emmylua_ls,cargo:emmylua_check + jobs: luals-check: strategy: @@ -25,11 +28,6 @@ jobs: uses: jdx/mise-action@v2 with: install_args: "github:neovim/neovim@nightly" - mise_toml: | - [tools] - cargo-binstall = "latest" - "cargo:emmylua_ls" = "latest" - "cargo:emmylua_check" = "latest" - name: Run lua-language-server check run: | From fdd23d54ea8de1c1e8051e9feec49173b3b7322c Mon Sep 17 00:00:00 2001 From: pynappo Date: Mon, 22 Sep 2025 18:54:36 -0700 Subject: [PATCH 10/21] rename --- .github/workflows/emmylua-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/emmylua-check.yml b/.github/workflows/emmylua-check.yml index e7fbcfbc3..8c289d357 100644 --- a/.github/workflows/emmylua-check.yml +++ b/.github/workflows/emmylua-check.yml @@ -1,4 +1,4 @@ -name: Lua Language Server Diagnostics +name: EmmyLua Analyzer Diagnostics on: pull_request: ~ push: From 9f447a50b8b1efb8436fe367885960424dfe56ea Mon Sep 17 00:00:00 2001 From: pynappo Date: Mon, 22 Sep 2025 19:02:06 -0700 Subject: [PATCH 11/21] prevent auto-install on test --- .github/workflows/ci.yml | 3 +++ mise.toml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec25ad54b..f34232f42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: pull_request: workflow_dispatch: +env: + MISE_AUTO_INSTALL: "false" + jobs: stylua-check: runs-on: ubuntu-latest diff --git a/mise.toml b/mise.toml index d04095ecb..e438f477f 100644 --- a/mise.toml +++ b/mise.toml @@ -6,6 +6,7 @@ lua-language-server = "latest" cargo-binstall = "latest" "cargo:emmylua_ls" = "latest" "cargo:emmylua_check" = "latest" +"github:EmmyLuaLs/emmylua-analyzer-rust" = "latest" [tasks.test] run = """ From faae425cf4790c809fa040b9b20a285deac9d497 Mon Sep 17 00:00:00 2001 From: pynappo Date: Sat, 6 Dec 2025 10:14:18 -0800 Subject: [PATCH 12/21] try fixing --- CONTRIBUTING.md | 15 ++++++++++----- mise.toml | 6 +++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5c043c7a2..cf2dc7788 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,6 +3,14 @@ Contributions are welcome! To keep everything clean and tidy, please follow the guidelines below. +# Development setup + +View [mise.toml](./mise.toml) for tasks and their implementation. +```bash + + +``` + ## Code Style This is open for debate, but here is the current style choices being observed: @@ -12,9 +20,6 @@ This is open for debate, but here is the current style choices being observed: - other OOP things, like method names should use camelCase - BUT we don't currently have any OOP parts and I don't think we want any -I prefer `local name = function()` over `local function name()`, just to be -consistent with the `M.name = function()` exports. - ### StyLua We use (StyLua)[https://github.com/JohnnyMorganz/StyLua] to enforce consistency @@ -50,10 +55,10 @@ current strategy is to maintain: in comments. This is the bare minimum documentation for an option. - The README contains "back of the box" high level overview of features. It is meant for people trying to decide if they want to install this plugin or not. - It should include references to the help file for more information: + It should include references to the help file for more information: `:h neo-tree-setup` - Whether something should be mentioned in the README or just in the help file - is a completely subjective judement call that is made on a case by case basis + is a completely subjective judgement call that is made on a case by case basis based on how many people are likely to be interested in that information. - The vim help file [doc/neo-tree.txt](doc/neo-tree.txt) is the definitive reference and should contain all information needed to configure and use the diff --git a/mise.toml b/mise.toml index e438f477f..3d1f1a943 100644 --- a/mise.toml +++ b/mise.toml @@ -29,7 +29,7 @@ deps_dir = '.dependencies/pack/vendor/start' [tasks.update-dependencies] alias = 'deps' run = """ -#!/usr/bin/env bash +#!bash update() { local git_url="$1" local repo_name="$2" @@ -70,7 +70,7 @@ update https://github.com/s1n7ax/nvim-window-picker nvim-window-picker [tasks.luals-check] run = """ -#!/usr/bin/env bash +#!bash VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit') VIMRUNTIME="${VIMRUNTIME_PATH}" lua-language-server --configpath=$NEOTREE_LUARC --check=. """ @@ -78,7 +78,7 @@ depends = ['deps'] [tasks.emmylua-check] run = """ -#!/usr/bin/env bash +#!bash VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit') VIMRUNTIME="${VIMRUNTIME_PATH}" emmylua_check -c $NEOTREE_LUARC -i ".dependencies/**" -- . """ From 5aeefeaca3eac930f9d29702b9c961c04c3a5e83 Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 7 Dec 2025 08:55:12 -0800 Subject: [PATCH 13/21] fix windows ci --- mise.toml | 63 +++++++++++++++++++++++--- tests/neo-tree/clipboard/sync_spec.lua | 4 +- 2 files changed, 59 insertions(+), 8 deletions(-) diff --git a/mise.toml b/mise.toml index 3d1f1a943..6aa6ee29d 100644 --- a/mise.toml +++ b/mise.toml @@ -1,3 +1,5 @@ +[settings] +windows_default_inline_shell_args = "powershell -NoProfile -NoLogo -Command" [env] NEOTREE_LUARC = ".luarc.json" @@ -29,7 +31,7 @@ deps_dir = '.dependencies/pack/vendor/start' [tasks.update-dependencies] alias = 'deps' run = """ -#!bash +#!/usr/bin/env bash update() { local git_url="$1" local repo_name="$2" @@ -67,22 +69,71 @@ update https://github.com/nvim-tree/nvim-web-devicons nvim-web-devicons update https://github.com/nvim-lua/plenary.nvim plenary.nvim update https://github.com/s1n7ax/nvim-window-picker nvim-window-picker """ +run_windows = """ +function Update-Repository { + param( + [Parameter(Mandatory=$true)] + [string]$GitUrl, + [Parameter(Mandatory=$true)] + [string]$RepoName + ) + + # Ensure the parent directory exists + $DepsDir = "{{vars.deps_dir}}" + if (-not (Test-Path -Path $DepsDir -PathType Container)) { + Write-Host "==> Creating dependency directory '$DepsDir'..." + New-Item -Path $DepsDir -ItemType Directory | Out-Null + } + + $TargetDir = Join-Path -Path $DepsDir -ChildPath $RepoName + + if (Test-Path -Path $TargetDir -PathType Container) { + Write-Host "==> Directory '$TargetDir' exists. Updating $RepoName..." + git -C $TargetDir fetch --tags -f + git -C $TargetDir pull | Out-Null 2>&1 + } else { + Write-Host "==> Directory '$TargetDir' not found. Cloning repository '$GitUrl'..." + git clone $GitUrl $TargetDir + $cloneExitCode = $LASTEXITCODE + Write-Host "==> Successfully cloned '$RepoName'." + } +} + +## 🛠️ Repository Update Calls + +# Call the function for each repository +Update-Repository -GitUrl "https://github.com/3rd/image.nvim" -RepoName "image.nvim" +Update-Repository -GitUrl "https://github.com/folke/snacks.nvim" -RepoName "snacks.nvim" +Update-Repository -GitUrl "https://github.com/MunifTanjim/nui.nvim" -RepoName "nui.nvim" +Update-Repository -GitUrl "https://github.com/nvim-tree/nvim-web-devicons" -RepoName "nvim-web-devicons" +Update-Repository -GitUrl "https://github.com/nvim-lua/plenary.nvim" -RepoName "plenary.nvim" +Update-Repository -GitUrl "https://github.com/s1n7ax/nvim-window-picker" -RepoName "nvim-window-picker" +""" [tasks.luals-check] run = """ -#!bash -VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit') +#!/usr/bin/env bash +VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'qa') VIMRUNTIME="${VIMRUNTIME_PATH}" lua-language-server --configpath=$NEOTREE_LUARC --check=. """ -depends = ['deps'] +run_windows = """ +$env:VIMRUNTIME = (nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'qa') +lua-language-server --configpath=$env:NEOTREE_LUARC --check . +""" +wait_for = ['deps'] [tasks.emmylua-check] run = """ -#!bash +#!/usr/bin/env bash VIMRUNTIME_PATH=$(nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit') VIMRUNTIME="${VIMRUNTIME_PATH}" emmylua_check -c $NEOTREE_LUARC -i ".dependencies/**" -- . """ -depends = ['deps'] +run_windows = """ +$env:VIMRUNTIME = (nvim --clean --headless --cmd 'lua io.write(vim.env.VIMRUNTIME)' --cmd 'quit') +$env:PWD = Get-Location +emmylua_check -c $env:NEOTREE_LUARC -i ".dependencies/**" -- . +""" +wait_for = ['deps'] [tasks.clean] run = [ diff --git a/tests/neo-tree/clipboard/sync_spec.lua b/tests/neo-tree/clipboard/sync_spec.lua index 2f39fbea8..ce71a9c6d 100644 --- a/tests/neo-tree/clipboard/sync_spec.lua +++ b/tests/neo-tree/clipboard/sync_spec.lua @@ -39,7 +39,7 @@ describe("Clipboard sync", function() vim.cmd("Neotree") u.wait_for_neo_tree() - local state = verify.get_state() + local state = assert(verify.get_state()) local wait1 = u.changedtick_waiter() u.feedkeys("y") wait1() @@ -48,7 +48,7 @@ describe("Clipboard sync", function() vim.cmd("tabnew") vim.cmd("Neotree") u.wait_for_neo_tree() - local other_state = verify.get_state() + local other_state = assert(verify.get_state()) assert(next(other_state.clipboard)) local wait2 = u.changedtick_waiter(0, 1) u.feedkeys("y") From 119f712df9e70da61ace413aa473c4a8af844a9a Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 7 Dec 2025 09:07:17 -0800 Subject: [PATCH 14/21] Fix luals ver due to upstream issue --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 6aa6ee29d..bd322c59d 100644 --- a/mise.toml +++ b/mise.toml @@ -4,7 +4,7 @@ windows_default_inline_shell_args = "powershell -NoProfile -NoLogo -Command" NEOTREE_LUARC = ".luarc.json" [tools] -lua-language-server = "latest" +lua-language-server = "3.15" cargo-binstall = "latest" "cargo:emmylua_ls" = "latest" "cargo:emmylua_check" = "latest" From 94b5d3a7e0a8b62a908ba7664de079d5f84629cc Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 7 Dec 2025 09:23:43 -0800 Subject: [PATCH 15/21] fix typechecking --- .luarc.json | 15 +++++++-------- tests/.luarc.json | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/.luarc.json b/.luarc.json index a197b0484..1c8c4ee06 100644 --- a/.luarc.json +++ b/.luarc.json @@ -14,14 +14,13 @@ "checkThirdParty": "Disable", "library": [ "$VIMRUNTIME/lua", - "$PWD/.dependencies/pack/vendor/start/plenary.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/nui.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua", - "$PWD/.dependencies/pack/vendor/start/image.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/nvim-window-picker/lua", - "${3rd}/luassert/library", - "${3rd}/busted/library" + "lua", + ".dependencies/pack/vendor/start/plenary.nvim/lua", + ".dependencies/pack/vendor/start/nui.nvim/lua", + ".dependencies/pack/vendor/start/nvim-web-devicons/lua", + ".dependencies/pack/vendor/start/image.nvim/lua", + ".dependencies/pack/vendor/start/snacks.nvim/lua", + ".dependencies/pack/vendor/start/nvim-window-picker/lua" ], "ignoreDir": [ ".dependencies", diff --git a/tests/.luarc.json b/tests/.luarc.json index e69de29bb..f0b4da8c2 100644 --- a/tests/.luarc.json +++ b/tests/.luarc.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", + "diagnostics": { + "libraryFiles": "Disable" + }, + "runtime": { + "version": "LuaJIT", + "path": [ + "?.lua", + "?/init.lua" + ] + }, + "workspace": { + "checkThirdParty": "Disable", + "library": [ + "$VIMRUNTIME/lua", + "${3rd}/luassert/library", + "${3rd}/busted/library", + "../lua", + "../tests", + "../.dependencies/pack/vendor/start/plenary.nvim/lua", + "../.dependencies/pack/vendor/start/nui.nvim/lua", + "../.dependencies/pack/vendor/start/nvim-web-devicons/lua", + "../.dependencies/pack/vendor/start/image.nvim/lua", + "../.dependencies/pack/vendor/start/snacks.nvim/lua", + "../.dependencies/pack/vendor/start/nvim-window-picker/lua" + ], + "ignoreDir": [ + ".dependencies", + ".luarocks", + ".lua", + ".repro" + ] + } +} From 04e704cc6e609b6ea3320cf1676cc3676e0a2c75 Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 7 Dec 2025 09:26:29 -0800 Subject: [PATCH 16/21] fix test --- mise.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/mise.toml b/mise.toml index bd322c59d..3c2b5ea19 100644 --- a/mise.toml +++ b/mise.toml @@ -12,7 +12,6 @@ cargo-binstall = "latest" [tasks.test] run = """ -#!/usr/bin/env bash nvim --headless --noplugin -u tests/mininit.lua -c "lua require('plenary.test_harness').test_directory('tests/neo-tree/', {minimal_init='tests/mininit.lua'})" """ From c6af17f1f72e49e232bce657048589984cde1548 Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 7 Dec 2025 09:58:55 -0800 Subject: [PATCH 17/21] fix luarcs --- .github/workflows/.luarc-5.1.json | 25 ++++++++++++--------- .github/workflows/.luarc-luajit-master.json | 25 ++++++++++++--------- .github/workflows/luals-check.yml | 13 +++++++---- .luarc.json | 24 ++++++++++---------- lua/neo-tree/git/init.lua | 2 +- lua/neo-tree/utils/_compat.lua | 12 +++++++--- lua/neo-tree/utils/init.lua | 5 +---- plugin/neo-tree.lua | 1 + 8 files changed, 61 insertions(+), 46 deletions(-) diff --git a/.github/workflows/.luarc-5.1.json b/.github/workflows/.luarc-5.1.json index 4dbe19919..71bf1a09d 100644 --- a/.github/workflows/.luarc-5.1.json +++ b/.github/workflows/.luarc-5.1.json @@ -4,26 +4,29 @@ "libraryFiles": "Disable" }, "runtime": { - "version": "Lua 5.1" + "version": "LuaJIT", + "path": [ + "lua/?.lua", + "lua/?/init.lua" + ] }, "workspace": { "checkThirdParty": "Disable", "library": [ - "$VIMRUNTIME/lua", - "$PWD/.dependencies/pack/vendor/start/plenary.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/nui.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua", - "$PWD/.dependencies/pack/vendor/start/image.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/nvim-window-picker/lua", - "${3rd}/luassert/library", - "${3rd}/busted/library" + "$VIMRUNTIME", + "$PWD/.dependencies/pack/vendor/start/plenary.nvim", + "$PWD/.dependencies/pack/vendor/start/nui.nvim", + "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons", + "$PWD/.dependencies/pack/vendor/start/image.nvim", + "$PWD/.dependencies/pack/vendor/start/snacks.nvim", + "$PWD/.dependencies/pack/vendor/start/nvim-window-picker" ], "ignoreDir": [ ".dependencies", ".luarocks", ".lua", - ".repro" + ".repro", + "tests" ] } } diff --git a/.github/workflows/.luarc-luajit-master.json b/.github/workflows/.luarc-luajit-master.json index 416136645..71bf1a09d 100644 --- a/.github/workflows/.luarc-luajit-master.json +++ b/.github/workflows/.luarc-luajit-master.json @@ -4,26 +4,29 @@ "libraryFiles": "Disable" }, "runtime": { - "version": "LuaJIT" + "version": "LuaJIT", + "path": [ + "lua/?.lua", + "lua/?/init.lua" + ] }, "workspace": { "checkThirdParty": "Disable", "library": [ - "$VIMRUNTIME/lua", - "$PWD/.dependencies/pack/vendor/start/plenary.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/nui.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons/lua", - "$PWD/.dependencies/pack/vendor/start/image.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/snacks.nvim/lua", - "$PWD/.dependencies/pack/vendor/start/nvim-window-picker/lua", - "${3rd}/luassert/library", - "${3rd}/busted/library" + "$VIMRUNTIME", + "$PWD/.dependencies/pack/vendor/start/plenary.nvim", + "$PWD/.dependencies/pack/vendor/start/nui.nvim", + "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons", + "$PWD/.dependencies/pack/vendor/start/image.nvim", + "$PWD/.dependencies/pack/vendor/start/snacks.nvim", + "$PWD/.dependencies/pack/vendor/start/nvim-window-picker" ], "ignoreDir": [ ".dependencies", ".luarocks", ".lua", - ".repro" + ".repro", + "tests" ] } } diff --git a/.github/workflows/luals-check.yml b/.github/workflows/luals-check.yml index ac424b54c..81736f8e9 100644 --- a/.github/workflows/luals-check.yml +++ b/.github/workflows/luals-check.yml @@ -12,8 +12,13 @@ jobs: luals-check: strategy: matrix: - neovim: ["0.11"] - lua: ["5.1", "luajit-master"] + neovim: ["nightly"] + lua: ["luajit-master"] + include: + - neovim: "0.11" + lua: "luajit-master" + - neovim: "nightly" + lua: "" runs-on: ubuntu-latest steps: @@ -27,9 +32,9 @@ jobs: - name: Install tools uses: jdx/mise-action@v2 with: - install_args: "github:neovim/neovim@nightly" + install_args: "github:neovim/neovim@${{matrix.neovim}}" - name: Run lua-language-server check run: | - mise use github:neovim/neovim@nightly + mise use github:neovim/neovim@${{matrix.neovim}} NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run luals-check diff --git a/.luarc.json b/.luarc.json index 1c8c4ee06..04e870411 100644 --- a/.luarc.json +++ b/.luarc.json @@ -4,29 +4,29 @@ "libraryFiles": "Disable" }, "runtime": { - "version": "LuaJIT", + "version": "Lua 5.1", "path": [ - "?.lua", - "?/init.lua" + "lua/?.lua", + "lua/?/init.lua" ] }, "workspace": { "checkThirdParty": "Disable", "library": [ - "$VIMRUNTIME/lua", - "lua", - ".dependencies/pack/vendor/start/plenary.nvim/lua", - ".dependencies/pack/vendor/start/nui.nvim/lua", - ".dependencies/pack/vendor/start/nvim-web-devicons/lua", - ".dependencies/pack/vendor/start/image.nvim/lua", - ".dependencies/pack/vendor/start/snacks.nvim/lua", - ".dependencies/pack/vendor/start/nvim-window-picker/lua" + "$VIMRUNTIME", + "$PWD/.dependencies/pack/vendor/start/plenary.nvim", + "$PWD/.dependencies/pack/vendor/start/nui.nvim", + "$PWD/.dependencies/pack/vendor/start/nvim-web-devicons", + "$PWD/.dependencies/pack/vendor/start/image.nvim", + "$PWD/.dependencies/pack/vendor/start/snacks.nvim", + "$PWD/.dependencies/pack/vendor/start/nvim-window-picker" ], "ignoreDir": [ ".dependencies", ".luarocks", ".lua", - ".repro" + ".repro", + "tests" ] } } diff --git a/lua/neo-tree/git/init.lua b/lua/neo-tree/git/init.lua index a8f9a6714..34f767bda 100644 --- a/lua/neo-tree/git/init.lua +++ b/lua/neo-tree/git/init.lua @@ -307,7 +307,7 @@ M._parse_porcelain = function( renamed, copied, }) do - require("neo-tree.utils._compat").table_move( + require("neo-tree.utils._compat").luajit.table_move( list, 1, #list, diff --git a/lua/neo-tree/utils/_compat.lua b/lua/neo-tree/utils/_compat.lua index 13b1e24e3..7e6adc744 100644 --- a/lua/neo-tree/utils/_compat.lua +++ b/lua/neo-tree/utils/_compat.lua @@ -26,8 +26,10 @@ local table_move = function(a1, f, e, t, a2) return a2 end ----source: -compat.table_move = table.move or table_move + +compat.luajit = {} +---@diagnostic disable-next-line: deprecated +compat.luajit.table_move = table.move or table_move ---@vararg any local table_pack = function(...) @@ -37,7 +39,11 @@ local table_pack = function(...) t.n = #t return t end -compat.table_pack = table.pack or table_pack + +---@diagnostic disable-next-line: deprecated +compat.luajit.table_pack = table.pack or function(...) + return { n = select("#", ...), ... } +end --- Split a Windows path into a prefix and a body, such that the body can be processed like a POSIX --- path. The path must use forward slashes as path separator. diff --git a/lua/neo-tree/utils/init.lua b/lua/neo-tree/utils/init.lua index bf10858b6..4c22262d6 100644 --- a/lua/neo-tree/utils/init.lua +++ b/lua/neo-tree/utils/init.lua @@ -52,10 +52,7 @@ local diag_severity_to_string = function(severity) end end --- Backwards compatibility -M.pack = table.pack or function(...) - return { n = select("#", ...), ... } -end +M.pack = compat.luajit.table_pack local tracked_functions = {} ---@enum neotree.utils.DebounceStrategy diff --git a/plugin/neo-tree.lua b/plugin/neo-tree.lua index c1ac52f87..b341e228e 100644 --- a/plugin/neo-tree.lua +++ b/plugin/neo-tree.lua @@ -59,6 +59,7 @@ vim.api.nvim_create_autocmd({ "WinEnter" }, { -- prune history local win_count = #tab_windows if win_count > 100 then + ---@diagnostic disable-next-line: deprecated if table.move then utils.prior_windows[tabid] = require("neo-tree.utils._compat").table_move(tab_windows, 80, win_count, 1, {}) From a74d97dc12d012ddb09c30bc0b7abbfd7431bf58 Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 7 Dec 2025 10:00:43 -0800 Subject: [PATCH 18/21] fix --- .github/workflows/emmylua-check.yml | 6 +++++- .github/workflows/luals-check.yml | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/emmylua-check.yml b/.github/workflows/emmylua-check.yml index 8c289d357..504385d10 100644 --- a/.github/workflows/emmylua-check.yml +++ b/.github/workflows/emmylua-check.yml @@ -12,7 +12,11 @@ jobs: luals-check: strategy: matrix: - lua: ["5.1", "luajit-master"] + include: + - neovim: "0.11" + lua: "5.1" + - neovim: "nightly" + lua: "luajit-master" runs-on: ubuntu-latest steps: diff --git a/.github/workflows/luals-check.yml b/.github/workflows/luals-check.yml index 81736f8e9..74780b2de 100644 --- a/.github/workflows/luals-check.yml +++ b/.github/workflows/luals-check.yml @@ -12,13 +12,11 @@ jobs: luals-check: strategy: matrix: - neovim: ["nightly"] - lua: ["luajit-master"] include: - neovim: "0.11" - lua: "luajit-master" + lua: "5.1" - neovim: "nightly" - lua: "" + lua: "luajit-master" runs-on: ubuntu-latest steps: From 84912b0c8c7db71298d354a08ead8913923e7833 Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 7 Dec 2025 10:02:56 -0800 Subject: [PATCH 19/21] fix luv versions --- .github/workflows/emmylua-check.yml | 7 ++----- .github/workflows/luals-check.yml | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/emmylua-check.yml b/.github/workflows/emmylua-check.yml index 504385d10..ae206b941 100644 --- a/.github/workflows/emmylua-check.yml +++ b/.github/workflows/emmylua-check.yml @@ -12,11 +12,8 @@ jobs: luals-check: strategy: matrix: - include: - - neovim: "0.11" - lua: "5.1" - - neovim: "nightly" - lua: "luajit-master" + neovim: ["nightly"] + lua: ["luajit-master", "5.1"] runs-on: ubuntu-latest steps: diff --git a/.github/workflows/luals-check.yml b/.github/workflows/luals-check.yml index 74780b2de..22b439ee7 100644 --- a/.github/workflows/luals-check.yml +++ b/.github/workflows/luals-check.yml @@ -12,11 +12,8 @@ jobs: luals-check: strategy: matrix: - include: - - neovim: "0.11" - lua: "5.1" - - neovim: "nightly" - lua: "luajit-master" + neovim: ["nightly"] + lua: ["luajit-master", "5.1"] runs-on: ubuntu-latest steps: From 8c5b2d15de5f0e66763c35a01d73cfa95238e82e Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 7 Dec 2025 10:07:18 -0800 Subject: [PATCH 20/21] install deps before typechecking --- .github/workflows/emmylua-check.yml | 1 + .github/workflows/luals-check.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/emmylua-check.yml b/.github/workflows/emmylua-check.yml index ae206b941..085890b83 100644 --- a/.github/workflows/emmylua-check.yml +++ b/.github/workflows/emmylua-check.yml @@ -33,4 +33,5 @@ jobs: continue-on-error: true run: | mise use github:neovim/neovim@nightly + mise run deps NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run emmylua-check diff --git a/.github/workflows/luals-check.yml b/.github/workflows/luals-check.yml index 22b439ee7..a3deddea1 100644 --- a/.github/workflows/luals-check.yml +++ b/.github/workflows/luals-check.yml @@ -32,4 +32,5 @@ jobs: - name: Run lua-language-server check run: | mise use github:neovim/neovim@${{matrix.neovim}} + mise run deps NEOTREE_LUARC=".github/workflows/.luarc-${{ matrix.lua }}.json" mise run luals-check From 721a96071ba6b3a9895133bca9923b08c6d6cd52 Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 7 Dec 2025 10:13:27 -0800 Subject: [PATCH 21/21] Update contributing --- CONTRIBUTING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cf2dc7788..bb5e044aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,8 +6,26 @@ guidelines below. # Development setup View [mise.toml](./mise.toml) for tasks and their implementation. + ```bash +# Install/update dependencies +mise deps +# Or `mise update-dependencies` + +# Run stylua +mise format + +# Do a lua-language-server pass +mise luals-check + +# Do a emmylua-analyzer-rust pass (not important for now) +mise luals-check + +# Tests +mise test +# Tests in Docker (for better sandboxing) +mise test-docker ```