mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.98k stars 715 forks source link

Access docstrings of defs and decls #1166

Open danr opened 7 years ago

danr commented 7 years ago

I propose $kak_def_docstrings, and $kak_decl_docstrings to hold all defined defs and decls together with their docstrings.

Use cases:

lenormf commented 7 years ago

Is there something you would like to use this feature for, precisely?

danr commented 7 years ago

Yes! See the use cases!

lenormf commented 7 years ago

Your usecases are just general ideas of what would be doable, do you need this feature to code something in particular?

danr commented 7 years ago

I think I fail to see the difference.

But perhaps you're asking if lacking this severly blocks my workflow. If so, the answer is no.

lenormf commented 7 years ago

If you're asking for features that we don't need, the incentive to taking the risk of introducing more bugs into the codebase melts away, so I'm asking if you're working on a script that would make use of those features. This is not about the relevancy of the request, but about if we plan on implementing a feature just for the sake of having it.

danr commented 7 years ago

Thank you for your reply.

I hear your concern about bloating the codebase with features we do not need. I share this care about Kakoune. For example: I implemented my own gi and Gi since I thought they were not in the editor because they could be derived.

Regarding this and the other feature requests I raised today I do not think they introduce extra baggage, since:

Just as you, I have put my confidence in this editor, too. I have spent over 100 hours to configure and think about Kakoune. The issues and feature requests I raise are for the benefit of myself but also for the benefit of all of us. Please, next time you are concerned that I carelessly want to bloat the code base, raise this and state why you estimate the introduced complexity does not outweigh the benefits.

Delapouite commented 7 years ago

While using neovim, I constantly use fzf.vim for this precise purpose : https://github.com/junegunn/fzf.vim

Being able to fuzzy search any list from kakoune in a quick and uniform way really improved my workflow.

In fact one of my last request about searching history is directly related https://github.com/mawww/kakoune/issues/1130

So yes, the more info we can get out of this black box, the better.

mawww commented 7 years ago

I agree that it would be nice to expose the docstrings for a few reasons, mainly allow better integration with external tools providing UI, and the ability to generate documentation from the code.

I am not sure about the interface though, it seems wrong to just put all the infos in a single env var, but on the other hand, using on env var per command might get convoluted to access, as the full var name needs to appear in the %sh{...} block. Also, we use - as a word separator for commands, so we cannot easily use them as part of env var names.

Delapouite commented 7 years ago

related PR adding missing docstrings to decl in rc files: https://github.com/mawww/kakoune/pull/1374

lenormf commented 3 years ago

Related #1605