Skip to content

Fix completion of markdown links with LSP titles#533

Merged
tjex merged 6 commits intozk-org:mainfrom
vandalt:fix-markdown-completion
May 19, 2025
Merged

Fix completion of markdown links with LSP titles#533
tjex merged 6 commits intozk-org:mainfrom
vandalt:fix-markdown-completion

Conversation

@vandalt
Copy link
Copy Markdown
Contributor

@vandalt vandalt commented Mar 30, 2025

Fixes #435 and zk-org/zk-nvim#176.

After looking at the code and testing earlier versions, it seems that the issue was introduced in #397, which fixed the issue of triggering completion manually, but also introduced offsets that account for words instead of just using a -2 offset. The -2 offset worked for both [[ and ((, but the checks in #397 only accounted for [[ which broke completion for ((.

This PR just adds an extra condition to also catch ((. Some notes:

  • I don't really know go, so comments welcome
  • It seems that trigger (non-auto) completion with [[| was fixed by fix(lsp): fix trigger completion of zk LSP #397, but that [[somewords| still does not work. And it still does not work with these small updates (but ((| works just like [[)
  • I'm marking this as a draft for now because I want to double check the TODO comments I added (basically (( is included in the word regex, but [[ is not, so I need to account for that

@vandalt vandalt marked this pull request as ready for review April 26, 2025 05:36
@vandalt
Copy link
Copy Markdown
Contributor Author

vandalt commented Apr 27, 2025

Ok I think this is ready for review. The second bullet point above is also fixed: invoked (non-auto) completion now also works with parentheses.

Thanks!

@tjex
Copy link
Copy Markdown
Member

tjex commented May 11, 2025

Thanks for all of this, and sorry for being slow. I'm juggling a lot atm, but will cool off round July / August

@tjex tjex self-requested a review May 19, 2025 18:29
Copy link
Copy Markdown
Member

@tjex tjex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with and without autopairs enabled. Tested manual completion as well.

All working and code changes seem straight forward enough, thanks!

@tjex tjex added this to the 0.14.3 milestone May 19, 2025
@tjex tjex merged commit 47d0586 into zk-org:main May 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Titles inside markdown links breaks LSP link completion

2 participants