zk-org / zk-nvim

Neovim extension for zk
https://github.com/zk-org/zk
GNU General Public License v3.0
502 stars 40 forks source link

Incorrect "not found" diagnostic #161

Closed Rolv-Apneseth closed 5 months ago

Rolv-Apneseth commented 6 months ago

Check if applicable

Describe the bug

In a note, I have a code extract from a Cargo.toml, which is giving a diagnostic message: not found. This is because it uses the same syntax as linking to a note I guess, but I would prefer if anything within a code block would be ignored by zk-nvim

How to reproduce?

Use code block, diagnostic is on the line with [[bench]]:

```toml
[dev-dependencies]
criterion = { version = "0.5.1", features = ["html_reports"] }

[[bench]]
name = "main"
path = "benches/bench.rs"
harness = false
```

zk configuration

[lsp.diagnostics]
wiki-title = "hint"
dead-link = "error"

Neovim configuration

zk-nvim opts:

{
        picker = "telescope",
        lsp = {
            config = {
                cmd = { "zk", "lsp" },
                name = "zk",
            },
            auto_attach = {
                enabled = true,
                filetypes = { "markdown" },
            },
        },
    }

### Environment

```bash
zk 0.14.0
system: Linux 6.7.5-arch1-1 x86_64 GNU/Linux
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"
tjex commented 5 months ago

Hey, thanks for the report. Yep, this is a known bug. It's been reported, albeit in the zk repo. We'll be working on it shortly 👍

Rolv-Apneseth commented 5 months ago

Perfect, thank you for continuing to maintain this

Rahlir commented 5 months ago

@tjex I have an almost working fix for this that I am planning to submit this week. So, if you haven't started working on this, I will get this done.

tjex commented 5 months ago

@Rahlir I'd be greatly appreciative if you submit. Thanks so much! And feel free to make a draft PR if you'd like some input / help with anything 👍