Giter VIP home page Giter VIP logo

Comments (9)

rcarriga avatar rcarriga commented on July 19, 2024 2

Hmm I think the best way would be instead to add enabled_filetypes for neotest-vim-test so everything is disabled by default

from neotest.

rcarriga avatar rcarriga commented on July 19, 2024

I've added the jump consumer so have a look at :h neotest.jump 😄

Also I've added an options key to the floating windows opts so you can provide the following to setup table

  floating = {
    options = {
      winblend = 50
    },
  },

from neotest.

axieax avatar axieax commented on July 19, 2024

Thanks so much for the quick additions! Also, just wondering if there is a better way of defining adapters (especially for the ignore_file_types of vim-test). I understand that it may not be so easy to expose the filetypes from each adapter due to is_test_file.

local adapter_config = {
  go = {
    filetypes = { "go" },
  },
  jest = {
    filetypes = { "javascript", "typescript", "javascriptreact", "typescriptreact", "coffee" },
  },
  python = {
    filetypes = { "python" },
  },
  plenary = {
    filetypes = { "lua" },
  },
}

local adapters = {}
local adapter_filetypes = {}
for adapter, opts in pairs(adapter_config) do
  local ok, neotest_adapter = pcall(require, "neotest-" .. adapter)
  if ok then
    table.insert(adapters, neotest_adapter(opts))
    vim.list_extend(adapter_filetypes, opts.filetypes)
  end
end

table.insert(adapters, require("neotest-vim-test")({ ignore_file_types = adapter_filetypes }))

require("neotest").setup({
  adapters = adapters,
  -- floating = { options = { winblend = 80 } },
})

from neotest.

rcarriga avatar rcarriga commented on July 19, 2024

OK I've added an allow_file_types option to neotest-vim-test

from neotest.

axieax avatar axieax commented on July 19, 2024

o.0 how would I adapt the config above to use that option?

from neotest.

rcarriga avatar rcarriga commented on July 19, 2024

So just set allow_file_types to be a list of filetypes that you do want to use vim-test for, and it'll ignore everything else

from neotest.

axieax avatar axieax commented on July 19, 2024

Hmm my use case is to find a way to automatically ignore filetypes for adapters that have been registered in the setup function (such as neotest-go automatically prioritising itself over vim-test, neotest-python automatically prioritising itself over vim-test etc.)

from neotest.

rcarriga avatar rcarriga commented on July 19, 2024

I'm not sure why you need the safety check of if adapters are installed but that is a very unique case that won't be covered by neotest. You'll have to do it manually as have above if you want to go that route

from neotest.

axieax avatar axieax commented on July 19, 2024

Oh my intention was just to prevent conflicts between the newer adapters and the default ones provided by vim-test. Sorry for any potential misunderstandings.

from neotest.

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.