Sublime Forum

LSP across code blocks in Rmarkdown


Hey there,
I am using Sublime Text to write Rmarkdown (.Rmd) files.
I have LSP-R set-up which works great in .R scripts.
However, when writing an .Rmd file, LSP seems not to be aware of any objects or functions in the workspace.
I only get completion suggestions from Sublime’s general word-completion and if I try to rename a variable using LSP I get the Error “Invalid response payload”.
Is this a general limitation of LSP-R or could something in my settings be wrong?
The “selector” field in my LSP-R.sublime-settings file is “source.r | text.html.markdown.rmarkdown” so I assume this is right.
It would be great if anyone could help since I really enjoy using Sublime Text otherwise.




I fixed it!
Here’s what happened in case anyone else stumbles over this problem:
The package DictionaryAutoComplete somehow pushed out the suggestions for variable and function names by LSP as it also ran in the Rmarkdown source.r scope!
I hacked around in the DictionaryAutoComplete plugin to exclude that scope (might do a pull request some day) and now everything works!
Even the renaming works now, which I don’t fully understand why, but I’m not mad about it. =)