Code Monkey home page Code Monkey logo

Comments (4)

gwerbin avatar gwerbin commented on July 22, 2024 1

Wow, that was indeed the problem. Sorry for the noise!

from hotpot.nvim.

rktjmp avatar rktjmp commented on July 22, 2024

What you posted should be functioning fine, works here (with path etc modification for my system).

image

For ref, this is the code I used, just cut down from yours using NVIM_APPNAME for a fresh test. Seemed fine on nvim-0.9.4 and HEAD (which I assume you're on due to vim.fs.joinpath).

-- init.lua
-- As per lazy's install instructions
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end

-- Bootstap hotpot into lazy plugin dir if it does not exist yet.
local hotpotpath = vim.fn.stdpath("data") .. "/lazy/hotpot.nvim"
if not vim.loop.fs_stat(hotpotpath) then
  vim.notify("Bootstrapping hotpot.nvim...", vim.log.levels.INFO)
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    -- You may with to pin a known version tag with `--branch=vX.Y.Z`
    "--branch=v0.9.7",
    "https://github.com/rktjmp/hotpot.nvim.git",
    hotpotpath,
  })
end

-- As per lazy's install instructions, but insert hotpots path at the front
vim.opt.runtimepath:prepend({hotpotpath, lazypath})

require("hotpot") -- optionally you may call require("hotpot").setup(...) here

-- include hotpot as a plugin so lazy will update it
local plugins = {"rktjmp/hotpot.nvim"}
require("lazy").setup(plugins)

local function _abspath(p)
  return vim.fn.fnamemodify(p, ":p")
end

local _nvim_config = _abspath(vim.fs.normalize(vim.fn.stdpath("config")))

local function _compile_prefix(prefix, _opts)
  local opts = _opts or {}
  require("hotpot").api.make.build(prefix, {
    dryrun = not opts.go,
    verbose = opts.verbose,
  }, {
    -- Compile fnl/ → lua/
    { "fnl/*.fnl", true },
    { "fnl/**/*.fnl", true },
    -- Compile other Fennel scripts in-place
    { "**/*.fnl", true },
  })
end

vim.api.nvim_create_user_command("HotpotCheckNvimConfig", function(cmd)
  return _compile_prefix(_nvim_config, { go = false })
end, {})

vim.api.nvim_create_user_command("HotpotCompileNvimConfig", function(cmd)
  return _compile_prefix(_nvim_config, { go = true })
end, {})

The error you see only pops up with you call the old check function here

(fn M.check [...]
"Deprecated, see dryrun option for build"
(vim.notify (.. "The hotpot.api.make usage has changed, please see\n"
":h hotpot-cookbook-using-dot-hotpot\n"
":h hotpot.api.make\n"
"Unfortunately it was not possible to support both options simultaneously :( sorry.")
vim.log.levels.WARN))
. I had a quick look and couldn't find any errant calls to it left over in the code.

Perhaps check your config doesn't have any references to make.check in it?

Bit of a puzzler ...

from hotpot.nvim.

gwerbin avatar gwerbin commented on July 22, 2024

I should have clarified, this error happens any time I save any file with ft=fennel, and appears to be caused by a BufWritePost autocmd.

Relevant output from :verbose autocmd BufWritePost:

BufWritePost
    <buffer=1>
              <Lua 385: ~/.local/share/nvim/site/pack/packer/start/hotpot.nvim/lua/hotpot/api/make.lua:672> [hotpot-check-dot-hotpot-dot-lua-for-1]
        Last set from Lua

Unfortunately "Last set from Lua" doesn't give me a lot to go on, but I scoured my config files and I don't see anywhere that I might be doing this.

I searched the Hotpot source code and it looks like the autocmd is set by hotpot.api.make.attach() which appears to be called by the FileType plugin created by hotpot.api.make.enable(). But I can't figure out where enable is being called, and I'm pretty sure it's nowhere in my own config files. To be extra safe, I went into my local Hotpot Git repo and ran git clean -fdx ; git fetch origin ; git reset --hard origin/master.

from hotpot.nvim.

rktjmp avatar rktjmp commented on July 22, 2024
    if not vim.startswith(afile_abs, aniseed_input_path) then
      _compile_prefix(nvim_config, { go = true, verbose = true })
    end

Uses nvim_config (eg an undefined variable name, eg nil) instead of _nvim_config, which causes the make function to think you're trying to use the old api.

image

image

from hotpot.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.