chore: add type annotations#2856
Conversation
skip-checks: true
|
|
||
| --- Picker is the main UI that shows up to interact w/ your results. | ||
| -- Takes a filter & a previewer | ||
| ---@class TelescopeBasePicker |
There was a problem hiding this comment.
this feels pretty ridiculous lol
| Parameters: ~ | ||
| {opts} (table) options to pass to the picker | ||
| TelescopeLiveGrepOpts *TelescopeLiveGrepOpts* | ||
| TelescopeBasePickerOpts |
|
@Conni2461 what do you think? |
|
i guess we can do that. i havent made up my mind regarding lua language servers annotations. they aren't compatible with emmylua annotations which are used within docgen (its uses a lua treesitter parser with emmylua support). fyi there is also this: #1954 |
Yeah I actually made an issue on tree-sitter-lua about (me) potentially adding or converting the ts grammar to support luals annotations. I know this is something neovim core eventually would like for their docgen purposes as well. Somebody just needs to do it. |
|
FYI I replaced telescope-file-browser's docgen with an alternative I've been working on. Looking to make a similar conversion for telescope core to enable changes like those in this PR. |
This Is The Way. (There are now tree-sitter parsers for both luadoc and emmylua, so we don't have to choose between type checking and docgen.) If this project is going to be actively developed in the future, strict annotations are a must IMO. |
|
(But maybe it makes sense to first pick a tool -- as a target, luals and emmyluals are broadly compatible -- and then start from scratch?) |
|
I did also raise a PR a while back to switch out the docgen tool for telescope core too. #3227 I haven't kept up much with how neovim core is still doing docgen. It was all LuaCATS parsing with LPEG back when I converted the neovim docgen script into https://github.com/jamestrew/docgen.nvim
I can take a look at giving it a refresh based on what neovim core is at today. |
|
If there's something core can expose through a refactor to make this easier for plugins, consider raising an issue! Plugin ecosystem health is something the team is taking quite seriously these days. |
|
@jamestrew is this superseded by #3227 ? |
|
something like a second attempt #3670 |
trying something out.
I like types and I think it can help with our documentation deficiencies as well (eg. confusions around why you can pass
default_texttofind_filesand why it's not documented, where to document it, etc, but this might need some enhancements to tree-sitter-lua since the newer luals luacats annotation support is limited).