Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Telescope lean_abbreviations fails: abbreviations.load() resolves abbreviations.json relative to its caller

Open Beginner friendly
#555 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
lua, neovim
Domain
tooling

Research direction

Start in lua/lean/abbreviations.lua at abbreviations.load() and compare its path resolution with the lua/telescope/_extensions/lean_abbreviations.lua caller. Reproduce with :Telescope lean_abbreviations before any insert-mode abbreviation expansion, then verify that the picker loads abbreviations.json on its first call and that insert-mode expansion still works.

Written by the indexing model from the issue text.

Description

:Telescope lean_abbreviations fails with:

E5108: Lua: .../lean.nvim/lua/lean/abbreviations.lua:29: Unable to read abbreviations from ".../lean.nvim/lua/telescope/_extensions/../../vscode-lean/abbreviations.json"

abbreviations.load() builds the path to abbreviations.json from debug.getinfo(2, 'S'), i.e. from the source file of its caller rather than of abbreviations.lua itself:

https://github.com/Julian/lean.nvim/blob/527b47e8a2f61968e6af55ad4c5550e70e5b9555/lua/lean/abbreviations.lua#L25-L26

When the caller lives in lua/lean/ (e.g. insert-mode expansion), ../../vscode-lean resolves to the repository root and everything works. When the caller is the telescope extension in lua/telescope/_extensions/, the path resolves to lua/vscode-lean/abbreviations.json, which doesn't exist.

Because the result is memoized, the picker does work once something under lua/lean/ has already called load() in the session (e.g. after typing \a once in insert mode). So it only fails when the picker is the first thing to load the abbreviations.

Reproduction
  1. Start Neovim and open a .lean file.
  2. Without typing any abbreviation first, run :Telescope lean_abbreviations.
Suggested fix

Use level 1, so the path is relative to abbreviations.lua regardless of the caller:

local this_dir = vim.fs.dirname(debug.getinfo(1, 'S').source:sub(2))
Environment
  • lean.nvim 527b47e (main)
  • telescope.nvim 40aedd8
  • Neovim 0.12.5, macOS
Dominant language
Lua
Stars
597
Forks
60
Avg merge
3d 22h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Julian/lean.nvim

All issues in Julian/lean.nvim

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.