-
Notifications
You must be signed in to change notification settings - Fork 26
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
Incorrectly rendered markdown docstring #33
Comments
Hey, im facing the same issue, did you find any solution on this? |
#35 seems like a similar issue? |
even though hovering over doesn't run into the same issue: @hrsh7th do you know why this might happen? |
@pwang2 what's your formatting function look like for the above? |
@aggonis, same cmp-nvim-lsp. I also used lspsaga's hover render which is claimed rendered via treesitter. similar result. By default, markdown conceal is automatically enabled which results too many empty lines. My 2 cents here is since it is a markdown renderer and we will not gona edit the file, using the rendered result could make sense. |
Just chipping in as I went through the same issues here - so I'm assuming it's difficult to change because this plugin doesn't modify the documentation we send and it is adjusted in the main code? Because I examined the floats that open and seems to me like the values passed are removed for the For example - right before the source.complete callback is called adding a log shows item: {
documentation = {
kind = "markdown",
value = "```go\nfunc NewFromConfig(cfg aws.Config, optFns ...func(*s3.Options)) *s3.Client\n```"
},
filterText = " ",
insertText = "optFns",
label = "optFns ...func(*s3.Options)",
preselect = true,
word = ""
} But examining the window content- Window Content:
func NewFromConfig(cfg aws.Config, optFns ...func(*s3.Options)) *s3.Client Whereas the floating window for hover (added backslash) Window Content:
\```go
func s3.NewFromConfig(cfg aws.Config, optFns ...func(*s3.Options)) *s3.Client
\``` Let me know if I am doing anything wrong - but basically my main question would be @hrsh7th - if we add a source and provide values to the complete callback - (referencing the docs) - is it not determinnistic? I'm trying to figure out if the issue is in the code here or if it is because the Let me know, would appreciate it - thanks for the awesome plugins :) |
Nevermind - this has nothing to do with cmp's implementation. You can reference the code here and add in your hrsh7th/nvim-cmp#1699 (comment) To fix the issue of it showing as Text - you can add this to where it returns the label on Line 118 return {
label = label,
filterText = ' ',
insertText = self:_matchstr(label, [[\k\+]]),
word = '',
preselect = true,
documentation = self:_docs(signature, parameter_index),
---
kind = require('cmp').lsp.CompletionItemKind.Function, -- add this
}
end
|
As shown in the figure below:
This the the completion from nvim-cmp + cmp-nvim-lsp:
While this is the signatur help of the same function from nvim-cmp + cmp-nvim-lsp-signature-help:
The text was updated successfully, but these errors were encountered: