I ran into an odd bug today I figured I should file in case others run into something similar. I'm unsure why this started happening.
When autocomplete options are suggested by lsp, and I hit the down arrow to highlight one and see its markdown description, an error is thrown and the markdown is not displayed. Here is the plaintext error as well as a screenshot of this happening:
Error detected while compiling function <SNR>15_AsyncRpcCb[20]..lsp#completion#CompletionResolveReply[1]..<SNR>26_ShowCompletionDocumentation[59]..FileType Autocommands for "*"..function <SNR>9_LoadFTPlugin[18]..script /home/jacob/dotfiles/vim/.vim/pack/downloads/opt/lsp/ftplugin/lspgfm.vim[76]..function <SNR>59_RenderGitHubMarkdownText:
Line 16:
E1048: Item not found in script: ParseMarkdown
It appears that, despite lsp/markdown.vim being imported as md at the top of lspgfm.vim, the md.ParseMarkdown function isn't found when called here:
I was able to fix this locally by making the following change to ftplugin/lspgfm.vim:
vim9script
-import autoload 'lsp/markdown.vim' as md
+import autoload '../autoload/lsp/markdown.vim' as md
# Update the preview window with the github flavored markdown text
def UpdatePreviewWindowContents(bnr: number, contentList: list<dict<any>>)
With this change, lsp works again as expected.
I am using the most recent commit of lsp (dfc001a), and the most recent version of the vim-enhanced package available on Fedora. I've included the relevant part of my .vimrc, as well as the output of vi --version below.
Hi there,
I ran into an odd bug today I figured I should file in case others run into something similar. I'm unsure why this started happening.
When autocomplete options are suggested by lsp, and I hit the down arrow to highlight one and see its markdown description, an error is thrown and the markdown is not displayed. Here is the plaintext error as well as a screenshot of this happening:
It appears that, despite
lsp/markdown.vim
being imported asmd
at the top oflspgfm.vim
, themd.ParseMarkdown
function isn't found when called here:https://github.com/yegappan/lsp/blob/dfc001ab109cb16ef4379d3d74554158bbebdcc5/ftplugin/lspgfm.vim#L58-L60
I was able to fix this locally by making the following change to
ftplugin/lspgfm.vim
:With this change, lsp works again as expected.
I am using the most recent commit of lsp (dfc001a), and the most recent version of the
vim-enhanced
package available on Fedora. I've included the relevant part of my.vimrc
, as well as the output ofvi --version
below.Version of VIM
Thanks for your work on this plugin!