Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

vscode-languageclient

Package Overview
Dependencies
7
Maintainers
7
Versions
297
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vscode-languageclient

VSCode Language client implementation


Version published
Weekly downloads
889K
decreased by-20.37%
Maintainers
7
Install size
1.70 MB
Created
Weekly downloads
 

Package description

What is vscode-languageclient?

The vscode-languageclient npm package is a library that helps in creating language clients for Visual Studio Code extensions. It facilitates communication between the client (VS Code) and the language server, enabling features like auto-completion, go-to-definition, and diagnostics.

What are vscode-languageclient's main functionalities?

Initialize Language Client

This code initializes a language client that communicates with a language server. The client is configured to listen to plaintext files and synchronize file events.

const { LanguageClient, TransportKind } = require('vscode-languageclient/node');
const client = new LanguageClient(
  'languageServerExample',
  'Language Server Example',
  {
    command: 'path/to/language-server',
    args: [],
    transport: TransportKind.stdio
  },
  {
    documentSelector: [{ scheme: 'file', language: 'plaintext' }],
    synchronize: {
      fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
    }
  }
);
client.start();

Handle Server Notifications

This code sets up a handler for custom notifications sent from the language server to the client. It logs the received notification parameters to the console.

client.onReady().then(() => {
  client.onNotification('custom/notification', (params) => {
    console.log('Received custom notification:', params);
  });
});

Send Custom Requests

This code sends a custom request from the client to the language server and logs the server's response.

client.onReady().then(() => {
  client.sendRequest('custom/request', { text: 'Hello, server!' }).then((response) => {
    console.log('Received response:', response);
  });
});

Other packages similar to vscode-languageclient

Readme

Source

VSCode Language Server - Client Module

NPM Version NPM Downloads Build Status

This npm module allows VSCode extensions to easily integrate language servers adhering to the language server protocol

See here for a detailed documentation on how to implement language servers for VSCode.

History

For the history please see the main repository

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