Code Monkey home page Code Monkey logo

Comments (5)

nghialm269 avatar nghialm269 commented on May 20, 2024 2

@jose-elias-alvarez you're right, disable gitsigns works.

I enable gitsigns' code action because I'm curious what it provides, I don't actually use it so disabling it is fine for me.

Thanks for the quick help and great plugin, it's faster than efm and easier to config IMO, hope it will get more mature in the future.

from null-ls.nvim.

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

Hey! You're right about the expected behavior, and in fact I pushed a commit in the past couple of days that solved an issue causing null-ls to attach to all buffers. Are you still seeing this behavior on the latest commit?

from null-ls.nvim.

folke avatar folke commented on May 20, 2024

Sorry, forgot to close this one. Works as expected! Thanks!

from null-ls.nvim.

nghialm269 avatar nghialm269 commented on May 20, 2024

hi @jose-elias-alvarez, I'm getting the same issue, I'm using dartls (akinsho/flutter-tools)

I have this autocmd to run format on save when in dart buffer:

autocmd BufWritePre *.dart lua vim.lsp.buf.formatting_sync({}, 200)

Every time I save a dart buffer, neovim prompts me to choose between dartls and null-ls.

I also see null-ls in :LspInfo output.

How do I make null-ls ignore every filetype but the ones in the null-ls configuration?

My null-ls config:

local null_ls = require("null-ls")
local sources = {
	null_ls.builtins.formatting.stylua,
	null_ls.builtins.code_actions.gitsigns,
}
null_ls.setup({ sources = sources })

I also use your nvim-lsp-ts-utils plugin to integrate eslint and prettierd with null-ls.

from null-ls.nvim.

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

@nghialm269 Judging from your config, your issue is actually a bit different – it's because the Gitsigns builtin is enabled for all filetypes by default, and null-ls currently cannot recognize that it's not able to respond to the formatting request. This is something I want to work on when I have a little time, though, so I've opened up #28.

Edit: a (lousy) workaround for now is to specifically define the filetypes you want to use with Gitsigns:

null_ls.builtins.code_actions.gitsigns.with({ filetypes = { ... } })

Not a great workaround, though, and if I'm not wrong it shouldn't be too hard to fix it at the plugin level without workarounds, so keep an eye on the issue.

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.