#lsp #text #dictionary

nightly lsp-textdocument

A LSP text documents manager that map of text document

5 releases

0.2.3 Feb 16, 2023
0.2.2 Feb 9, 2023
0.2.1 Feb 7, 2023
0.2.0 Feb 6, 2023
0.1.0 Nov 20, 2022

#537 in Text processing

Download history 2/week @ 2022-11-27 1/week @ 2022-12-04 1/week @ 2022-12-11 2/week @ 2022-12-25 4/week @ 2023-01-01 1/week @ 2023-01-08 5/week @ 2023-01-15 10/week @ 2023-01-22 6/week @ 2023-01-29 245/week @ 2023-02-05 309/week @ 2023-02-12 231/week @ 2023-02-19 181/week @ 2023-02-26 112/week @ 2023-03-05 101/week @ 2023-03-12

642 downloads per month

MIT license

19KB
354 lines

lsp-textdocument

A LSP text documents manager that map of text document.

Introduction

You may not be able to manage your text documents comfortably when developing an LSP service. There are two reasons why we develop hard.

  • Always given a URL variable only, so we need to read the contents of the file ourselves.
  • Need map offsets from string index to text dimensional coordinates.

By listening to the notification from the LSP client, lsp-textdocument can help you automatically manage text documents.

This crate is base on vscode-languageserver-textdocument.

Example usage

Basic usage

use lsp_textdocument::TextDocuments;

fn main() {
    let text_documents = TextDocument::new();
    ...


    let text = text_documents.get_document_content(&url, None);
}

with lsp-server

examples/with_lsp_server.rs

with tower-lsp

coming soon

Dependencies

~2.9–4MB
~110K SLoC