Git Product home page Git Product logo

Comments (27)

mirsella avatar mirsella commented on June 29, 2024 2

Still valid until someone tries to add fzf haha.
The comment about extras has been removed in the starter template, to avoid problem and because :lazyextra is preferred instead.

i'll try to do a pr for the docs

edit: opened LazyVim/lazyvim.github.io#97, then i'll close this issue

from lazyvim.

folke avatar folke commented on June 29, 2024 2

@Drewtopia don't open an issue here. Check the fzf-lua github page first for related issues and open one there if you couldn't fix it yourself

from lazyvim.

dpetka2001 avatar dpetka2001 commented on June 29, 2024 1

So, require("lazy.core.config").spec.modules only prints out lazyvim.plugins at the parsing phase of the lazyvim.plugins.editor. That leads to the import of fzf-lua to be always false and the telescope one to be true. When then from lazy.lua the import = "lazyvim.plugins.extras.editor.fzf" is evaluated the telescope spec has already been enabled and registered a picker and that's why we see the message that you mention. I still fail to think of a good way to get around this due to my lack of knowledge. I wonder if there's a way for LazyVim.has_extra to get the imported modules after the parsing phase of all modules has been completed and check based on that.

from lazyvim.

mirsella avatar mirsella commented on June 29, 2024 1

i guess we can close this, but we should update the docs to deprecate the old method, as it's causing problems and is not supported anymore

from lazyvim.

dpetka2001 avatar dpetka2001 commented on June 29, 2024 1

@mirsella

well, if :LazyExtras is the recommanded / supported way, it should be said in the docs.
the config option should be deprecated if it doesn't work, removed from the docs etc.

The import config option is something that comes from lazy.nvim itself. It just doesn't work correctly in this specific case, because Telescope was also moved to the Extras and the import is happening in lazyvim.plugins.editor. It still works for other cases. So, the old method still works, but requires a bit of knowledge about what you're doing (i.e with the imports in your config you should also be vigilant of the order you put the imports, because some Extras need to be loaded first). The docs for the Extras first mention as an option to install the Extra via LazyExtras and then mention the config as alternative. For the specific case of fzf/telescope, maybe it could indeed be mentioned that LazyExtras should be the preferred way.

But it's not like the config option is deprecated or not supported anymore in general. It just doesn't work correctly for this specific change, so any change in the docs should be made in the page of fzf/telescope Extras explicitly.

from lazyvim.

ibhagwan avatar ibhagwan commented on June 29, 2024 1

@Drewtopia, that’s the same issue as ibhagwan/fzf-lua#1243, usually indicates an issue with your neovim setup (specially access to runtime folder) which makes vin.fn.serverstart fail, also look into the upstream issue I linked it will have some pointers for fixing this.

from lazyvim.

dpetka2001 avatar dpetka2001 commented on June 29, 2024

Are you sure you don't have some kind of Telescope spec in your personal config?

from lazyvim.

mirsella avatar mirsella commented on June 29, 2024

hello @dpetka2001, my bad i guess i missed my commands and the repro.lua actually doesn't work.
i can't even manage to specify a extra ? The repro.lua from the first post doesn't even install fzf, or any other extra i put in there. lot of keybinds doesn't works. i think the given repro.lua is weird.
how can i add a extra to the repro.lua ?

for you question, i removed all telescope config to test, and the message was still there, so i'm sure it's not my config.

from lazyvim.

dpetka2001 avatar dpetka2001 commented on June 29, 2024

