google / google/vimdoc

Vimdoc refuses to generate helpfile for dict-functions that are not autoload

Open
#100 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
306
Forks
30
PR merge metrics
No merged PRs in 30d

Description

While vimdoc supports the notation of ``@dict``, which works with one form of dictionary functions, it skips all the functions that are not autoload.
For example, while you can use (example taken from maktaba)
```vim
""
" @dict Logger
" Interface for a plugin to send log messages to maktaba.

""
" @dict Logger
" Logs a {message} with [args...] at DEBUG level.
function! maktaba#log#Debug(message, ...) dict abort
call call('s:DoMessage', [s:LEVELS.DEBUG, self._context, a:message] + a:000)
endfunction
```
to generate something like
```
*maktaba.Logger*
Interface for a plugin to send log messages to maktaba.

Logger.Debug({message}, [args...]) *Logger.Debug()*
Logs a {message} with [args...] at DEBUG level.
````
you just _can't_ do the following:
```vim
""
" @dict Unhappy
" It doesn't work!

let s:unhappy = {}
""
" @dict Unhappy
function! s:unhappy.WannaCry()
echo 'Sad though'
endfunction
```
Nothing shows up in the generated helpfile. It seems that vimdoc considers autoload function to be first class thing and ignores the dict-functions defined with the dot notation (a shortcut), no matter what kind of variable preceding the dot.

I am posting this issue because I am currently working out a [plugin](https://github.com/cgsdfc/vim-newstyle.git)
that allows to define class in vim in a simpler way (Well, it maybe just a problem of style). My plugin uses the dot notation a lot and if vimdoc doesn't work with that, I will end up with no doc or some messy workaround code.
And I hope some support to this style can be patched in vimdoc.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.