Code Monkey home page Code Monkey logo

Comments (10)

rktjmp avatar rktjmp commented on May 27, 2024

Problematic session has package.fennel = table but .traceback = nil.

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

May have just been a hold over from nvim sessions that had older versions of hotpot in-memory.

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

Process was 2 days old so ... probably just running an old version...

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

May be fennel inserting itself into package.loaded["fennel"] but not inserting the whole thing since that was technically loaded at ["hotpot.fennel"]. Can probably manually push it into "fennel" when we require.

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

Clearing cache to force fresh hotpot -> package.loaded.fennel = nil

Hitting an uncompiled file (nnn) -> nil

require("file-with-macro") -> nil

:Fnl on range -> nil
Fnl on range with error -> nil

:Fnlfile -> nil
:Fnlfile with error -> nil

Error in hotpot for compiler error -> nil

All calls in cache:

~/.ca/nv/ho/ho/so/pr/ho/fn/hotpot
λ rg fennel
fs.lua
15:  return close_handlers_0_(xpcall(_0_, (package.loaded.fennel or debug).traceback))
31:  return close_handlers_0_(xpcall(_0_, (package.loaded.fennel or debug).traceback))

compiler.lua
11:  local fennel = require("hotpot.fennel")
13:    table.insert(fennel["macro-searchers"], 1, macro_searcher)
17:    local _1_ = fennel["compile-string"](string, (options or {filename = "hotpot-compile-string"}))
20:  return xpcall(compile, fennel.traceback)

searcher/macro.lua
6:  local fennel = require("hotpot.fennel")
11:    return fennel.eval(code, {env = "_COMPILER"})

api/eval.lua
10:  local fennel = require("hotpot.fennel")
11:  return fennel.eval(string, {filename = "hotpot-live-eval"})
24:  local fennel = require("hotpot.fennel")
25:  return fennel.dofile(fnl_file, {filename = fnl_file})
55:  local fennel = require("hotpot.fennel")
57:  local func = fennel.eval(codestr, {filename = "hotpot-fnldo"})

api/fennel.lua
2:  return require("hotpot.fennel")

All calls in dogfood

λ rg fennel
hotpot.lua
57:  local fennel = require("hotpot.fennel")
58:  local saved_fennel_path = fennel.path
59:  fennel.path = (fnl_dir0 .. "/?.fnl;" .. fennel.path)
60:  table.insert(package.loaders, fennel.searcher)
66:  local function compile_dir(fennel0, in_dir, out_dir, local_path)
80:        compile_dir(fennel0, in_down, out_down, local_down)
93:  compile_dir(fennel, fnl_dir0, cache_dir0, "")
94:  fennel.path = saved_fennel_path
98:    if (check == fennel.searcher) then

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

Seem that it would fix the issue by pushing hotpot.fennel into fennel, but it would be nice to know why the issue occurs.

package.loaded.fennel and package.loaded["hotpot.fennel"] end up being different memory (but that could be our error proxy).

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

Working system, edit, edit, add new file, hhcs (comp selection) of map that included a require.

...hotpot//home/soup/projects/hotpot.nvim/fnl/hotpot/fs.lua:15: bad argument #2 to 'xpcall'
(function expected, got nil)
E5108: Error executing lua ...he/nvim/hotpot/home/soup/.config/nvim/fnl/astre/maps.lua:157:
hotpot.api.compile could not be loaded by Hotpot because of a previous compiler error.
Path: /home/soup/projects/hotpot.nvim/fnl/hotpot/api/compile.fnl
Check :messages or ~/.cache/nvim/hotpot.log

print(package.loaded.fennel) table: 0x7f5669dff378
print(package.loaded.fennel.traceback) nil
print(package.loaded["hotpot.fennel"]) table: 0x7f566a0fa938
print(package.loaded["hotpot.fennel"].traceback) function: 0x7f566a170510

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024
print(vim.inspect(package.loaded.fennel))

{
  ["add-path"] = <function 1>,
  ["aniseed/local-fns"] = {
    autoload = {
      fs = "conjure.aniseed.fs",
      nvim = "conjure.aniseed.nvim"
    }
  },
  ["aniseed/locals"] = {
    ["add-path"] = <function 1>,
    impl = <function 2>,
    state = {
      ["compiler-loaded?"] = true
    },
    ["sync-rtp"] = <function 3>
  },
  ["aniseed/module"] = "conjure.aniseed.fennel",
  impl = <function 2>,
  ["sync-rtp"] = <function 3>
}

Probably caused by eeing some Fennel and Aniseed/conjure not mapping traceback.

  • Yes, load fresh buffer, eval some fennel via conjure and package.loaded.fennel is injected but traceback is not mapped.

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

Confirm conjure eval injection https://github.com/Olical/conjure/blob/998603d240b13e32e3c9571bcb805357ea323fa9/fnl/conjure/client/fennel/aniseed.fnl#L68

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 27, 2024

Fixed in conjure.

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.