-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown links render as wikilinks when inserted via completion #436
Comments
I cannot reproduce this; I trigger completion with Using the LSP via neovim + nvim-cmp. |
But what if you filter the list, and then accept a completion option? i.e, this:
|
Following those steps, the link renders as markdown for me. Accepting/confirming the completion replaces the placeholder with a markdown link for me. If instead of accepting the first choice, I pick another, the placeholder text is replaced as soon as I pick another. |
Here an asciicast: https://asciinema.org/a/4lvriIlQLHMCKF33ms155QAs8 So it's actually a slightly different step (second and last link attempt in video):
Link renders as wikilink. @WhyNotHugo can you see if that can be reproduced on your end? |
What completion plugin is this? When you do the second (failing) insertion, what mapping do you use? What function does this call? I have an impression that you may not be properly triggering the completion and that this is an IDE configuration issue. Personally, I use |
So after typing a few chars, I hit So yeah, I'm also using |
Hmm, you don't even have a keybind for I also don't see a setting for autocomplete. What is this sorcery; How do you invoke the pop-up? haha |
ugh, ok I (half) figured it out. When I'm typing, and open completion, the only completion results I get are plain text completion results, and not lsp files. Even in a (freshly saved) blank document (where the text "untitled 2") is not present, Stranger still, after typing I guess this is what was throwing me off, I had no reason to expect a text completion when the only text in the document was It's still behaving strangely though. But it needs more investigating from my end. In other, other words
|
...Right. Got it: incorrect: sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
-- { name = "nvim_lua", keyword_length = 6 },
{ name = "path" },
{ name = "buffer" },
}), correct: sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
-- { name = "nvim_lua", keyword_length = 6 },
{ name = "path" },
}, {
{ name = "buffer" },
}), This slight change was meaning that my completion results were disappearing when I began to type.. If I do type (whereby the lsp file and text completions stay in place), but then hit Because I expect that after typing, that re-executing In any case, will close this for now, as if there is a bug. It's definitely worth starting a new issue for it. This one got busy!! Thanks for your extra eyes Hugo. |
Completion triggers automatically when I type. I had no idea about this syntax using For me, the LSP only shows suggestions of type |
I also have marksman lsp running, but it makes no difference. If I dissable markdman, I don't get the I also didn't know about this syntax for |
I realised that I'm using I configured I think that the LSP does not send any completions unless I have previously typed |
The completion provider only yields results in the two preceding characters are zk/internal/adapter/lsp/server.go Line 647 in 4a51e39
This is why manually invoking completion yields no results. |
This is called from internal/adapter/lsp/server.go:204 I think when |
I'll open a separate issue. |
Check if applicable
Describe the bug
No doubt related / see also #435 .
Despite using wikilink syntax to trigger completion (
[[
), when selecting a link from the lsp link completion menu, the link should be rendered as a regular markdown link provided the user haslink-format = "markdown"
in their config.toml.This however only happens for me if I select an initial completion option.
If I type, to filter the list, and select an option, the link is inserted as a regular wiki link.
Here a starting point:
zk/internal/adapter/lsp/server.go
Line 660 in 7251265
How to reproduce?
link-format = "markdown"
set in config[[
and accept a completionLink should render as a markdown link (and it does for me)
On a separate line:
[[
Link should render as markdown link (and it does not for me, it renders as a wikilink)
zk configuration
na
Environment
The text was updated successfully, but these errors were encountered: