lsp-textdocument

Crates.iolsp-textdocument
lib.rslsp-textdocument
version0.4.0
sourcesrc
created_at2022-11-20 02:53:05.911734
updated_at2024-07-11 10:56:53.682366
descriptionA LSP text documents manager that map of text document.
homepagehttps://github.com/GiveMe-A-Name/lsp-textdocument
repositoryhttps://github.com/GiveMe-A-Name/lsp-textdocument
max_upload_size
id718873
size42,686
qixuan (GiveMe-A-Name)

documentation

README

lsp-textdocument

A LSP text documents manager that helps mapping of textual content.

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

Contact us via issues if you require this with tower-lsp

Attention

Commit count: 54

cargo fmt