romgrk / barbar.nvim

The neovim tabline plugin.
2.23k stars 83 forks source link

docs: always specify `@return` #376

Closed Iron-E closed 1 year ago

Iron-E commented 1 year ago

This makes it so that we don't accidentally do something like this:

--- @return nil
local function foo()
  return true
end

--- @return nil
local function bar()
  if some_condition then
    -- easier than writing "foo()\nreturn"
    return foo() -- error! returns `boolean`
  end

  -- rest of function
end

I also managed to piece together the proper data types for the animations, so I documented those.