Lazy load buffer text.
Close
@@ -1437,14 +1437,8 @@ pub trait ILanguageClient: IVim {
fn textDocument_didChange(&self, params: &Option<Params>) -> Result<()> {
info!("Begin {}", lsp::notification::DidChangeTextDocument::METHOD);
- let (buftype, languageId, filename, text): (String, String, String, Vec<String>) =
- self.gather_args(
- &[
- VimVar::Buftype,
- VimVar::LanguageId,
- VimVar::Filename,
- VimVar::Text,
- ],
+ let (buftype, languageId, filename): (String, String, String) = self.gather_args(
+ &[VimVar::Buftype, VimVar::LanguageId, VimVar::Filename],
params,
)?;
if !buftype.is_empty() || languageId.is_empty() {
@@ -1455,6 +1449,8 @@ pub trait ILanguageClient: IVim {
return self.textDocument_didOpen(params);
}
+ let (text,): (Vec<String>,) = self.gather_args(&[VimVar::Text], params)?;
+
let text = text.join("\n");
let text_state = self.get(|state| {
state
