Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid linter complaints from missing fields in setup table #91

Open
adigitoleo opened this issue Aug 13, 2023 · 2 comments
Open

Avoid linter complaints from missing fields in setup table #91

adigitoleo opened this issue Aug 13, 2023 · 2 comments

Comments

@adigitoleo
Copy link

adigitoleo commented Aug 13, 2023

Hello, thanks for this wonderful implementation. I contributed previously to vim-floaterm and then used my own functions for a while, but now I'm migrating to init.lua and will adopt FTerm instead.

I have a minor grievance: I implemented a version of :Man that uses the FTerm buffer like this:

vim.api.nvim_create_user_command("MAN", function(opts)
    local arg = vim.fn.expand("<cword>")
    if opts.args ~= "" then arg = opts.args end
    require("FTerm").scratch({ cmd = { "man", arg } })
end, { nargs = "?" })

It works, however my lua linter (from the lua-language-server) is complaining about "Missing fields" in the setup table for scratch(). Do you know of a way to avoid this? Thanks

@xixiaofinland
Copy link

It's an issue in the current lua lang server, discussed here

You can put this above your line to disable this warning: require("FTerm").scratch({ cmd = { "man", arg } })
Not perfect but should work

---@diagnostic disable-next-line missing-fields 

@tummetott
Copy link

Not it’s not an issue in luals. The annotations are simply wrong, they should be marked as optional.

see hrsh7th/nvim-cmp#1694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants