GithubHelp home page GithubHelp logo

Comments (18)

jalberto avatar jalberto commented on May 21, 2024
Error executing vim.schedule lua callback: ...packer/start/plenary.nvim/lua/plenary/async_lib/util.lua:176: Oneshot channel can only send once
running generators for method NULL_LS_CODE_ACTION
"apps/vlui/lib/sb/search.ex" 54L, 1511C [w]
received LSP formatting request
running generators for method NULL_LS_FORMATTING
spawning command mix with args:
{ "format", "-" }
error output: nil

from null-ls.nvim.

jose-elias-alvarez avatar jose-elias-alvarez commented on May 21, 2024

A little bit confused about this one, since LSP formatting won't show up under code actions (both for actual LSPs and null-ls). However, it should work when you run vim.lsp.buf.formatting() and select null-ls, so something else is going on. To verify, do you have mix available on your $PATH, and does mix format work as expected from the command line?

I just tried it out on an Elixir file from a sample repo and it seems to work fine, so it could be a config issue. Could you post your full null-ls config?

from null-ls.nvim.

arjuns500 avatar arjuns500 commented on May 21, 2024

I also have the issue.

I can confirm that running :lua vim.lsp.buf.formatting() in the menu does not format. However, using the default language server which has formatting capabilities, the formatting works.

Running the formatter from the path also works, and formats the file correctly.

Configuration: https://github.com/systemctl603/neovim-config

from null-ls.nvim.

jose-elias-alvarez avatar jose-elias-alvarez commented on May 21, 2024

@systemctl603 Can you post your debug output? Your config seems fine. Also, can you verify that you see null-ls when you run :LspInfo?

from null-ls.nvim.

arjuns500 avatar arjuns500 commented on May 21, 2024

Debug output

running generators for method NULL_LS_DIAGNOSTICS
running generators for method NULL_LS_DIAGNOSTICS
running generators for method NULL_LS_DIAGNOSTICS
received LSP formatting request
running generators for method NULL_LS_FORMATTING
spawning command prettier with args:
{ "--stdin-filepath", "$FILENAME" }
error output: nil
output: nil
received edits from generators
{}
successfully applied edits

Results of :LspInfo

image

from null-ls.nvim.

jose-elias-alvarez avatar jose-elias-alvarez commented on May 21, 2024

Thanks! I see that you're on Windows, and so I suspect this is related to #95. @jalberto Are you also on Windows?

As I said there, I'm going to see if I can get some help on this from the Neovim Matrix chat, but since I don't know anything about Windows and don't have access to a Windows setup to test this on, there's not much I can do without a Windows user who's familiar with uv.spawn.

from null-ls.nvim.

jose-elias-alvarez avatar jose-elias-alvarez commented on May 21, 2024

Not sure if this is the same issue that was closed by 07fd5ab, but could you try updating to the latest version and see if it makes a difference?

from null-ls.nvim.

jalberto avatar jalberto commented on May 21, 2024

Sorry for the late reply.
I am on Linux and if I run the forma tin CLI it works as expected.
Also, I noticed something, 1st time I select null-ls do nothing, but if I repeat the command and select again null-ls, then it works as expected.

from null-ls.nvim.

jose-elias-alvarez avatar jose-elias-alvarez commented on May 21, 2024

Thanks for confirming. I'm testing this out a bit more and I can see that mix format has some unusual behavior. Could you quickly verify whether another formatter (e.g. Prettier) is working as expected?

from null-ls.nvim.

jalberto avatar jalberto commented on May 21, 2024

from null-ls.nvim.

jose-elias-alvarez avatar jose-elias-alvarez commented on May 21, 2024

Got it. I can see that mix format has a weird interaction with the way null-ls spawns processes and gets their output, and I have to determine whether it's a bug in my implementation, Neovim / luv, or the formatter itself, so this might take a bit.

from null-ls.nvim.

jose-elias-alvarez avatar jose-elias-alvarez commented on May 21, 2024

@jalberto When you get a chance, could you please try this branch of the plugin and see if mix works for you?

from null-ls.nvim.

jalberto avatar jalberto commented on May 21, 2024

from null-ls.nvim.

jose-elias-alvarez avatar jose-elias-alvarez commented on May 21, 2024

For Packer I think you need to set the branch like this:

use({ "jose-elias-alvarez/null-ls.nvim", branch = "fix-spawn-stdout" })

You might also need to comment out the plugin, uninstall it, and then re-install it to get the new branch to work (though I think Packer might have fixed this).

from null-ls.nvim.

jalberto avatar jalberto commented on May 21, 2024

from null-ls.nvim.

jose-elias-alvarez avatar jose-elias-alvarez commented on May 21, 2024

Great! I need to review and merge another PR first, but once I do, I'll merge the fix-spawn-stdout branch and close this issue.

from null-ls.nvim.

jalberto avatar jalberto commented on May 21, 2024

from null-ls.nvim.

jose-elias-alvarez avatar jose-elias-alvarez commented on May 21, 2024

Fix merged in b4a11d8.

from null-ls.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.