Socket
Socket
Sign inDemoInstall

vscode-languageserver-textdocument

Package Overview
Dependencies
0
Maintainers
8
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vscode-languageserver-textdocument

A simple text document implementation for Node LSP servers


Version published
Weekly downloads
2.7M
increased by1.89%
Maintainers
8
Install size
38.5 kB
Created
Weekly downloads
 

Package description

What is vscode-languageserver-textdocument?

The vscode-languageserver-textdocument package is designed to provide support for creating and managing text documents in language servers that are compatible with the Language Server Protocol (LSP). This package is particularly useful for developers building extensions for code editors like Visual Studio Code, enabling them to handle text document manipulations and updates efficiently.

What are vscode-languageserver-textdocument's main functionalities?

Text Document Creation

This feature allows the creation of a new text document. The 'create' method takes parameters such as URI, language identifier, version number, and the initial text content of the document.

const { TextDocument } = require('vscode-languageserver-textdocument');
const textDocument = TextDocument.create('uri', 'languageId', 1, 'Initial content of the document.');

Text Document Update

This feature supports updating the content of an existing text document. The 'update' method is used to apply changes to the document, where changes are described in terms of text ranges and new text, and the document version is incremented.

const { TextDocument } = require('vscode-languageserver-textdocument');
const textDocument = TextDocument.create('uri', 'languageId', 1, 'Initial content');
const changes = [{ range: { start: { line: 0, character: 0 }, end: { line: 0, character: 13 } }, text: 'Updated content' }];
textDocument.update(changes, 2);

Other packages similar to vscode-languageserver-textdocument

Readme

Source

Text Document implementation for a LSP Node server

NPM Version NPM Downloads

Npm module containing a simple text document implementation for Node.js language server

Click here for a detailed document on how to implement language servers for VSCode.

History

1.04

  • Introduced ESLint rule for member delimiter style.

1.03

  • Moved to ES2020 target and lib

1.0.2

  • JSDoc updates

1.0.0

Initial version.

License

MIT

FAQs

Last updated on 26 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc