Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to open a file in a non-existing path creates error #66

Open
5 tasks done
therealprof opened this issue Jan 22, 2024 · 0 comments · May be fixed by #177
Open
5 tasks done

Trying to open a file in a non-existing path creates error #66

therealprof opened this issue Jan 22, 2024 · 0 comments · May be fixed by #177
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@therealprof
Copy link

FAQ

  • I have checked the FAQ and it didn't resolve my problem.

Issues

  • I have checked existing issues and there are no issues with the same problem.

Neovim Version

NVIM v0.9.5 Build type: Release LuaJIT 2.1.1703358377

Dev Version?

  • I am using a stable Neovim release version, or if I am using a dev version of Neovim I have confirmed that my issue is reproducible on a stable version.

Operating System

macOS Ventura 13.6.3

Minimal Config

-- this template is borrowed from nvim-lspconfig
local on_windows = vim.loop.os_uname().version:match("Windows")

local function join_paths(...)
    local path_sep = on_windows and "\\" or "/"
    local result = table.concat({ ... }, path_sep)
    return result
end

vim.g.loaded_remote_plugins = ""
vim.cmd([[set runtimepath=$VIMRUNTIME]])

local temp_dir = vim.loop.os_getenv("TEMP") or "/tmp"

vim.cmd("set packpath=" .. join_paths(temp_dir, "nvim", "site"))

local package_root = join_paths(temp_dir, "nvim", "site", "pack")
local install_path = join_paths(package_root, "packer", "start", "packer.nvim")
local compile_path = join_paths(install_path, "plugin", "packer_compiled.lua")

local null_ls_config = function()
    local null_ls = require("null-ls")
    -- add only what you need to reproduce your issue
    null_ls.setup({
        sources = {},
        debug = true,
    })
end

local function load_plugins()
    -- only add other plugins if they are necessary to reproduce the issue
    require("packer").startup({
        {
            "wbthomason/packer.nvim",
            {
                "nvimtools/none-ls.nvim",
                requires = { "nvim-lua/plenary.nvim" },
                config = null_ls_config,
            },
        },
        config = {
            package_root = package_root,
            compile_path = compile_path,
        },
    })
end

if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path })
    load_plugins()
    require("packer").sync()
else
    load_plugins()
    require("packer").sync()
end

local capabilities = vim.lsp.protocol.make_client_capabilities()
local null_ls = require("null-ls")

null_ls.setup({
	sources = {
                null_ls.builtins.diagnostics.cppcheck,
              },
	capabilities = capabilities,
})

Steps to Reproduce

nvim --clean -u minimal_init.lua foo/bar/com.c

Reproducibility Check

  • I confirm that my minimal config is based on the minimal_init.lua template and that my issue is reproducible by running nvim --clean -u minimal_init.lua and following the steps above.

Expected Behavior

No error.

Actual Behavior

[null-ls] failed to run generator: ...cal/share/nvim/plugged/none-ls.nvim/lua/null-ls/loop.lua:237: failed to create temp file: ENOENT: no such file or di
rectory: /Users/egger/foo.c

Debug Log

[WARN Mon Jan 22 14:36:31 2024] /tmp/nvim/site/pack/packer/start/none-ls.nvim/lua/null-ls/generators.lua:94: failed to run generator: ...site/pack/packer/start/none-ls.nvim/lua/null-ls/loop.lua:237: failed to create temp file: ENOENT: no such file or directory: /Users/egger/.config/nvim/foo/bar/.null-ls_814785_com.c

Help

No

Implementation Help

No response

Requirements

  • I have read and followed the instructions above and understand that my issue will be closed if I did not provide the required information.
@therealprof therealprof added the bug Something isn't working label Jan 22, 2024
@mochaaP mochaaP added the help wanted Extra attention is needed label Mar 16, 2024
@apgrc apgrc linked a pull request Aug 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants