nvim-spider icon indicating copy to clipboard operation
nvim-spider copied to clipboard

feat: integration with precognition.nvim

Open tandetat opened this issue 7 months ago • 6 comments
trafficstars

What problem does this PR solve?

This PR integrates spider.nvim with precognition.nvim, see #57

How does the PR solve it?

Exposes a Precognition Adapter based on spider’s motions.

Checklist

  • [x] Used only camelCase variable names.
  • [x] If functionality is added or modified, also made respective changes to the README.md (the .txt file is auto-generated and does not need to be modified).

tandetat avatar Apr 01 '25 23:04 tandetat

  • The failing type check is expected due to using precognition's typing. You can just add an lua-ls ignore comment for that.
  • Just a nit, but the folder should be named with a - and not a _. People rarely _ in lua requires, making it easy to overlook an underscore here.

chrisgrieser avatar Apr 02 '25 16:04 chrisgrieser

What do you think about registering the adapter by default rather than returning the adapter (as described in https://github.com/chrisgrieser/nvim-spider/issues/57)? @tandetat

rcasia avatar Apr 02 '25 18:04 rcasia

What do you think about registering the adapter by default rather than returning the adapter (as described in #57)? @tandetat

That might be a better approach than what I’m currently doing, which is registering the adapter inside precognition’s setup(). I changed it to what you suggested but I think this doesn’t work with what Tristan asked in this comment https://github.com/tris203/precognition.nvim/pull/105#issuecomment-2773650010

tandetat avatar Apr 02 '25 20:04 tandetat

@chrisgrieser sorry but I’m having problems with listing the title for the integration section in the README. Do you know why the linting is failing?

tandetat avatar Apr 02 '25 20:04 tandetat

Error: README.md:24:4 MD051/link-fragments Link fragments should be valid [Context: "Precognition.nvim Integration"] https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md051.md

I think you need to escape the . in #precognition.nvim-integration. As far as I remember, url-encoding applies? (I simply use markdown-toc to auto-generate the table of contents, so I don't remember the details)

Also, if that's the only issue left, you can also go ahead and set the PR for ready for review, no need to hold up the PR for something so minor, I can fix it myself after merging then.

chrisgrieser avatar Apr 02 '25 21:04 chrisgrieser

Error: README.md:24:4 MD051/link-fragments Link fragments should be valid [Context: "Precognition.nvim Integration"] https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md051.md

I think you need to escape the . in #precognition.nvim-integration. As far as I remember, url-encoding applies? (I simply use markdown-toc to auto-generate the table of contents, so I don't remember the details)

Also, if that's the only issue left, you can also go ahead and set the PR for ready for review, no need to hold up the PR for something so minor, I can fix it myself after merging then.

Sounds good! I still have to change some things so when I get an ok on both PRs I’ll set them ready for review.

tandetat avatar Apr 03 '25 15:04 tandetat

I think I fixed all of the issues you pointed out! I used markdown-toc to regenerate the toc for the README, let's see if that fixes the issue with the markdown linting

tandetat avatar Nov 08 '25 15:11 tandetat

looks good now, there are still some issues with the readme (markdownlint, also your markdown-toc using different indentation), but I can fix that myself if that's quicker.

However, GitHub blocks merging on my end due to conflicts. I then tried checking out your feature branch, but it seems the commit history is a bit of a mess, apparently you merged from main multiple times instead of rebasing onto your feature branch? Thus, even merging manually on the command line isn't really straightforward.

Not totally sure how to fix this. I think it's probably easier if you just created a new PR onto the up-to-date main branch and manually copy over your changes there…

chrisgrieser avatar Nov 08 '25 16:11 chrisgrieser

About the merge conflicts, that's super weird because on my end github says the branch has no conflicts with base.

tandetat avatar Nov 08 '25 17:11 tandetat

Okay I tried rebasing and resolving the conflicts, let me know if github still blocks the merge

tandetat avatar Nov 08 '25 17:11 tandetat

Yeah works now. Thanks for the PR!

chrisgrieser avatar Nov 08 '25 17:11 chrisgrieser