Files
telescope.nvim/CONTRIBUTING.md
Simon Hauser ca92ec1a83 fix: a lot of small things and adds more customization for caret (#554)
Attention:
prompt_prefix will no longer add a space at the end. So if you still want a space at the end make sure your configuration has one.
The default should not be changed. So if you haven't copied prompt_prefix in your config this doesn't affect you.

Feat:
- prompt prefix does no longer always end with space
- selection_caret configurable. Default: `> `
- result_prefix configurable. Default: `  `
- more actions for git_branches
  - <c-t> does track the branch
  - <c-r> does rebase branch
  - also added delete branch action but not configured. See readme on how to do that

Fixes:
- fix docgen ci
- Better error for lsp_workspace_symbols
- better formatting for CONTRIBUTING.md
- move from systemlist to plenary.job
- git branch now supports checkout on remote branches
2021-02-27 16:26:25 +01:00

2.1 KiB

Documentation

is generating docs based on the tree sitter syntax tree. TJ wrote a grammar that includes the documentation in this syntax tree so we can do take this function header documentation and transform it into vim documentation. All documentation will be exported that is part of the returning module. So example:

local m = {}

--- Test Header
--@return 1: Returns always 1
function m.a() -- or m:a()
  return 1
end

--- Documentation
function m.__b() -- or m:__b()
  return 2
end

--- Documentation
local c = function()
  return 2
end

return m

This will export function a with header documentation and the return value. Module function b and local function c will not be exported.

What is missing?

The docgen has some problems on which people can work. This would happen in https://github.com/tjdevries/tree-sitter-lua and documentation of some modules here. I would suggest we are documenting lua/telescope/builtin/init.lua rather than the files itself. We can use that init.lua file as "header" file, so we are not cluttering the other files. How to help out with documentation:

Auto-updates from CI

The easy way would be:

  • write some docs
  • commit, push and create draft PR
  • wait a minute until the CI generates a new commit with the changes
  • Look at this commit and the changes
  • Modify documentation until its perfect. You can do git commit --amend and git push --force to remove the github ci commit again

Generate on your local machine

The other option would be setting up https://github.com/tjdevries/tree-sitter-lua

  • Install Treesitter, either with package manager or with github release
  • Install plugin as usual
  • cd to plugin
  • mkdir -p build parser sadly does doesn't exist
  • make build_parser
  • ln -s ../build/parser.so parser/lua.so We need the shared object in parser/ so it gets picked up by neovim. Either copy or symbolic link
  • Make sure that nvim-treesitter lua parser is not installed and also delete the lua queries in that repository. queries/lua/*. If you are not doing that you will have a bad time!
  • cd into this project
  • Write doc
  • Run make docgen
  • Repeat last two steps