Strange I've been using it since it got merged and I don't have such a problem. I remember reading that when you import it via import = "lazyvim.plugins.extras.editor.fzf" in your lazy.lua then the Telescope spec will still be parsed, but only one of the 2 will be enabled. I enabled fzf-lua via LazyExtras. Can you try that (if you haven't done so already)?

from lazyvim.

mirsella avatar mirsella commented on June 29, 2024

using the repro.lua, like i said it's bugged and the command :LazyExtras doesn't even exist.

using my personal config, removing the import [...] editor.fzf and adding it via lazyextras works.

the problem is indeed the { import = "lazyvim.plugins.extras.editor.fzf" }, which install the telescope specs.

from lazyvim.

mirsella avatar mirsella commented on June 29, 2024

i've updated the main post

from lazyvim.

dpetka2001 avatar dpetka2001 commented on June 29, 2024

The following repro.lua will work correctly

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/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", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  { "LazyVim/LazyVim", import = "lazyvim.plugins" },
  { import = "lazyvim.plugins.extras.editor.fzf" },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

That doesn't solve the problem with fzf-lua. Something is going on with LazyVim.has_extra or the way the pickers are registered maybe? Unfortunately, I'm not that well-versed in lazy.nvim's internals. Maintainer will know better.

from lazyvim.

mirsella avatar mirsella commented on June 29, 2024

thanks this repro.lua works, because it use { "LazyVim/LazyVim", import = "lazyvim.plugins" } while the default just has "folke/LazyVim",. i'll open a pr for the issue template

from lazyvim.

gengdz avatar gengdz commented on June 29, 2024

I had the same problem

from lazyvim.

rgzntrade avatar rgzntrade commented on June 29, 2024

我有同样的问题

+1

from lazyvim.

rgzntrade avatar rgzntrade commented on June 29, 2024

As a temporary solution, set the local telescope configuration of lazyvim to enabled= false,. Then recompile lazyvim, the problem is solved temporarily.

from lazyvim.

konosubakonoakua avatar konosubakonoakua commented on June 29, 2024

same here.
My extras config for fzf

  { import = "lazyvim.plugins.extras.editor.fzf" },
  { "junegunn/fzf", build = "./install --bin" },
  {
    "ibhagwan/fzf-lua",
    optional = true,
}

not working

from lazyvim.

konosubakonoakua avatar konosubakonoakua commented on June 29, 2024

So, require("lazy.core.config").spec.modules only prints out lazyvim.plugins at the parsing phase of the lazyvim.plugins.editor. That leads to the import of fzf-lua to be always false and the telescope one to be true. When then from lazy.lua the import = "lazyvim.plugins.extras.editor.fzf" is evaluated the telescope spec has already been enabled and registered a picker and that's why we see the message that you mention. I still fail to think of a good way to get around this due to my lack of knowledge. I wonder if there's a way for LazyVim.has_extra to get the imported modules after the parsing phase of all modules has been completed and check based on that.

How about this way

  { import = "lazyvim.plugins.extras.editor.fzf" },
  { import = "lazyvim.plugins.extras.editor.telescope", enabled = false},

from lazyvim.

folke avatar folke commented on June 29, 2024

Just use :LazyExtras?
I've changed it so that we no longer have to process the full telescope spec when you have fzf-lua enabled.

That only works properly if you added fzf-lua with :LazyExtras.

from lazyvim.

mirsella avatar mirsella commented on June 29, 2024

well, if :LazyExtras is the recommanded / supported way, it should be said in the docs.
the config option should be deprecated if it doesn't work, removed from the docs etc.

personally I like the config option because I can put in my config (which is synced between computer) which extra is enabled, and I have a lot of them.
each time I setup my dotfiles I don't want to have to run lazyextras and remember which one I had, while it could just work like before by setting it in the config

from lazyvim.

rgzntrade avatar rgzntrade commented on June 29, 2024
{ import = "lazyvim.plugins.extras.editor.telescope", enabled = false},

I also commented out these lines from telescope.lua
-- if not LazyVim.pick.register(picker) then
-- return {}
-- end

I installed it the same way.
{ import = "lazyvim.plugins.extras.editor.fzf" },

from lazyvim.

EraPartner avatar EraPartner commented on June 29, 2024

@mirsella , I understand that the config option has these benefits for you. Personally, I always use the :LazyExtras menu and the generated lazyvim.json file in root to remember/backup my extras. If I reinstall lazyvim, the enabled extras are saved because of this lazyvim.json (I think!), meaning that I don't have to remember the enabled extras. Is this maybe an option?

from lazyvim.

mirsella avatar mirsella commented on June 29, 2024

@EraPartner didn't know about lazyvim.json, I'll check it out ! it'll will probably work for me, thanks !

from lazyvim.

mirsella avatar mirsella commented on June 29, 2024

Thanks for the explanations.
the only place where the config option is still remaining is the starter template and on https://www.lazyvim.org/configuration/lazy.nvim which just show the starter template.

i'll open a pr on the starter template comments to better reflect the status of the config import, as for a long term user which was used to config option, and for a new user that see the starter template, it's confusing, and will affect everyone that use fzf this way

so in conclusion,
maybe a special warning on the fzf extra page to warn that enabling it via config option doesn't work ?
or a general tips that the setting extras from the import config can cause problem like for fzf ?

from lazyvim.

dpetka2001 avatar dpetka2001 commented on June 29, 2024

In my personal opinion I wouldn't mess with LazyVim starter template, as that is still valid. I believe in this specific case, a special warning on LazyVim website in the page of fzf Extra about explicitly enabling it via LazyExtras would be preferred.

from lazyvim.

Drewtopia avatar Drewtopia commented on June 29, 2024

When I enabled editor.fzf via :LazyExtras, I am seeing the following errors

CleanShot 2024-06-14 at 22 38 05@2x
CleanShot 2024-06-14 at 22 54 23@2x

from lazyvim.

mirsella avatar mirsella commented on June 29, 2024

@Drewtopia that's a different issue, you can open a new one for it to be treated ⬇️
edit: #3650 was created for @ Drewtopia issue

from lazyvim.

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.