Conversation
d288d00 to
81463b9
Compare
I did make an effort to switch out the custom tree-sitter-lua based docgen for one based off of neovim core several years back. #3227 I can revive this. |
2ca4b60 to
bd0c1ae
Compare
|
Thank you @clason . I almost understood and agreed the changes. I will use this branch and check extensions' behaviors. |
ef0c587 to
9f14788
Compare
8548fdf to
633ce43
Compare
| cwd = vim.uv.cwd() | ||
| end | ||
| return Path:new(path):make_relative(cwd) | ||
| return vim.fs.relpath(cwd, path) or path |
There was a problem hiding this comment.
So here we run into the big issue: Nvim is aggressively standardizing on forward slashes for path separators even on Windows (as they should, this being standard now for many years!) but both path.lua and -- more importantly -- our utils.lua want to normalize to backslashes on Windows. (Hence the test failure.)
I feel strongly that we should follow upstream's lead on this and -- if necessary -- normalize to forward slashed at the edges (fd or grep?) only.
There was a problem hiding this comment.
(That makes the fzy_sorter tests fail, though, for reasons I can't quite trace yet.)
d499677 to
633ce43
Compare
| return match | ||
| end | ||
| end | ||
| return vim.filetype.match { filename = filepath } |
There was a problem hiding this comment.
Dropping the modeline etc. fallbacks since they never worked for me (help files).
f0915e6 to
46f85af
Compare
This started as an
procrastinationinvestigation into what we actually use from Plenary, and which part of it can easily be replaced with current Neovim API. This is obviously not ready to merge yet, but I'm putting this here in the open now that Plenary is going to be archived, in case people want to follow along (and pitch in) as I keep chipping at it.I think I have picked all of the low-hanging fruit, but there's obviously much more to be done. Roughly in order of difficulty:
class.luamodule is only used in the (now renamed)async_jobtelescope module to define a bunch of pipes objects. These should just be created directly, but care is required to adapt the downstream usage.scandir.luais only used in one place: to list files in a directory previewer.As I don't use that myself, I have been hesitant to convert it (should be a straightforward replacement using a variant ofAs far as I can tell, the directory preview is only used in the telescope-file-browser extension, which isn't actively maintained and arguably too far out of scope for a core extension.vim.system('ls'), so that's another nice, self-contained, project).path.luamodule usages are straightforward to replace withvim.fsandvim.fncalls; there's just quite a few of them. But this can be done file by file, so it's a good "fifteen minute project" when someone is bored. A first step could also be is to just replace suitable functions with wrappers of existing (libuv or Nvim ) API and prune then-unused internal functions. EDIT: In particular, the OO wrapper should be removed and replaced by flat string manipulation functions (and moved, if necessary, toutils.lua).strings.luamodule now contains only a few useful utility functions; these could be moved to a stand-alonetelescope.strings. (Except fordedent; that should be replaced.)border.luaandpopup.luacan probably stay, but should be refactored to be a single UI utility module -- possibly moved into thetelescopemodule. (That requires a bit more knowledge about the architecture than I have.) In any case, we don't need a wrapper that is expressly designed to make Nvim floating windows look like Vim popups (just something that makes our life easier).job.luamodule should be replaced byvim.system; again, the deep integration makes this trickier but there should not be much feature disparity that would block this. One could start with refactoring the toputils.luamodule and see where to go from there.async.lua(includingvararg.lua, which is only used there) andlog.luaare probably the biggest modules; these will have to stay for a bit untilvim.asyncandvim.logare done, in which case migrating to those will be a rather big (but necessary) refactor.So the plan for _this PR is:
class,path, andscandir.border/popup,job,log,asyncand expose them for extensions.A follow-up PR should rewrite
jobas a thin wrapper overvim.systemand deprecate it (logandasyncwill get the same treatment once the corresponding upstream modules are stable).A couple of notes:
feat/neoplenbranch in your plugin spec.plenary.bustedandtest_harnessmodules are no longer in-tree but moved to an externalplentest.nvimmodule that is a test-only dependency.neoplenexactly so they won't conflict withplenaryinstalled as a dependency for an extension, but they of course will need to adapt in some way if we want to completely remove the dependency. I expect that this will involve a mix of using upstream API (for things likepath) combined with simply pulling in one of the remainingneoplenmodules. This is a bit tricky since I cleaned out modules that are still here, so I have probably removed functions that extensions rely on -- these will have to be added back. @delphinus